[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.
This commit is contained in:
Geoffrey McRae
2026-07-19 17:34:14 +10:00
parent 57d39bdd78
commit 29cfa58e3b

View File

@@ -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;