From 832a522cce4a40a520d21b1c67472a6e4d2ea382 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Fri, 29 Nov 2019 14:15:32 +0200 Subject: [PATCH] kms-impl/simple: Fix meta_set_fallback_feedback_idle Presumably this function is supposed to be like meta_kms_impl_simple_handle_page_flip_callback() but the condition in the if-statement is inverted. Fix the inversion to make these two functions look alike. This is part 2 of 2 fixing a complete desktop freeze when drmModePageFlip() fails with EINVAL and the fallback to drmModeSetCrtc() succeeds but the success is not registered correctly as completed "flip". The freeze occurs under wait_for_pending_flips() which calls down into meta_kms_impl_device_dispatch() which ends up poll()'ing the DRM fd even though drmModeSetCrtc() will not produce a DRM event, hence the poll() never returns. The freeze was observed when hotplugging a DisplayLink dock for the first time on Ubuntu 19.10. This patch makes meta_set_fallback_feedback_idle() actually end up calling into notify_view_crtc_presented() which decrements secondary_gpu_state->pending_flips so that wait_for_pending_flips() can finish. CC stable: gnome-3-34 https://gitlab.gnome.org/GNOME/mutter/merge_requests/953 --- src/backends/native/meta-kms-impl-simple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/native/meta-kms-impl-simple.c b/src/backends/native/meta-kms-impl-simple.c index 78d5cc445..cd18ce736 100644 --- a/src/backends/native/meta-kms-impl-simple.c +++ b/src/backends/native/meta-kms-impl-simple.c @@ -519,7 +519,7 @@ mode_set_fallback_feedback_idle (gpointer user_data) g_clear_pointer (&impl_simple->mode_set_fallback_feedback_source, g_source_unref); - if (!impl_simple->pending_page_flip_retries) + if (impl_simple->pending_page_flip_retries) { impl_simple->postponed_mode_set_fallback_datas = g_steal_pointer (&impl_simple->mode_set_fallback_page_flip_datas);