compositor-drm: deliver frame seq for feedback
Add 'msc' field to weston_output to maintain the refresh counter, and
use it in presentation_feedback.presented.
Make compositor-drm update the per-output refresh counter with the
values reported by DRM. If the DRM reported value jumps backwards,
assume it wrapped around once.
Other backends do not update weston_output::msc, and there
presentation_feedback will always deliver refresh counter as zero.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
v3 Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
diff --git a/src/compositor.c b/src/compositor.c
index 5d54227..29731c7 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2065,7 +2065,7 @@
refresh_nsec = 1000000000000UL / output->current_mode->refresh;
weston_presentation_feedback_present_list(&output->feedback_list,
output, refresh_nsec, stamp,
- 0);
+ output->msc);
output->frame_time = stamp->tv_sec * 1000 + stamp->tv_nsec / 1000000;