aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/si.c
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2015-01-05 19:54:50 -0500
committerAlex Deucher <alexander.deucher@amd.com>2015-01-08 09:36:50 -0500
commitd474ea7e52cbaaae22711d857949ba6018562c29 (patch)
tree3a83f3fa0f79f230e16869b16f35cb8c469beb91 /drivers/gpu/drm/radeon/si.c
parentcbfc35b90f3b4853d1eb9fcb82e99531d6a1c629 (diff)
drm/radeon: fix VM flush on SI (v3)
We need to wait for the GPUVM flush to complete. There was some confusion as to how this mechanism was supposed to work. The operation is not atomic. For GPU initiated invalidations you need to read back a VM register to introduce enough latency for the update to complete. v2: drop gart changes v3: just read back rather than polling Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu/drm/radeon/si.c')
-rw-r--r--drivers/gpu/drm/radeon/si.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
index 60df444bd075..5d89b874a1a2 100644
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -5057,6 +5057,16 @@ void si_vm_flush(struct radeon_device *rdev, struct radeon_ring *ring,
5057 radeon_ring_write(ring, 0); 5057 radeon_ring_write(ring, 0);
5058 radeon_ring_write(ring, 1 << vm_id); 5058 radeon_ring_write(ring, 1 << vm_id);
5059 5059
5060 /* wait for the invalidate to complete */
5061 radeon_ring_write(ring, PACKET3(PACKET3_WAIT_REG_MEM, 5));
5062 radeon_ring_write(ring, (WAIT_REG_MEM_FUNCTION(0) | /* always */
5063 WAIT_REG_MEM_ENGINE(0))); /* me */
5064 radeon_ring_write(ring, VM_INVALIDATE_REQUEST >> 2);
5065 radeon_ring_write(ring, 0);
5066 radeon_ring_write(ring, 0); /* ref */
5067 radeon_ring_write(ring, 0); /* mask */
5068 radeon_ring_write(ring, 0x20); /* poll interval */
5069
5060 /* sync PFP to ME, otherwise we might get invalid PFP reads */ 5070 /* sync PFP to ME, otherwise we might get invalid PFP reads */
5061 radeon_ring_write(ring, PACKET3(PACKET3_PFP_SYNC_ME, 0)); 5071 radeon_ring_write(ring, PACKET3(PACKET3_PFP_SYNC_ME, 0));
5062 radeon_ring_write(ring, 0x0); 5072 radeon_ring_write(ring, 0x0);