diff options
author | Oak Zeng <ozeng@amd.com> | 2018-11-19 16:20:07 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-11-28 15:55:33 -0500 |
commit | 9564f1928ed29b093bb997df9573e8edae61983d (patch) | |
tree | 927f2959a789998860ae011e99a0b47f7edef2d0 /drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |
parent | 6585661ddd6a0a47c4d2a70e1441031c294e6de2 (diff) |
drm/amdgpu: Use asic specific doorbell index instead of macro definition
ASIC specific doorbell layout is used instead of enum definition
Signed-off-by: Oak Zeng <ozeng@amd.com>
Suggested-by: Felix Kuehling <Felix.Kuehling@amd.com>
Suggested-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c index 77cac0e25623..1454fc306783 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |||
@@ -1890,7 +1890,7 @@ static int gfx_v8_0_compute_ring_init(struct amdgpu_device *adev, int ring_id, | |||
1890 | 1890 | ||
1891 | ring->ring_obj = NULL; | 1891 | ring->ring_obj = NULL; |
1892 | ring->use_doorbell = true; | 1892 | ring->use_doorbell = true; |
1893 | ring->doorbell_index = AMDGPU_DOORBELL_MEC_RING0 + ring_id; | 1893 | ring->doorbell_index = adev->doorbell_index.mec_ring0 + ring_id; |
1894 | ring->eop_gpu_addr = adev->gfx.mec.hpd_eop_gpu_addr | 1894 | ring->eop_gpu_addr = adev->gfx.mec.hpd_eop_gpu_addr |
1895 | + (ring_id * GFX8_MEC_HPD_SIZE); | 1895 | + (ring_id * GFX8_MEC_HPD_SIZE); |
1896 | sprintf(ring->name, "comp_%d.%d.%d", ring->me, ring->pipe, ring->queue); | 1896 | sprintf(ring->name, "comp_%d.%d.%d", ring->me, ring->pipe, ring->queue); |
@@ -2001,7 +2001,7 @@ static int gfx_v8_0_sw_init(void *handle) | |||
2001 | /* no gfx doorbells on iceland */ | 2001 | /* no gfx doorbells on iceland */ |
2002 | if (adev->asic_type != CHIP_TOPAZ) { | 2002 | if (adev->asic_type != CHIP_TOPAZ) { |
2003 | ring->use_doorbell = true; | 2003 | ring->use_doorbell = true; |
2004 | ring->doorbell_index = AMDGPU_DOORBELL_GFX_RING0; | 2004 | ring->doorbell_index = adev->doorbell_index.gfx_ring0; |
2005 | } | 2005 | } |
2006 | 2006 | ||
2007 | r = amdgpu_ring_init(adev, ring, 1024, &adev->gfx.eop_irq, | 2007 | r = amdgpu_ring_init(adev, ring, 1024, &adev->gfx.eop_irq, |
@@ -4215,7 +4215,7 @@ static void gfx_v8_0_set_cpg_door_bell(struct amdgpu_device *adev, struct amdgpu | |||
4215 | 4215 | ||
4216 | tmp = REG_SET_FIELD(0, CP_RB_DOORBELL_RANGE_LOWER, | 4216 | tmp = REG_SET_FIELD(0, CP_RB_DOORBELL_RANGE_LOWER, |
4217 | DOORBELL_RANGE_LOWER, | 4217 | DOORBELL_RANGE_LOWER, |
4218 | AMDGPU_DOORBELL_GFX_RING0); | 4218 | adev->doorbell_index.gfx_ring0); |
4219 | WREG32(mmCP_RB_DOORBELL_RANGE_LOWER, tmp); | 4219 | WREG32(mmCP_RB_DOORBELL_RANGE_LOWER, tmp); |
4220 | 4220 | ||
4221 | WREG32(mmCP_RB_DOORBELL_RANGE_UPPER, | 4221 | WREG32(mmCP_RB_DOORBELL_RANGE_UPPER, |
@@ -4644,8 +4644,8 @@ static int gfx_v8_0_kcq_init_queue(struct amdgpu_ring *ring) | |||
4644 | static void gfx_v8_0_set_mec_doorbell_range(struct amdgpu_device *adev) | 4644 | static void gfx_v8_0_set_mec_doorbell_range(struct amdgpu_device *adev) |
4645 | { | 4645 | { |
4646 | if (adev->asic_type > CHIP_TONGA) { | 4646 | if (adev->asic_type > CHIP_TONGA) { |
4647 | WREG32(mmCP_MEC_DOORBELL_RANGE_LOWER, AMDGPU_DOORBELL_KIQ << 2); | 4647 | WREG32(mmCP_MEC_DOORBELL_RANGE_LOWER, adev->doorbell_index.kiq << 2); |
4648 | WREG32(mmCP_MEC_DOORBELL_RANGE_UPPER, AMDGPU_DOORBELL_MEC_RING7 << 2); | 4648 | WREG32(mmCP_MEC_DOORBELL_RANGE_UPPER, adev->doorbell_index.mec_ring7 << 2); |
4649 | } | 4649 | } |
4650 | /* enable doorbells */ | 4650 | /* enable doorbells */ |
4651 | WREG32_FIELD(CP_PQ_STATUS, DOORBELL_ENABLE, 1); | 4651 | WREG32_FIELD(CP_PQ_STATUS, DOORBELL_ENABLE, 1); |