drm/vblank: Fix flip event vblank count
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 10 Oct 2017 13:33:22 +0000 (16:33 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Dec 2017 10:26:35 +0000 (11:26 +0100)
commit7c33c32d39b9d11338624d4a7bad4e75bf64fbf8
tree0bfa8a09e59350fbb53bcb4dfeb8f200c936ff03
parent6cd3e4a3e697cca84f27a0af68ba59a6ab00892f
drm/vblank: Fix flip event vblank count

commit 632c6e4edef17c40bba3be67c980d959790d142f 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 <daniel@ffwll.ch>
Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171010133322.24029-1-ville.syrjala@linux.intel.com
Reviewed-by: Daniel Vetter <daniel@ffwll.ch> #irc
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/drm_vblank.c