kms/impl-device: Don't disable deadline timer due to invalid mode

If crtc->current_state.is_drm_mode_valid happens to be FALSE,
meta_kms_crtc_determine_deadline returns G_IO_ERROR_NOT_FOUND. This
previously resulted in silently and permanently disabling the deadline
timer, which is surprising and undesirable.

Bail early from ensure_deadline_timer_armed in this case instead. In
turn, G_IO_ERROR_NOT_FOUND from meta_kms_crtc_determine_deadline no
longer needs to be treated specially.

Fixes: 7493ed39ce20 ("kms/impl-device: Avoid retrying a failing deadline timer")

v2:
* Stop treating G_IO_ERROR_NOT_FOUND specially. (Sebastian Wick)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4321>
This commit is contained in:
Michel Dänzer 2025-03-05 19:06:05 +01:00 committed by Marge Bot
parent d5bcce3859
commit 80e66878e8

View File

@ -1382,6 +1382,9 @@ ensure_deadline_timer_armed (MetaKmsImplDevice *impl_device,
if (crtc_frame->deadline.armed)
return TRUE;
if (!meta_kms_crtc_get_current_state (crtc_frame->crtc)->is_drm_mode_valid)
return FALSE;
if (!meta_kms_crtc_determine_deadline (crtc_frame->crtc,
&next_deadline_us,
&next_presentation_us,
@ -1399,9 +1402,7 @@ ensure_deadline_timer_armed (MetaKmsImplDevice *impl_device,
}
else
{
if (!g_error_matches (local_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
g_warning ("Failed to determine deadline: %s", local_error->message);
g_warning ("Failed to determine deadline: %s", local_error->message);
priv->deadline_timer_state = META_DEADLINE_TIMER_STATE_DISABLED;
}