[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

@@ -108,6 +108,7 @@ static bool getCompositor(char * dst, size_t size)
static bool waylandInit(const LG_DSInitParams params)
{
memset(&wlWm, 0, sizeof(wlWm));
LG_LOCK_INIT(wlWm.surfaceLock);
LG_LOCK_INIT(wlWm.pendingHDRLock);
LG_LOCK_INIT(wlWm.hdrLock);
wlWm.desktop = WL_Desktops[0];
@@ -214,6 +215,7 @@ static void waylandFree(void)
wl_display_disconnect(wlWm.display);
LG_LOCK_FREE(wlWm.hdrLock);
LG_LOCK_FREE(wlWm.pendingHDRLock);
LG_LOCK_FREE(wlWm.surfaceLock);
}
static bool waylandGetProp(LG_DSProperty prop, void * ret)