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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3534>
This commit is contained in:
Dor Askayo 2024-01-19 02:47:46 +02:00 committed by Marge Bot
parent 79063604ad
commit 5e13c1dca6

View File

@ -1629,11 +1629,22 @@ meta_kms_impl_device_schedule_process (MetaKmsImplDevice *impl_device,
if (ensure_deadline_timer_armed (impl_device, crtc_frame, &error)) if (ensure_deadline_timer_armed (impl_device, crtc_frame, &error))
return; return;
priv = meta_kms_impl_device_get_instance_private (impl_device);
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)) if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
g_warning ("Failed to determine deadline: %s", error->message); 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; priv->deadline_timer_state = META_DEADLINE_TIMER_STATE_DISABLED;
}
needs_flush: needs_flush:
meta_kms_device_set_needs_flush (meta_kms_crtc_get_device (crtc), crtc); meta_kms_device_set_needs_flush (meta_kms_crtc_get_device (crtc), crtc);