Skip to contentSkip to conversation

drm/radeon: Read back ring buffer before updating WPTR

PATCH Applied Michel Dänzer 2 participants 2 messages Aug 8, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

From: Michel Dänzer <[email protected]>

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

---
 drivers/gpu/drm/radeon/radeon_ring.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/radeon/radeon_ring.c +4 -0
index 5b4e0cf..6dff529 100644
@@ -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.
 	 */
Signature · 6 lines
2.0.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Applied
#1 lore raw
Quoted 7 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

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

Applied to my fixes tree.

Alex

Quoted 22 lines
---
 drivers/gpu/drm/radeon/radeon_ring.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/radeon/radeon_ring.c +4 -1
index 5b4e0cf..6dff529 100644
@@ -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

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel