renderer-native: Don't attempt to queue mode sets on non-onscreen views

A view is only a 'CoglOnscreen' if it ends up on a CRTC, thus needs a
mode. Other views are for virtual monitors, and require no mode setting,
so exclude them from the pending mode set list.

This avoids a dead lock when we'll be waiting indefinitely for mode
setting on a virtual monitor.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1891>
This commit is contained in:
Jonas Ådahl 2021-06-09 18:28:46 +02:00 committed by Marge Bot
parent 2a81c6d393
commit 8478db96f9

View File

@ -829,10 +829,22 @@ static void
meta_renderer_native_queue_modes_reset (MetaRendererNative *renderer_native)
{
MetaRenderer *renderer = META_RENDERER (renderer_native);
GList *l;
g_list_free (renderer_native->pending_mode_set_views);
for (l = meta_renderer_get_views (renderer); l; l = l->next)
{
ClutterStageView *stage_view = l->data;
CoglFramebuffer *framebuffer =
clutter_stage_view_get_onscreen (stage_view);
if (COGL_IS_ONSCREEN (framebuffer))
{
renderer_native->pending_mode_set_views =
g_list_copy (meta_renderer_get_views (renderer));
g_list_prepend (renderer_native->pending_mode_set_views,
stage_view);
}
}
renderer_native->pending_mode_set = TRUE;
meta_topic (META_DEBUG_KMS, "Queue mode set");