From 5626004aede1a2936f68e9bf9b8f883a55999754 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Fri, 8 Mar 2024 17:17:11 +0100 Subject: [PATCH] kms/impl-device/atomic: Set hotspot cap before initing mode setting We need to set the drm CAP before we read the KMS resources to make sure we actually get all resoures the CAP makes visible. Fixes: 27f798b6d ("kms/impl-device/atomic: Implement mouse cursor hotspots") Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3341 Part-of: --- src/backends/native/meta-kms-impl-device-atomic.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/backends/native/meta-kms-impl-device-atomic.c b/src/backends/native/meta-kms-impl-device-atomic.c index cd3f24e3b..7812ec042 100644 --- a/src/backends/native/meta-kms-impl-device-atomic.c +++ b/src/backends/native/meta-kms-impl-device-atomic.c @@ -1410,9 +1410,6 @@ meta_kms_impl_device_atomic_initable_init (GInitable *initable, return FALSE; } - if (!meta_kms_impl_device_init_mode_setting (impl_device, error)) - return FALSE; - if (requires_hotspots (meta_kms_impl_device_get_driver_name (impl_device))) { if (drmSetClientCap (meta_kms_impl_device_get_fd (impl_device), @@ -1423,6 +1420,13 @@ meta_kms_impl_device_atomic_initable_init (GInitable *initable, meta_kms_impl_device_get_driver_name (impl_device)); return FALSE; } + } + + if (!meta_kms_impl_device_init_mode_setting (impl_device, error)) + return FALSE; + + if (requires_hotspots (meta_kms_impl_device_get_driver_name (impl_device))) + { if (!has_cursor_hotspot_properties (impl_device)) { g_set_error (error, META_KMS_ERROR, META_KMS_ERROR_NOT_SUPPORTED,