diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-10-03 10:18:29 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2022-10-03 10:18:29 +0000 |
commit | 5a1fe50400b65bbfb95db47c3f3979b5cb287346 (patch) | |
tree | 464f8e0da6c1108a5a180a8373a54b7ddcd06c3d | |
parent | e6d4a0cf4d94efed758e5fe128146b41e9b77f8c (diff) |
drm/amdgpu: move nbio sdma_doorbell_range() into sdma code for vega
From Alex Deucher
8c2bbfb0ded3f41e2985a7856da56f130288d926 in linux 5.15.y/5.15.70
e3163bc8ffdfdb405e10530b140135b2ee487f89 in mainline linux
-rw-r--r-- | sys/dev/pci/drm/amd/amdgpu/sdma_v4_0.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/drm/amd/amdgpu/soc15.c | 22 |
2 files changed, 5 insertions, 22 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/sdma_v4_0.c b/sys/dev/pci/drm/amd/amdgpu/sdma_v4_0.c index 5913b7f607b..38576d13d98 100644 --- a/sys/dev/pci/drm/amd/amdgpu/sdma_v4_0.c +++ b/sys/dev/pci/drm/amd/amdgpu/sdma_v4_0.c @@ -1507,6 +1507,11 @@ static int sdma_v4_0_start(struct amdgpu_device *adev) WREG32_SDMA(i, mmSDMA0_CNTL, temp); if (!amdgpu_sriov_vf(adev)) { + ring = &adev->sdma.instance[i].ring; + adev->nbio.funcs->sdma_doorbell_range(adev, i, + ring->use_doorbell, ring->doorbell_index, + adev->doorbell_index.sdma_doorbell_range); + /* unhalt engine */ temp = RREG32_SDMA(i, mmSDMA0_F32_CNTL); temp = REG_SET_FIELD(temp, SDMA0_F32_CNTL, HALT, 0); diff --git a/sys/dev/pci/drm/amd/amdgpu/soc15.c b/sys/dev/pci/drm/amd/amdgpu/soc15.c index f31f318204e..8a6abd04988 100644 --- a/sys/dev/pci/drm/amd/amdgpu/soc15.c +++ b/sys/dev/pci/drm/amd/amdgpu/soc15.c @@ -1416,22 +1416,6 @@ static int soc15_common_sw_fini(void *handle) return 0; } -static void soc15_doorbell_range_init(struct amdgpu_device *adev) -{ - int i; - struct amdgpu_ring *ring; - - /* sdma/ih doorbell range are programed by hypervisor */ - if (!amdgpu_sriov_vf(adev)) { - for (i = 0; i < adev->sdma.num_instances; i++) { - ring = &adev->sdma.instance[i].ring; - adev->nbio.funcs->sdma_doorbell_range(adev, i, - ring->use_doorbell, ring->doorbell_index, - adev->doorbell_index.sdma_doorbell_range); - } - } -} - static int soc15_common_hw_init(void *handle) { struct amdgpu_device *adev = (struct amdgpu_device *)handle; @@ -1451,12 +1435,6 @@ static int soc15_common_hw_init(void *handle) /* enable the doorbell aperture */ soc15_enable_doorbell_aperture(adev, true); - /* HW doorbell routing policy: doorbell writing not - * in SDMA/IH/MM/ACV range will be routed to CP. So - * we need to init SDMA/IH/MM/ACV doorbell range prior - * to CP ip block init and ring test. - */ - soc15_doorbell_range_init(adev); return 0; } |