drm/amdgpu: assign the doorbell index for sdma on non-AID0
authorLe Ma <le.ma@amd.com>
Tue, 1 Mar 2022 11:42:29 +0000 (19:42 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 13:43:41 +0000 (09:43 -0400)
commit2a47a2d90e5cd96c24503061c8920a1e6ee248a0
tree9e0a241e27989e4de1cdbc7e44793312257707d0
parentf786b1d4ec778a5fc23911f06a0e38c9f4953b0c
drm/amdgpu: assign the doorbell index for sdma on non-AID0

Allocate new sdma doorbell index for the instances only on AID1 for now.

Todo: there's limitation that SDMA doorbell index on SDMA 4.4.2 needs to be
less than 0x1FF, so the tail part in _AMDGPU_VEGA20_DOORBELL_ASSIGNMENT is not
enough to store sdma doorbell range on maximum 4 AIDs if doorbell_range is 20.
So it looks better to create a new doorbell index assignment table for 4.4.2.

v2: change "(x << 1) + 2" to "(x + 1) << 1" for readability.

Signed-off-by: Le Ma <le.ma@amd.com>
Acked-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_doorbell.h
drivers/gpu/drm/amd/amdgpu/sdma_v4_4_2.c