1
0
Fork 0

kms/crtc: Conditionally return 0 in meta_kms_crtc_get_deadline_evasion

If both crtc->shortterm_max_dispatch_duration_us and
crtc->deadline_evasion_us are 0, i.e. we're not using the deadline
timer.

v2:
* Fix coding style. (Jonas Ådahl)

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3958>
This commit is contained in:
Michel Dänzer 2024-08-20 09:42:17 +02:00 committed by Marge Bot
parent 030270ba3b
commit a589456209

View file

@ -712,6 +712,13 @@ meta_kms_crtc_update_shortterm_max_dispatch_duration (MetaKmsCrtc *crtc,
int64_t
meta_kms_crtc_get_deadline_evasion (MetaKmsCrtc *crtc)
{
return MAX (crtc->shortterm_max_dispatch_duration_us,
crtc->deadline_evasion_us) + DEADLINE_EVASION_CONSTANT_US;
int64_t deadline_evasion_us;
deadline_evasion_us =
MAX (crtc->shortterm_max_dispatch_duration_us, crtc->deadline_evasion_us);
if (!deadline_evasion_us)
return 0;
return deadline_evasion_us + DEADLINE_EVASION_CONSTANT_US;
}