1
0
Fork 0

stage-impl: Ensure that a sync object is created in headless mode

During an onscreen swap, the cogl_onscreen_swap_buffers_with_damage()
function ensures that the Cogl renderer creates a sync object every
frame. This sync object is later shared with the Wayland clients that
utilize the explicit sync protocol.

However, in headless mode, the function mentioned above is not called.
As a result, the sync object the Cogl renderer stores seems to be not
created. This causes cogl_context_get_latest_sync_fd() function to
return an invalid sync fd, causing Mutter to not be able to materialize
the sync timeline point that the clients wait for when the explicit sync
protocol is in use.

This change simply adds a call to the cogl_framebuffer_flush() function
to the offscreen swap path to make sure that there is a sync object that
can be shared with the clients, which will be signalled when all the
queued operations before the swap are completed.

Signed-off-by: Doğukan Korkmaztürk <dkorkmazturk@nvidia.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4056>


(cherry picked from commit 6a0cc1371c)
This commit is contained in:
Doğukan Korkmaztürk 2024-09-30 16:20:17 -04:00
parent 6e1e870e5a
commit 95f9bb2f03

View file

@ -328,6 +328,8 @@ swap_framebuffer (ClutterStageWindow *stage_window,
meta_topic (META_DEBUG_BACKEND,
"fake offscreen swap (framebuffer: %p)",
framebuffer);
cogl_framebuffer_flush (framebuffer);
meta_stage_view_perform_fake_swap (view, priv->global_frame_counter);
priv->global_frame_counter++;
}