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
This commit is contained in:
Pekka Paalanen 2019-11-29 14:15:32 +02:00 committed by Jonas Ådahl
parent 79491df2b8
commit 832a522cce

View File

@ -519,7 +519,7 @@ mode_set_fallback_feedback_idle (gpointer user_data)
g_clear_pointer (&impl_simple->mode_set_fallback_feedback_source, g_clear_pointer (&impl_simple->mode_set_fallback_feedback_source,
g_source_unref); g_source_unref);
if (!impl_simple->pending_page_flip_retries) if (impl_simple->pending_page_flip_retries)
{ {
impl_simple->postponed_mode_set_fallback_datas = impl_simple->postponed_mode_set_fallback_datas =
g_steal_pointer (&impl_simple->mode_set_fallback_page_flip_datas); g_steal_pointer (&impl_simple->mode_set_fallback_page_flip_datas);