From b4fff403b89f516ce239f9fc39d526deaee1eb17 Mon Sep 17 00:00:00 2001 From: Dor Askayo Date: Sun, 26 Jun 2022 11:19:18 +0300 Subject: [PATCH] clutter/frame-clock: Ignore missing presentation timestamps In some hardware configurations, presentation timestamps could be missing from some page flip events, leading to a temporary loss of vblank synchronization. This occurs at least with AMD GPUs for atomic commits that only update the cursor plane. [0] In those cases, it's better to calculate the next update time according to the last valid presentation timestamp instead of relying on the dispatch lateness. [0] https://gitlab.freedesktop.org/drm/amd/-/issues/2030 Part-of: --- clutter/clutter/clutter-frame-clock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clutter/clutter/clutter-frame-clock.c b/clutter/clutter/clutter-frame-clock.c index ad306225c..cf740adc3 100644 --- a/clutter/clutter/clutter-frame-clock.c +++ b/clutter/clutter/clutter-frame-clock.c @@ -270,7 +270,8 @@ clutter_frame_clock_notify_presented (ClutterFrameClock *frame_clock, } #endif - frame_clock->last_presentation_time_us = frame_info->presentation_time; + if (frame_info->presentation_time > 0) + frame_clock->last_presentation_time_us = frame_info->presentation_time; frame_clock->got_measurements_last_frame = FALSE;