From 48c9b638f3b871f61f57875802e3efc1368146ed Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Thu, 14 Sep 2023 17:37:47 +0800 Subject: [PATCH] kms/impl-device: Inhibit deadline timer on vc4 (Raspberry Pi) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit vc4's implementation of `drmModeAtomicCommit` seems to require a few milliseconds advanced notice or else it will miss the frame deadline. That's too high for our deadline evasion threshold which is measured in microseconds. Let's stop trying to use deadline timers on vc4 to avoid this conflict without having to disable atomic KMS. Suggested-by: Jonas Ã…dahl Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/2953 Part-of: --- src/backends/native/meta-kms-impl-device.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/backends/native/meta-kms-impl-device.c b/src/backends/native/meta-kms-impl-device.c index 17bfc7ee2..da372383d 100644 --- a/src/backends/native/meta-kms-impl-device.c +++ b/src/backends/native/meta-kms-impl-device.c @@ -1882,6 +1882,26 @@ get_driver_info (int fd, return TRUE; } +static void +maybe_inhibit_deadline_timer (MetaKmsImplDevice *impl_device) +{ + MetaKmsImplDevicePrivate *priv = + meta_kms_impl_device_get_instance_private (impl_device); + static const char *deadline_timer_deny_list[] = { + "vc4", + }; + int i; + + for (i = 0; i < G_N_ELEMENTS (deadline_timer_deny_list); i++) + { + if (g_strcmp0 (deadline_timer_deny_list[i], priv->driver_name) == 0) + { + priv->deadline_timer_inhibited = TRUE; + break; + } + } +} + static gboolean meta_kms_impl_device_initable_init (GInitable *initable, GCancellable *cancellable, @@ -1907,6 +1927,8 @@ meta_kms_impl_device_initable_init (GInitable *initable, priv->driver_description = g_strdup ("Unknown"); } + maybe_inhibit_deadline_timer (impl_device); + priv->crtc_frames = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) crtc_frame_free);