[client] wayland: serialize surface commits with EGL swaps

NVIDIA's Wayland EGL implementation sets explicit-sync acquire and
release points while presenting a frame. The requests emitted by
eglSwapBuffers and its final surface commit must be treated as one
logical transaction.

The pointer-warp path can commit the main surface from the input
thread while the render thread is inside eglSwapBuffers. If this
occurs between the explicit-sync requests, the cursor commit applies
incomplete pending state and the compositor disconnects the client
with:

  explicit sync is used, but no release point is set

Add a surface lock and hold it across EGL presentation. Use the same
lock for direct commits, frame callback registration, and
pointer-constraint updates, replacing the narrower confinement lock.
This prevents another thread from splitting the EGL transaction and
removes the need for __NV_DISABLE_EXPLICIT_SYNC=1.
This commit is contained in:
Geoffrey McRae
2026-07-30 11:09:07 +10:00
parent a9b8f437d4
commit f3155647d2
5 changed files with 74 additions and 60 deletions

View File

@@ -134,6 +134,7 @@ struct WaylandDSState
struct wl_seat * seat;
struct wl_shm * shm;
struct wl_compositor * compositor;
LG_Lock surfaceLock;
struct WaylandScale scale;
bool fractionalScale;
@@ -192,7 +193,6 @@ struct WaylandDSState
struct zwp_locked_pointer_v1 * lockedPointer;
bool showPointer;
uint32_t pointerEnterSerial;
LG_Lock confineLock;
struct zwp_idle_inhibit_manager_v1 * idleInhibitManager;
struct zwp_idle_inhibitor_v1 * idleInhibitor;