Commit 7c33c32d authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Greg Kroah-Hartman

drm/vblank: Fix flip event vblank count

commit 632c6e4e upstream.

On machines where the vblank interrupt fires some time after the start
of vblank (or we just manage to race with the vblank interrupt handler)
we will currently stuff a stale vblank counter value into the flip event,
and thus we'll prematurely complete the flip.

Switch over to drm_crtc_accurate_vblank_count() to make sure we have an
up to date counter value, crucially also remember to add the +1 so that
the delayed vblank interrupt won't complete the flip prematurely.

Cc: Daniel Vetter <>
Suggested-by: default avatarDaniel Vetter <>
Signed-off-by: default avatarVille Syrjälä <>
Reviewed-by: Daniel Vetter <> #irc
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 6cd3e4a3
......@@ -869,7 +869,7 @@ void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
e->pipe = pipe;
e->event.sequence = drm_vblank_count(dev, pipe);
e->event.sequence = drm_crtc_accurate_vblank_count(crtc) + 1;
e->event.crtc_id = crtc->;
list_add_tail(&e->, &dev->vblank_event_list);
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment