[mutter] kms/impl-device/simple: Ensure buffer fb_id on test update too



commit 5823d2d1ae9f11bc8ffb854891b20605e33e01ae
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Fri Jun 3 18:32:17 2022 +0200

    kms/impl-device/simple: Ensure buffer fb_id on test update too
    
    This ensures the fb_id will be there when we actually apply the update,
    and will also make scanout test case pass if we run it with the
    non-atomic KMS API.
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2456>

 src/backends/native/meta-kms-impl-device-simple.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/src/backends/native/meta-kms-impl-device-simple.c 
b/src/backends/native/meta-kms-impl-device-simple.c
index ca4ffe2454..e4a8d5f1bf 100644
--- a/src/backends/native/meta-kms-impl-device-simple.c
+++ b/src/backends/native/meta-kms-impl-device-simple.c
@@ -1414,6 +1414,7 @@ perform_update_test (MetaKmsImplDevice *impl_device,
       MetaKmsCrtc *crtc = plane_assignment->crtc;
       MetaDrmBuffer *buffer = plane_assignment->buffer;
       CachedModeSet *cached_mode_set;
+      g_autoptr (GError) error = NULL;
 
       if (!plane_assignment->crtc ||
           !plane_assignment->buffer)
@@ -1432,6 +1433,17 @@ perform_update_test (MetaKmsImplDevice *impl_device,
           continue;
         }
 
+      if (!meta_drm_buffer_ensure_fb_id (plane_assignment->buffer, &error))
+        {
+          MetaKmsPlaneFeedback *plane_feedback;
+
+          plane_feedback =
+            meta_kms_plane_feedback_new_take_error (plane, crtc,
+                                                    g_steal_pointer (&error));
+          failed_planes = g_list_append (failed_planes, plane_feedback);
+          continue;
+        }
+
       if (meta_drm_buffer_get_width (buffer) != cached_mode_set->width ||
           meta_drm_buffer_get_height (buffer) != cached_mode_set->height ||
           meta_drm_buffer_get_stride (buffer) != cached_mode_set->stride ||


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