From 5404eb34f8a6be4d6811084cb0ceb90330764edd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 2 May 2022 12:42:20 +0200 Subject: [PATCH] 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: --- 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 fa6bca348..ca4ffe245 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 "