aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorBen Goz <ben.goz@amd.com>2015-01-03 15:12:35 -0500
committerOded Gabbay <oded.gabbay@amd.com>2015-01-09 15:26:06 -0500
commitd7a60d8ea5cd4560e0496d2683643d2e4930e609 (patch)
tree38f85edea4f1dcd6541456f0fef879821c06abe6 /drivers/gpu
parent85dfaef34179a6449ebce34a1a9f1c032c3e1b88 (diff)
drm/radeon: Enable sdma preemption
This patch adds to radeon the enablement of sdma preemption. This is needed to support HWS of SDMA user-mode queues. Signed-off-by: Ben Goz <ben.goz@amd.com> Signed-off-by: Oded Gabbay <oded.gabbay@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/cik_sdma.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/cik_sdma.c b/drivers/gpu/drm/radeon/cik_sdma.c
index dde5c7e29eb2..1f4ded181662 100644
--- a/drivers/gpu/drm/radeon/cik_sdma.c
+++ b/drivers/gpu/drm/radeon/cik_sdma.c
@@ -283,6 +283,33 @@ static void cik_sdma_rlc_stop(struct radeon_device *rdev)
283} 283}
284 284
285/** 285/**
286 * cik_sdma_ctx_switch_enable - enable/disable sdma engine preemption
287 *
288 * @rdev: radeon_device pointer
289 * @enable: enable/disable preemption.
290 *
291 * Halt or unhalt the async dma engines (CIK).
292 */
293void cik_sdma_ctx_switch_enable(struct radeon_device *rdev, bool enable)
294{
295 uint32_t reg_offset, value;
296 int i;
297
298 for (i = 0; i < 2; i++) {
299 if (i == 0)
300 reg_offset = SDMA0_REGISTER_OFFSET;
301 else
302 reg_offset = SDMA1_REGISTER_OFFSET;
303 value = RREG32(SDMA0_CNTL + reg_offset);
304 if (enable)
305 value |= AUTO_CTXSW_ENABLE;
306 else
307 value &= ~AUTO_CTXSW_ENABLE;
308 WREG32(SDMA0_CNTL + reg_offset, value);
309 }
310}
311
312/**
286 * cik_sdma_enable - stop the async dma engines 313 * cik_sdma_enable - stop the async dma engines
287 * 314 *
288 * @rdev: radeon_device pointer 315 * @rdev: radeon_device pointer
@@ -312,6 +339,8 @@ void cik_sdma_enable(struct radeon_device *rdev, bool enable)
312 me_cntl |= SDMA_HALT; 339 me_cntl |= SDMA_HALT;
313 WREG32(SDMA0_ME_CNTL + reg_offset, me_cntl); 340 WREG32(SDMA0_ME_CNTL + reg_offset, me_cntl);
314 } 341 }
342
343 cik_sdma_ctx_switch_enable(rdev, enable);
315} 344}
316 345
317/** 346/**