[PATCH] drm/radeon: Read back ring buffer before updating WPTR

Michel Dänzer michel at daenzer.net
Fri Aug 8 01:45:31 PDT 2014


From: Michel Dänzer <michel.daenzer at amd.com>

This fixes a ring test failure reported on a Kabini system which was
triggered by write-combined CPU mappings of the ring buffers.

Reported-and-Tested-by: Will Trives <renevant at internode.on.net>
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 drivers/gpu/drm/radeon/radeon_ring.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
index 5b4e0cf..6dff529 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -193,6 +193,10 @@ void radeon_ring_commit(struct radeon_device *rdev, struct radeon_ring *ring)
 		radeon_ring_write(ring, ring->nop);
 	}
 	mb();
+	/* This is necessary to prevent ring test failures on some systems
+	 * with write-combined CPU mappings of the ring buffers
+	 */
+	(void)ring->ring[ring->wptr];
 	/* If we are emitting the HDP flush via MMIO, we need to do it after
 	 * all CPU writes to VRAM finished.
 	 */
-- 
2.0.1



More information about the dri-devel mailing list