From c9a5b2b22f4bbe53bae2008ffa12b7376ca68b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 17 Jan 2020 08:28:17 +0100 Subject: [PATCH 33/48] kms-impl-simple: Handle lack of cached mode set in flip fallback When a page flip fails with a certain error code, we've treated this as a hint that page flipping is broken and we should try to use mode setting instead. On some drivers, it seems that this error is also reported when there was no mode set, which means we'll have no cached mode set to use in the fallback. The lack of prior mode set tends to happen when we hit a race when the DRM objects change before we have the time to process a hotplug event. Handle the lack a missing mode set in the flip fallback path, with the assumption that we'll get a hotplug event that'll fix things up for us eventually. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/917 --- src/backends/native/meta-kms-impl-simple.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/backends/native/meta-kms-impl-simple.c b/src/backends/native/meta-kms-impl-simple.c index 1bb84538c..ddc31b938 100644 --- a/src/backends/native/meta-kms-impl-simple.c +++ b/src/backends/native/meta-kms-impl-simple.c @@ -567,7 +567,12 @@ mode_set_fallback (MetaKmsImplSimple *impl_simple, cached_mode_set = g_hash_table_lookup (impl_simple->cached_mode_sets, crtc); - g_assert (cached_mode_set); + if (!cached_mode_set) + { + g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, + "Missing mode set for page flip fallback"); + return FALSE; + } fill_connector_ids_array (cached_mode_set->connectors, &connectors, -- 2.26.0.rc2