aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/cik.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2013-04-11 09:36:17 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-06-27 10:49:09 -0400
commitb07fdd383214f9c5b846d776681919dac7c8c5a1 (patch)
tree43c2e0c07d7decff0d4a97d79eecccaab2cfbe1c /drivers/gpu/drm/radeon/cik.c
parent2615b53acec2e0636c9d24a9e82f34904d8e39fd (diff)
drm/radeon: fix up ring functions for compute rings
The compute rings use RELEASE_MEM rather then EOP packets for writing fences and there is no SYNC_PFP_ME packet on the compute rings. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/cik.c')
-rw-r--r--drivers/gpu/drm/radeon/cik.c53
1 files changed, 47 insertions, 6 deletions
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c
index 19a6b3c31304..fa4c9acc2f4b 100644
--- a/drivers/gpu/drm/radeon/cik.c
+++ b/drivers/gpu/drm/radeon/cik.c
@@ -1706,7 +1706,7 @@ int cik_ring_test(struct radeon_device *rdev, struct radeon_ring *ring)
1706} 1706}
1707 1707
1708/** 1708/**
1709 * cik_fence_ring_emit - emit a fence on the gfx ring 1709 * cik_fence_gfx_ring_emit - emit a fence on the gfx ring
1710 * 1710 *
1711 * @rdev: radeon_device pointer 1711 * @rdev: radeon_device pointer
1712 * @fence: radeon fence object 1712 * @fence: radeon fence object
@@ -1714,8 +1714,8 @@ int cik_ring_test(struct radeon_device *rdev, struct radeon_ring *ring)
1714 * Emits a fence sequnce number on the gfx ring and flushes 1714 * Emits a fence sequnce number on the gfx ring and flushes
1715 * GPU caches. 1715 * GPU caches.
1716 */ 1716 */
1717void cik_fence_ring_emit(struct radeon_device *rdev, 1717void cik_fence_gfx_ring_emit(struct radeon_device *rdev,
1718 struct radeon_fence *fence) 1718 struct radeon_fence *fence)
1719{ 1719{
1720 struct radeon_ring *ring = &rdev->ring[fence->ring]; 1720 struct radeon_ring *ring = &rdev->ring[fence->ring];
1721 u64 addr = rdev->fence_drv[fence->ring].gpu_addr; 1721 u64 addr = rdev->fence_drv[fence->ring].gpu_addr;
@@ -1742,6 +1742,44 @@ void cik_fence_ring_emit(struct radeon_device *rdev,
1742 radeon_ring_write(ring, 0); 1742 radeon_ring_write(ring, 0);
1743} 1743}
1744 1744
1745/**
1746 * cik_fence_compute_ring_emit - emit a fence on the compute ring
1747 *
1748 * @rdev: radeon_device pointer
1749 * @fence: radeon fence object
1750 *
1751 * Emits a fence sequnce number on the compute ring and flushes
1752 * GPU caches.
1753 */
1754void cik_fence_compute_ring_emit(struct radeon_device *rdev,
1755 struct radeon_fence *fence)
1756{
1757 struct radeon_ring *ring = &rdev->ring[fence->ring];
1758 u64 addr = rdev->fence_drv[fence->ring].gpu_addr;
1759
1760 /* RELEASE_MEM - flush caches, send int */
1761 radeon_ring_write(ring, PACKET3(PACKET3_RELEASE_MEM, 5));
1762 radeon_ring_write(ring, (EOP_TCL1_ACTION_EN |
1763 EOP_TC_ACTION_EN |
1764 EVENT_TYPE(CACHE_FLUSH_AND_INV_TS_EVENT) |
1765 EVENT_INDEX(5)));
1766 radeon_ring_write(ring, DATA_SEL(1) | INT_SEL(2));
1767 radeon_ring_write(ring, addr & 0xfffffffc);
1768 radeon_ring_write(ring, upper_32_bits(addr));
1769 radeon_ring_write(ring, fence->seq);
1770 radeon_ring_write(ring, 0);
1771 /* HDP flush */
1772 /* We should be using the new WAIT_REG_MEM special op packet here
1773 * but it causes the CP to hang
1774 */
1775 radeon_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3));
1776 radeon_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) |
1777 WRITE_DATA_DST_SEL(0)));
1778 radeon_ring_write(ring, HDP_MEM_COHERENCY_FLUSH_CNTL >> 2);
1779 radeon_ring_write(ring, 0);
1780 radeon_ring_write(ring, 0);
1781}
1782
1745void cik_semaphore_ring_emit(struct radeon_device *rdev, 1783void cik_semaphore_ring_emit(struct radeon_device *rdev,
1746 struct radeon_ring *ring, 1784 struct radeon_ring *ring,
1747 struct radeon_semaphore *semaphore, 1785 struct radeon_semaphore *semaphore,
@@ -4051,9 +4089,12 @@ void cik_vm_flush(struct radeon_device *rdev, int ridx, struct radeon_vm *vm)
4051 radeon_ring_write(ring, 0); 4089 radeon_ring_write(ring, 0);
4052 radeon_ring_write(ring, 1 << vm->id); 4090 radeon_ring_write(ring, 1 << vm->id);
4053 4091
4054 /* sync PFP to ME, otherwise we might get invalid PFP reads */ 4092 /* compute doesn't have PFP */
4055 radeon_ring_write(ring, PACKET3(PACKET3_PFP_SYNC_ME, 0)); 4093 if (ridx == RADEON_RING_TYPE_GFX_INDEX) {
4056 radeon_ring_write(ring, 0x0); 4094 /* sync PFP to ME, otherwise we might get invalid PFP reads */
4095 radeon_ring_write(ring, PACKET3(PACKET3_PFP_SYNC_ME, 0));
4096 radeon_ring_write(ring, 0x0);
4097 }
4057} 4098}
4058 4099
4059/** 4100/**