aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom St Denis <tom.stdenis@amd.com>2017-04-04 10:24:19 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-04-06 13:26:50 -0400
commitd1a5b2502c8e0abb76be26145d45481fda41fb04 (patch)
tree8acab3dc5d2860872035061ca99b0094f1e61829
parentbb215962f626f6367f5ff93d4764d417f046e014 (diff)
drm/amd/amdgpu: Fix srbm_indexing in init/inactive hqd code
Signed-off-by: Tom St Denis <tom.stdenis@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
index 14a6fbdf429b..cf2a4d76afbf 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -5462,6 +5462,7 @@ static void gfx_v8_0_inactive_hqd(struct amdgpu_device *adev,
5462{ 5462{
5463 int i; 5463 int i;
5464 5464
5465 mutex_lock(&adev->srbm_mutex);
5465 vi_srbm_select(adev, ring->me, ring->pipe, ring->queue, 0); 5466 vi_srbm_select(adev, ring->me, ring->pipe, ring->queue, 0);
5466 if (RREG32(mmCP_HQD_ACTIVE) & CP_HQD_ACTIVE__ACTIVE_MASK) { 5467 if (RREG32(mmCP_HQD_ACTIVE) & CP_HQD_ACTIVE__ACTIVE_MASK) {
5467 WREG32_FIELD(CP_HQD_DEQUEUE_REQUEST, DEQUEUE_REQ, 2); 5468 WREG32_FIELD(CP_HQD_DEQUEUE_REQUEST, DEQUEUE_REQ, 2);
@@ -5471,6 +5472,8 @@ static void gfx_v8_0_inactive_hqd(struct amdgpu_device *adev,
5471 udelay(1); 5472 udelay(1);
5472 } 5473 }
5473 } 5474 }
5475 vi_srbm_select(adev, 0, 0, 0, 0);
5476 mutex_unlock(&adev->srbm_mutex);
5474} 5477}
5475 5478
5476static int gfx_v8_0_pre_soft_reset(void *handle) 5479static int gfx_v8_0_pre_soft_reset(void *handle)
@@ -5576,11 +5579,13 @@ static int gfx_v8_0_soft_reset(void *handle)
5576static void gfx_v8_0_init_hqd(struct amdgpu_device *adev, 5579static void gfx_v8_0_init_hqd(struct amdgpu_device *adev,
5577 struct amdgpu_ring *ring) 5580 struct amdgpu_ring *ring)
5578{ 5581{
5582 mutex_lock(&adev->srbm_mutex);
5579 vi_srbm_select(adev, ring->me, ring->pipe, ring->queue, 0); 5583 vi_srbm_select(adev, ring->me, ring->pipe, ring->queue, 0);
5580 WREG32(mmCP_HQD_DEQUEUE_REQUEST, 0); 5584 WREG32(mmCP_HQD_DEQUEUE_REQUEST, 0);
5581 WREG32(mmCP_HQD_PQ_RPTR, 0); 5585 WREG32(mmCP_HQD_PQ_RPTR, 0);
5582 WREG32(mmCP_HQD_PQ_WPTR, 0); 5586 WREG32(mmCP_HQD_PQ_WPTR, 0);
5583 vi_srbm_select(adev, 0, 0, 0, 0); 5587 vi_srbm_select(adev, 0, 0, 0, 0);
5588 mutex_unlock(&adev->srbm_mutex);
5584} 5589}
5585 5590
5586static int gfx_v8_0_post_soft_reset(void *handle) 5591static int gfx_v8_0_post_soft_reset(void *handle)