Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: Doorbell index initialization for ASICs before vega10

Initialize doorbell index for asics vi and cik

v2: Use enum definition instead of hardcoded number

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>

authored by

Oak Zeng and committed by
Alex Deucher
4e2c1ac2 062f3807

+22
+1
drivers/gpu/drm/amd/amdgpu/cik.c
··· 1755 1755 .flush_hdp = &cik_flush_hdp, 1756 1756 .invalidate_hdp = &cik_invalidate_hdp, 1757 1757 .need_full_reset = &cik_need_full_reset, 1758 + .init_doorbell_index = &legacy_doorbell_index_init, 1758 1759 }; 1759 1760 1760 1761 static int cik_common_early_init(void *handle)
+1
drivers/gpu/drm/amd/amdgpu/cik.h
··· 30 30 u32 me, u32 pipe, u32 queue, u32 vmid); 31 31 int cik_set_ip_blocks(struct amdgpu_device *adev); 32 32 33 + void legacy_doorbell_index_init(struct amdgpu_device *adev); 33 34 #endif
+19
drivers/gpu/drm/amd/amdgpu/vi.c
··· 955 955 .flush_hdp = &vi_flush_hdp, 956 956 .invalidate_hdp = &vi_invalidate_hdp, 957 957 .need_full_reset = &vi_need_full_reset, 958 + .init_doorbell_index = &legacy_doorbell_index_init, 958 959 }; 959 960 960 961 #define CZ_REV_BRISTOL(rev) \ ··· 1712 1711 } 1713 1712 1714 1713 return 0; 1714 + } 1715 + 1716 + void legacy_doorbell_index_init(struct amdgpu_device *adev) 1717 + { 1718 + adev->doorbell_index.kiq = AMDGPU_DOORBELL_KIQ; 1719 + adev->doorbell_index.mec_ring0 = AMDGPU_DOORBELL_MEC_RING0; 1720 + adev->doorbell_index.mec_ring1 = AMDGPU_DOORBELL_MEC_RING1; 1721 + adev->doorbell_index.mec_ring2 = AMDGPU_DOORBELL_MEC_RING2; 1722 + adev->doorbell_index.mec_ring3 = AMDGPU_DOORBELL_MEC_RING3; 1723 + adev->doorbell_index.mec_ring4 = AMDGPU_DOORBELL_MEC_RING4; 1724 + adev->doorbell_index.mec_ring5 = AMDGPU_DOORBELL_MEC_RING5; 1725 + adev->doorbell_index.mec_ring6 = AMDGPU_DOORBELL_MEC_RING6; 1726 + adev->doorbell_index.mec_ring7 = AMDGPU_DOORBELL_MEC_RING7; 1727 + adev->doorbell_index.gfx_ring0 = AMDGPU_DOORBELL_GFX_RING0; 1728 + adev->doorbell_index.sdma_engine0 = AMDGPU_DOORBELL_sDMA_ENGINE0; 1729 + adev->doorbell_index.sdma_engine1 = AMDGPU_DOORBELL_sDMA_ENGINE1; 1730 + adev->doorbell_index.ih = AMDGPU_DOORBELL_IH; 1731 + adev->doorbell_index.max_assignment = AMDGPU_DOORBELL_MAX_ASSIGNMENT; 1715 1732 }
+1
drivers/gpu/drm/amd/amdgpu/vi.h
··· 30 30 u32 me, u32 pipe, u32 queue, u32 vmid); 31 31 int vi_set_ip_blocks(struct amdgpu_device *adev); 32 32 33 + void legacy_doorbell_index_init(struct amdgpu_device *adev); 33 34 #endif