]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/radeon: workaround for CP HW bug on CIK
authorChristian König <christian.koenig@amd.com>
Tue, 10 Feb 2015 13:26:39 +0000 (14:26 +0100)
committerLuis Henriques <luis.henriques@canonical.com>
Mon, 2 Mar 2015 13:17:12 +0000 (13:17 +0000)
commit a9c73a0e022c33954835e66fec3cd744af90ec98 upstream.

Emit the EOP twice to avoid cache flushing problems.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
drivers/gpu/drm/radeon/cik.c

index 096a36c186a04ac068fc5a64a1afec339ee31d9c..60b589e07ee2891d3903a15b4fcc92d35a88ef02 100644 (file)
@@ -3656,7 +3656,21 @@ void cik_fence_gfx_ring_emit(struct radeon_device *rdev,
        struct radeon_ring *ring = &rdev->ring[fence->ring];
        u64 addr = rdev->fence_drv[fence->ring].gpu_addr;
 
-       /* EVENT_WRITE_EOP - flush caches, send int */
+       /* Workaround for cache flush problems. First send a dummy EOP
+        * event down the pipe with seq one below.
+        */
+       radeon_ring_write(ring, PACKET3(PACKET3_EVENT_WRITE_EOP, 4));
+       radeon_ring_write(ring, (EOP_TCL1_ACTION_EN |
+                                EOP_TC_ACTION_EN |
+                                EVENT_TYPE(CACHE_FLUSH_AND_INV_TS_EVENT) |
+                                EVENT_INDEX(5)));
+       radeon_ring_write(ring, addr & 0xfffffffc);
+       radeon_ring_write(ring, (upper_32_bits(addr) & 0xffff) |
+                               DATA_SEL(1) | INT_SEL(0));
+       radeon_ring_write(ring, fence->seq - 1);
+       radeon_ring_write(ring, 0);
+
+       /* Then send the real EOP event down the pipe. */
        radeon_ring_write(ring, PACKET3(PACKET3_EVENT_WRITE_EOP, 4));
        radeon_ring_write(ring, (EOP_TCL1_ACTION_EN |
                                 EOP_TC_ACTION_EN |