From 29cfa58e3b6f66c5e5c7241b4b8717c624036f32 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 19 Jul 2026 17:34:14 +1000 Subject: [PATCH] [client] hdr: serialize surface format transitions Queue the display-server surface format while the renderer lock still serializes the matching onFrameFormat update. This prevents the render thread from presenting a frame in a new HDR encoding before the Wayland image description transition has been queued. --- client/src/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src/main.c b/client/src/main.c index 15d05ee3..b34d43b3 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -777,8 +777,12 @@ int main_frameThread(void * unused) const bool rendererSupportsNativeHDR = !lgrFormat.hdr || !g_state.lgr->ops.supports || RENDERER(supports, lgrFormat.hdrPQ ? LG_SUPPORTS_HDR_PQ : LG_SUPPORTS_HDR_SCRGB); - LG_UNLOCK(g_state.lgrLock); + // Publish the matching surface format before allowing the render thread + // to consume the renderer format. Otherwise it can present one frame in + // the new encoding while the display server still has the old image + // description attached. renderQueue_surfaceFormat(lgrFormat, rendererSupportsNativeHDR); + LG_UNLOCK(g_state.lgrLock); g_state.srcSize.x = lgrFormat.screenWidth; g_state.srcSize.y = lgrFormat.screenHeight;