[mutter] kms-impl-simple: Handle lack of cached mode set in flip fallback



commit c9a5b2b22f4bbe53bae2008ffa12b7376ca68b01
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Fri Jan 17 08:28:17 2020 +0100

    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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]