From 8478db96f9b8507cc025e16c52187bd86fb26b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 9 Jun 2021 18:28:46 +0200 Subject: [PATCH] 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: --- src/backends/native/meta-renderer-native.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c index f12e2dda7..a84f3025f 100644 --- a/src/backends/native/meta-renderer-native.c +++ b/src/backends/native/meta-renderer-native.c @@ -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); - renderer_native->pending_mode_set_views = - g_list_copy (meta_renderer_get_views (renderer)); + 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_prepend (renderer_native->pending_mode_set_views, + stage_view); + } + } renderer_native->pending_mode_set = TRUE; meta_topic (META_DEBUG_KMS, "Queue mode set");