clutter/frame-clock: Clamp recorded maxima to refresh interval

clutter_frame_clock_compute_max_render_time_us clamps to the refresh
interval anyway, so the only effect a higher recorded maximum can have
is to delay it falling below the refresh interval again.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3090>
This commit is contained in:
Michel Dänzer 2023-06-30 17:44:15 +02:00 committed by Marge Bot
parent 69afa7a142
commit 9c021b0bc2

View File

@ -349,9 +349,10 @@ clutter_frame_clock_notify_presented (ClutterFrameClock *frame_clock,
swap_to_flip_us);
frame_clock->shortterm_max_update_duration_us =
MAX (frame_clock->shortterm_max_update_duration_us,
frame_clock->last_dispatch_lateness_us + dispatch_to_swap_us +
MAX (swap_to_rendering_done_us, swap_to_flip_us));
CLAMP (frame_clock->last_dispatch_lateness_us + dispatch_to_swap_us +
MAX (swap_to_rendering_done_us, swap_to_flip_us),
frame_clock->shortterm_max_update_duration_us,
frame_clock->refresh_interval_us);
maybe_update_longterm_max_duration_us (frame_clock, frame_info);