All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/vblank: Fix flip event vblank count
@ 2017-10-10 13:33 Ville Syrjala
  0 siblings, 0 replies; 21+ messages in thread
From: Ville Syrjala @ 2017-10-10 13:33 UTC (permalink / raw)
  To: dri-devel; +Cc: stable

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

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: stable@vger.kernel.org
Cc: Daniel Vetter <daniel@ffwll.ch>
Suggested-by: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/drm_vblank.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
index 70f2b9593edc..f14e6c92e332 100644
--- a/drivers/gpu/drm/drm_vblank.c
+++ b/drivers/gpu/drm/drm_vblank.c
@@ -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);
 }
-- 
2.13.6
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2017-11-16 16:14 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20171010133338epcas4p3860854878d180c8fae89d9072fcf76be@epcas4p3.samsung.com>
2017-10-10 13:33 ` [PATCH] drm/vblank: Fix flip event vblank count Ville Syrjala
2017-10-10 13:33   ` Ville Syrjala
2017-10-11 18:53   ` ✓ Fi.CI.BAT: success for " Patchwork
2017-10-12  2:36   ` ✓ Fi.CI.IGT: " Patchwork
2017-10-12 15:20   ` [PATCH] " Ville Syrjälä
2017-10-12 15:20     ` Ville Syrjälä
2017-10-18  7:07   ` Andrzej Hajda
2017-10-18  7:07     ` Andrzej Hajda
2017-10-18 13:50     ` Ville Syrjälä
2017-10-18 13:50       ` Ville Syrjälä
2017-10-18 14:32       ` Daniel Vetter
2017-10-18 14:32         ` Daniel Vetter
2017-10-23 15:25     ` [PATCH] drm/vblank: Tune drm_crtc_accurate_vblank_count() WARN down to a debug Ville Syrjala
2017-10-23 15:25       ` Ville Syrjala
2017-10-24  9:01       ` Benjamin Gaignard
2017-10-30  9:19         ` Daniel Vetter
2017-10-30  9:19           ` Daniel Vetter
2017-11-16 14:19           ` Benjamin Gaignard
2017-11-16 16:14             ` Ville Syrjälä
2017-11-16 16:14               ` Ville Syrjälä
2017-10-10 13:33 [PATCH] drm/vblank: Fix flip event vblank count Ville Syrjala

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.