mirror of
https://github.com/torvalds/linux.git
synced 2026-11-30 02:23:05 +00:00
drm/vblank: Fix flip event vblank count
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: [email protected] Cc: Daniel Vetter <[email protected]> Suggested-by: Daniel Vetter <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Daniel Vetter <[email protected]> #irc
This commit is contained in:
@@ -869,7 +869,7 @@ void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
|
||||
assert_spin_locked(&dev->event_lock);
|
||||
|
||||
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->base.id;
|
||||
list_add_tail(&e->base.link, &dev->vblank_event_list);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user