}
static void
+drm_output_update_msc(struct drm_output *output, unsigned int seq)
+{
+ uint64_t msc_hi = output->base.msc >> 32;
+
+ if (seq < (output->base.msc & 0xffffffff))
+ msc_hi++;
+
+ output->base.msc = (msc_hi << 32) + seq;
+}
+
+static void
vblank_handler(int fd, unsigned int frame, unsigned int sec, unsigned int usec,
void *data)
{
struct drm_output *output = s->output;
struct timespec ts;
+ drm_output_update_msc(output, frame);
output->vblank_pending = 0;
drm_output_release_fb(output, s->current);
struct drm_output *output = (struct drm_output *) data;
struct timespec ts;
+ drm_output_update_msc(output, frame);
+
/* We don't set page_flip_pending on start_repaint_loop, in that case
* we just want to page flip to the current buffer to get an accurate
* timestamp */
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;
struct wl_signal destroy_signal;
int move_x, move_y;
uint32_t frame_time; /* presentation timestamp in milliseconds */
+ uint64_t msc; /* media stream counter */
int disable_planes;
int destroying;
struct wl_list feedback_list;