aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 5533f6e4f4a4..36f417fd6ba9 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -2631,8 +2631,8 @@ static int gfx_v9_0_cp_gfx_resume(struct amdgpu_device *adev)
2631 DOORBELL_RANGE_LOWER, ring->doorbell_index); 2631 DOORBELL_RANGE_LOWER, ring->doorbell_index);
2632 WREG32_SOC15(GC, 0, mmCP_RB_DOORBELL_RANGE_LOWER, tmp); 2632 WREG32_SOC15(GC, 0, mmCP_RB_DOORBELL_RANGE_LOWER, tmp);
2633 2633
2634 WREG32_SOC15(GC, 0, mmCP_RB_DOORBELL_RANGE_UPPER, 2634 /* There is only one GFX queue */
2635 CP_RB_DOORBELL_RANGE_UPPER__DOORBELL_RANGE_UPPER_MASK); 2635 WREG32_SOC15(GC, 0, mmCP_RB_DOORBELL_RANGE_UPPER, tmp);
2636 2636
2637 2637
2638 /* start the ring */ 2638 /* start the ring */
@@ -2995,10 +2995,19 @@ static int gfx_v9_0_kiq_init_register(struct amdgpu_ring *ring)
2995 2995
2996 /* enable the doorbell if requested */ 2996 /* enable the doorbell if requested */
2997 if (ring->use_doorbell) { 2997 if (ring->use_doorbell) {
2998 WREG32_SOC15(GC, 0, mmCP_MEC_DOORBELL_RANGE_LOWER, 2998 /* The first few doorbells in pci doorbell bar are for GFX RB
2999 (adev->doorbell_index.kiq * 2) << 2); 2999 * rings and all the leftover for MEC.
3000 * So CP_MEC_DOORBELL_RANGE_LOWER should be set one index after
3001 * CP_RB_DOORBELL_RANGE_UPPER, as we assume there is only one
3002 * GFX RB rings.
3003 */
3004 u32 tmp = REG_SET_FIELD(0, CP_MEC_DOORBELL_RANGE_LOWER,
3005 DOORBELL_RANGE_LOWER,
3006 adev->gfx.gfx_ring[0].doorbell_index + 2);
3007
3008 WREG32_SOC15(GC, 0, mmCP_MEC_DOORBELL_RANGE_LOWER, tmp);
3000 WREG32_SOC15(GC, 0, mmCP_MEC_DOORBELL_RANGE_UPPER, 3009 WREG32_SOC15(GC, 0, mmCP_MEC_DOORBELL_RANGE_UPPER,
3001 (adev->doorbell_index.userqueue_end * 2) << 2); 3010 CP_MEC_DOORBELL_RANGE_UPPER__DOORBELL_RANGE_UPPER_MASK);
3002 } 3011 }
3003 3012
3004 WREG32_SOC15(GC, 0, mmCP_HQD_PQ_DOORBELL_CONTROL, 3013 WREG32_SOC15(GC, 0, mmCP_HQD_PQ_DOORBELL_CONTROL,