Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1312099

[PATCH v2 3/3] drm/rockchip: explain why we can't wait_for_vblanks

From John Keeping <john@metanate.com>
Newsgroups linux.kernel
Subject [PATCH v2 3/3] drm/rockchip: explain why we can't wait_for_vblanks
Date 2016-01-19 11:50 +0100
Message-ID <qSC1k-6y1-17@gated-at.bofh.it> (permalink)
References <qSC1k-6y1-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Signed-off-by: John Keeping <john@metanate.com>
---
v2:
  - Add more detail of the particular race that could happen if we used
    drm_atomic_helper_wait_for_vblanks().

 drivers/gpu/drm/rockchip/rockchip_drm_fb.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
index 679d23a..cf0b7bd 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_fb.c
@@ -177,6 +177,21 @@ static void rockchip_crtc_wait_for_update(struct drm_crtc *crtc)
 		crtc_funcs->wait_for_update(crtc);
 }
 
+/*
+ * We can't use drm_atomic_helper_wait_for_vblanks() because rk3288 and rk3066
+ * have hardware counters for neither vblanks nor scanlines, which results in
+ * a race where:
+ *				| <-- HW vsync irq and reg take effect
+ *	       plane_commit --> |
+ *	get_vblank and wait --> |
+ *				| <-- handle_vblank, vblank->count + 1
+ *		 cleanup_fb --> |
+ *		iommu crash --> |
+ *				| <-- HW vsync irq and reg take effect
+ *
+ * This function is equivalent but uses rockchip_crtc_wait_for_update() instead
+ * of waiting for vblank_count to change.
+ */
 static void
 rockchip_atomic_wait_for_complete(struct drm_device *dev, struct drm_atomic_state *old_state)
 {
-- 
2.7.0.226.gfe986fe

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/3] drm/rockchip: fix cursor performance with atomic John Keeping <john@metanate.com> - 2016-01-19 11:50 +0100
  [PATCH v2 3/3] drm/rockchip: explain why we can't wait_for_vblanks John Keeping <john@metanate.com> - 2016-01-19 11:50 +0100
  [PATCH v2 2/3] drm/rockchip: don't wait for vblank if fb hasn't changed John Keeping <john@metanate.com> - 2016-01-19 11:50 +0100
  Re: [PATCH v2 0/3] drm/rockchip: fix cursor performance with atomic Mark yao <mark.yao@rock-chips.com> - 2016-01-21 02:00 +0100

csiph-web