summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/radeon
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2014-03-09 12:32:57 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2014-03-09 12:32:57 +0000
commitbe03a8d487c2c44524cc14e75a065fbd745e4332 (patch)
tree713099b0baf665f697d62a050144162344a1dd83 /sys/dev/pci/drm/radeon
parent427fc9fc2c1e37214e056b4d561ffd806a4e616c (diff)
drm/radeon: set the full cache bit for fences on r7xx+
From Alex Deucher 93e2a4108f7d2665136d6051727471731889ea5f in ubuntu 3.8 d45b964a22cad962d3ede1eba8d24f5cee7b2a92 in mainline linux
Diffstat (limited to 'sys/dev/pci/drm/radeon')
-rw-r--r--sys/dev/pci/drm/radeon/r600.c15
-rw-r--r--sys/dev/pci/drm/radeon/r600d.h3
2 files changed, 10 insertions, 8 deletions
diff --git a/sys/dev/pci/drm/radeon/r600.c b/sys/dev/pci/drm/radeon/r600.c
index 64902e8c1cc..cdd2ad686ff 100644
--- a/sys/dev/pci/drm/radeon/r600.c
+++ b/sys/dev/pci/drm/radeon/r600.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: r600.c,v 1.8 2014/02/09 12:33:44 jsg Exp $ */
+/* $OpenBSD: r600.c,v 1.9 2014/03/09 12:32:56 jsg Exp $ */
/*
* Copyright 2008 Advanced Micro Devices, Inc.
* Copyright 2008 Red Hat Inc.
@@ -2541,14 +2541,17 @@ void r600_fence_ring_emit(struct radeon_device *rdev,
struct radeon_fence *fence)
{
struct radeon_ring *ring = &rdev->ring[fence->ring];
+ 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) {
u64 addr = rdev->fence_drv[fence->ring].gpu_addr;
/* flush read cache over gart */
radeon_ring_write(ring, PACKET3(PACKET3_SURFACE_SYNC, 3));
- radeon_ring_write(ring, PACKET3_TC_ACTION_ENA |
- PACKET3_VC_ACTION_ENA |
- PACKET3_SH_ACTION_ENA);
+ radeon_ring_write(ring, cp_coher_cntl);
radeon_ring_write(ring, 0xFFFFFFFF);
radeon_ring_write(ring, 0);
radeon_ring_write(ring, 10); /* poll interval */
@@ -2562,9 +2565,7 @@ void r600_fence_ring_emit(struct radeon_device *rdev,
} else {
/* flush read cache over gart */
radeon_ring_write(ring, PACKET3(PACKET3_SURFACE_SYNC, 3));
- radeon_ring_write(ring, PACKET3_TC_ACTION_ENA |
- PACKET3_VC_ACTION_ENA |
- PACKET3_SH_ACTION_ENA);
+ radeon_ring_write(ring, cp_coher_cntl);
radeon_ring_write(ring, 0xFFFFFFFF);
radeon_ring_write(ring, 0);
radeon_ring_write(ring, 10); /* poll interval */
diff --git a/sys/dev/pci/drm/radeon/r600d.h b/sys/dev/pci/drm/radeon/r600d.h
index 934e4ef16bb..e52f0283fb3 100644
--- a/sys/dev/pci/drm/radeon/r600d.h
+++ b/sys/dev/pci/drm/radeon/r600d.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: r600d.h,v 1.2 2014/02/10 01:05:07 jsg Exp $ */
+/* $OpenBSD: r600d.h,v 1.3 2014/03/09 12:32:56 jsg Exp $ */
/*
* Copyright 2009 Advanced Micro Devices, Inc.
* Copyright 2009 Red Hat Inc.
@@ -1221,6 +1221,7 @@
# define PACKET3_CP_DMA_CMD_DAIC (1 << 29)
#define PACKET3_SURFACE_SYNC 0x43
# 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_VC_ACTION_ENA (1 << 24)
# define PACKET3_CB_ACTION_ENA (1 << 25)