[mutter] kms/impl/simple: Make sure cursor buffers have fb ids



commit 5404eb34f8a6be4d6811084cb0ceb90330764edd
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Mon May 2 12:42:20 2022 +0200

    kms/impl/simple: Make sure cursor buffers have fb ids
    
    'kms/impl-device/simple: Get the buffer handle from MetaDrmBuffer'
    changed how fb ids are generated, but it only made it fully work with
    atomic mode setting. For legacy/simple mode setting, it only handled the
    primary plane buffer, not the hardware cursor.
    
    Fix this by making sure the fb id is generated also in the legacy mode
    setting case.
    
    Fixes: ea39142da2c7e3dc7dbe17f7f2e0d7ef66fab1f8
    Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2250
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2397>

 src/backends/native/meta-kms-impl-device-simple.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/src/backends/native/meta-kms-impl-device-simple.c 
b/src/backends/native/meta-kms-impl-device-simple.c
index fa6bca3486..ca4ffe2454 100644
--- a/src/backends/native/meta-kms-impl-device-simple.c
+++ b/src/backends/native/meta-kms-impl-device-simple.c
@@ -1209,9 +1209,16 @@ process_cursor_plane_assignment (MetaKmsImplDevice       *impl_device,
       height = plane_assignment->dst_rect.height;
 
       if (plane_assignment->buffer)
-        handle_u32 = meta_drm_buffer_get_handle (plane_assignment->buffer);
+        {
+          if (!meta_drm_buffer_ensure_fb_id (plane_assignment->buffer, error))
+            return FALSE;
+
+          handle_u32 = meta_drm_buffer_get_handle (plane_assignment->buffer);
+        }
       else
-        handle_u32 = 0;
+        {
+          handle_u32 = 0;
+        }
 
       meta_topic (META_DEBUG_KMS,
                   "[simple] Setting HW cursor of CRTC %u (%s) to %u "


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