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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2481>
This commit is contained in:
Dor Askayo 2022-06-26 11:19:18 +03:00 committed by Marge Bot
parent a4e71361b6
commit b4fff403b8

View File

@ -270,6 +270,7 @@ clutter_frame_clock_notify_presented (ClutterFrameClock *frame_clock,
} }
#endif #endif
if (frame_info->presentation_time > 0)
frame_clock->last_presentation_time_us = frame_info->presentation_time; frame_clock->last_presentation_time_us = frame_info->presentation_time;
frame_clock->got_measurements_last_frame = FALSE; frame_clock->got_measurements_last_frame = FALSE;