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>
Signed-off-by: Mingi Sung <sungmg@saltyming.net>
This commit is contained in:
Michel Dänzer 2024-08-20 09:42:17 +02:00 committed by Mingi Sung
parent 0129d10266
commit 71c1bf4cd4
Signed by: sungmg
GPG key ID: 41BAFD6FFD8036C5

View file

@ -673,6 +673,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;
}