aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2015-05-11 08:10:34 -0400
committerAlex Deucher <alexander.deucher@amd.com>2015-06-03 21:03:32 -0400
commitd2edb07b10fce5127a60671b55ca53921c212bc3 (patch)
tree5c6c7fe319aa67c5ca0a279008381f4a31d3cd22 /drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
parent66782cec7ad8f48c09d96ee59b713f694265cfa1 (diff)
drm/amdgpu: cleanup HDP flush handling
Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Monk Liu <monk.liu@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
index d3eda315e719..7c4abff5005d 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
@@ -269,8 +269,6 @@ static void sdma_v3_0_ring_set_wptr(struct amdgpu_ring *ring)
269 } 269 }
270} 270}
271 271
272static void sdma_v3_0_hdp_flush_ring_emit(struct amdgpu_ring *);
273
274/** 272/**
275 * sdma_v3_0_ring_emit_ib - Schedule an IB on the DMA engine 273 * sdma_v3_0_ring_emit_ib - Schedule an IB on the DMA engine
276 * 274 *
@@ -285,9 +283,6 @@ static void sdma_v3_0_ring_emit_ib(struct amdgpu_ring *ring,
285 u32 vmid = (ib->vm ? ib->vm->ids[ring->idx].id : 0) & 0xf; 283 u32 vmid = (ib->vm ? ib->vm->ids[ring->idx].id : 0) & 0xf;
286 u32 next_rptr = ring->wptr + 5; 284 u32 next_rptr = ring->wptr + 5;
287 285
288 if (ib->flush_hdp_writefifo)
289 next_rptr += 6;
290
291 while ((next_rptr & 7) != 2) 286 while ((next_rptr & 7) != 2)
292 next_rptr++; 287 next_rptr++;
293 next_rptr += 6; 288 next_rptr += 6;
@@ -299,11 +294,6 @@ static void sdma_v3_0_ring_emit_ib(struct amdgpu_ring *ring,
299 amdgpu_ring_write(ring, SDMA_PKT_WRITE_UNTILED_DW_3_COUNT(1)); 294 amdgpu_ring_write(ring, SDMA_PKT_WRITE_UNTILED_DW_3_COUNT(1));
300 amdgpu_ring_write(ring, next_rptr); 295 amdgpu_ring_write(ring, next_rptr);
301 296
302 /* flush HDP */
303 if (ib->flush_hdp_writefifo) {
304 sdma_v3_0_hdp_flush_ring_emit(ring);
305 }
306
307 /* IB packet must end on a 8 DW boundary */ 297 /* IB packet must end on a 8 DW boundary */
308 while ((ring->wptr & 7) != 2) 298 while ((ring->wptr & 7) != 2)
309 amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_NOP)); 299 amdgpu_ring_write(ring, SDMA_PKT_HEADER_OP(SDMA_OP_NOP));
@@ -320,13 +310,13 @@ static void sdma_v3_0_ring_emit_ib(struct amdgpu_ring *ring,
320} 310}
321 311
322/** 312/**
323 * sdma_v3_0_hdp_flush_ring_emit - emit an hdp flush on the DMA ring 313 * sdma_v3_0_ring_emit_hdp_flush - emit an hdp flush on the DMA ring
324 * 314 *
325 * @ring: amdgpu ring pointer 315 * @ring: amdgpu ring pointer
326 * 316 *
327 * Emit an hdp flush packet on the requested DMA ring. 317 * Emit an hdp flush packet on the requested DMA ring.
328 */ 318 */
329static void sdma_v3_0_hdp_flush_ring_emit(struct amdgpu_ring *ring) 319static void sdma_v3_0_ring_emit_hdp_flush(struct amdgpu_ring *ring)
330{ 320{
331 u32 ref_and_mask = 0; 321 u32 ref_and_mask = 0;
332 322
@@ -1407,6 +1397,7 @@ static const struct amdgpu_ring_funcs sdma_v3_0_ring_funcs = {
1407 .emit_fence = sdma_v3_0_ring_emit_fence, 1397 .emit_fence = sdma_v3_0_ring_emit_fence,
1408 .emit_semaphore = sdma_v3_0_ring_emit_semaphore, 1398 .emit_semaphore = sdma_v3_0_ring_emit_semaphore,
1409 .emit_vm_flush = sdma_v3_0_ring_emit_vm_flush, 1399 .emit_vm_flush = sdma_v3_0_ring_emit_vm_flush,
1400 .emit_hdp_flush = sdma_v3_0_ring_emit_hdp_flush,
1410 .test_ring = sdma_v3_0_ring_test_ring, 1401 .test_ring = sdma_v3_0_ring_test_ring,
1411 .test_ib = sdma_v3_0_ring_test_ib, 1402 .test_ib = sdma_v3_0_ring_test_ib,
1412 .is_lockup = sdma_v3_0_ring_is_lockup, 1403 .is_lockup = sdma_v3_0_ring_is_lockup,