Skip to content
  • Daniel Stone's avatar
    egl/wayland: Use per-surface event queues · 03dd9a88
    Daniel Stone authored
    
    
    During display initialisation, we need a separate event queue to handle
    the registry events, which is correctly handled. But we also need
    separate per-surface event queues to handle swapchain-related events,
    such as surface frame events and buffer release events. This avoids two
    surfaces from the same EGLDisplay, both current on separate threads,
    dispatching each other's events.
    
    Create separate per-surface event queues, create wl_surface and wl_drm
    proxy wrapper objects per surface, so we eliminate the race around
    sending events to the wrong queue. swrast buffers do not need a
    dedicated proxy wrapper, as the wl_shm_pool used to create the
    wl_buffers, being transient, can itself be assigned to a queue.
    
    Signed-off-by: default avatarDaniel Stone <daniels@collabora.com>
    Reviewed-by: default avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
    Fixes: 36b9976e ("egl/wayland: Avoid race conditions when on non-main thread")
    Cc: mesa-stable@lists.freedesktop.org
    03dd9a88