From 5e13c1dca652f2dd120b24fba08e337339430498 Mon Sep 17 00:00:00 2001 From: Dor Askayo Date: Fri, 19 Jan 2024 02:47:46 +0200 Subject: [PATCH] kms/impl-device: Inhibit the deadline timer on permission errors Set the deadline timer state as "inhibited" in case a permission error is returned while attempting to arm the deadline timer. This makes each device enable its deadline timer again after a VT switch. Also print a note in this case instead of a warning as such errors are expected during a VT switch and should not raise concerns. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3259 Part-of: --- src/backends/native/meta-kms-impl-device.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/backends/native/meta-kms-impl-device.c b/src/backends/native/meta-kms-impl-device.c index 491fd9e62..767ddd83a 100644 --- a/src/backends/native/meta-kms-impl-device.c +++ b/src/backends/native/meta-kms-impl-device.c @@ -1629,11 +1629,22 @@ meta_kms_impl_device_schedule_process (MetaKmsImplDevice *impl_device, if (ensure_deadline_timer_armed (impl_device, crtc_frame, &error)) return; - if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) - g_warning ("Failed to determine deadline: %s", error->message); - priv = meta_kms_impl_device_get_instance_private (impl_device); - priv->deadline_timer_state = META_DEADLINE_TIMER_STATE_DISABLED; + + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED)) + { + meta_topic (META_DEBUG_KMS, "Could not determine deadline: %s", + error->message); + + priv->deadline_timer_state = META_DEADLINE_TIMER_STATE_INHIBITED; + } + else + { + if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) + g_warning ("Failed to determine deadline: %s", error->message); + + priv->deadline_timer_state = META_DEADLINE_TIMER_STATE_DISABLED; + } needs_flush: meta_kms_device_set_needs_flush (meta_kms_crtc_get_device (crtc), crtc);