Commit 7bf56b6a authored by Alex Deucher's avatar Alex Deucher Committed by Ben Hutchings

drm/radeon: set the full cache bit for fences on r7xx+

commit d45b964a upstream.

Needed to properly flush the read caches for fences.
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
[bwh: Backported to 3.2:
 - Adjust context
 - s/\bring\b/rdev/]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 03ee9dc3
...@@ -2315,14 +2315,18 @@ int r600_ring_test(struct radeon_device *rdev) ...@@ -2315,14 +2315,18 @@ int r600_ring_test(struct radeon_device *rdev)
void r600_fence_ring_emit(struct radeon_device *rdev, void r600_fence_ring_emit(struct radeon_device *rdev,
struct radeon_fence *fence) struct radeon_fence *fence)
{ {
u32 cp_coher_cntl = PACKET3_TC_ACTION_ENA | PACKET3_VC_ACTION_ENA |
PACKET3_SH_ACTION_ENA;
if (rdev->family >= CHIP_RV770)
cp_coher_cntl |= PACKET3_FULL_CACHE_ENA;
if (rdev->wb.use_event) { if (rdev->wb.use_event) {
u64 addr = rdev->wb.gpu_addr + R600_WB_EVENT_OFFSET + u64 addr = rdev->wb.gpu_addr + R600_WB_EVENT_OFFSET +
(u64)(rdev->fence_drv.scratch_reg - rdev->scratch.reg_base); (u64)(rdev->fence_drv.scratch_reg - rdev->scratch.reg_base);
/* flush read cache over gart */ /* flush read cache over gart */
radeon_ring_write(rdev, PACKET3(PACKET3_SURFACE_SYNC, 3)); radeon_ring_write(rdev, PACKET3(PACKET3_SURFACE_SYNC, 3));
radeon_ring_write(rdev, PACKET3_TC_ACTION_ENA | radeon_ring_write(rdev, cp_coher_cntl);
PACKET3_VC_ACTION_ENA |
PACKET3_SH_ACTION_ENA);
radeon_ring_write(rdev, 0xFFFFFFFF); radeon_ring_write(rdev, 0xFFFFFFFF);
radeon_ring_write(rdev, 0); radeon_ring_write(rdev, 0);
radeon_ring_write(rdev, 10); /* poll interval */ radeon_ring_write(rdev, 10); /* poll interval */
...@@ -2336,9 +2340,7 @@ void r600_fence_ring_emit(struct radeon_device *rdev, ...@@ -2336,9 +2340,7 @@ void r600_fence_ring_emit(struct radeon_device *rdev,
} else { } else {
/* flush read cache over gart */ /* flush read cache over gart */
radeon_ring_write(rdev, PACKET3(PACKET3_SURFACE_SYNC, 3)); radeon_ring_write(rdev, PACKET3(PACKET3_SURFACE_SYNC, 3));
radeon_ring_write(rdev, PACKET3_TC_ACTION_ENA | radeon_ring_write(rdev, cp_coher_cntl);
PACKET3_VC_ACTION_ENA |
PACKET3_SH_ACTION_ENA);
radeon_ring_write(rdev, 0xFFFFFFFF); radeon_ring_write(rdev, 0xFFFFFFFF);
radeon_ring_write(rdev, 0); radeon_ring_write(rdev, 0);
radeon_ring_write(rdev, 10); /* poll interval */ radeon_ring_write(rdev, 10); /* poll interval */
......
...@@ -838,6 +838,7 @@ ...@@ -838,6 +838,7 @@
#define PACKET3_INDIRECT_BUFFER 0x32 #define PACKET3_INDIRECT_BUFFER 0x32
#define PACKET3_SURFACE_SYNC 0x43 #define PACKET3_SURFACE_SYNC 0x43
# define PACKET3_CB0_DEST_BASE_ENA (1 << 6) # define PACKET3_CB0_DEST_BASE_ENA (1 << 6)
# define PACKET3_FULL_CACHE_ENA (1 << 20) /* r7xx+ only */
# define PACKET3_TC_ACTION_ENA (1 << 23) # define PACKET3_TC_ACTION_ENA (1 << 23)
# define PACKET3_VC_ACTION_ENA (1 << 24) # define PACKET3_VC_ACTION_ENA (1 << 24)
# define PACKET3_CB_ACTION_ENA (1 << 25) # define PACKET3_CB_ACTION_ENA (1 << 25)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment