1
0
Fork 0

kms/crtc: Complain and bail if DRM mode info isn't valid

Otherwise meta_calculate_drm_mode_refresh_rate returns 0.0, which
results in non-sense refresh_interval_us.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3982 fixed that
happening before. This is intended to catch if it ever happens again.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3980>
(cherry picked from commit 3cf3d5d1c6)
This commit is contained in:
Michel Dänzer 2024-08-26 17:00:09 +02:00 committed by Jonas Ådahl
parent 7c5bb5b8b2
commit d291a07261

View file

@ -700,6 +700,8 @@ meta_kms_crtc_update_shortterm_max_dispatch_duration (MetaKmsCrtc *crtc,
{ {
int64_t refresh_interval_us; int64_t refresh_interval_us;
g_return_if_fail (crtc->current_state.is_drm_mode_valid);
/* meta_kms_crtc_determine_deadline doesn't use deadline evasion with VRR */ /* meta_kms_crtc_determine_deadline doesn't use deadline evasion with VRR */
if (crtc->current_state.vrr.enabled) if (crtc->current_state.vrr.enabled)
return; return;