diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2023-09-11 17:30:28 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-09-12 17:30:18 -0400 |
commit | b85a17d35415d8a94db5c58f008a2ae11d4702bd (patch) | |
tree | 66b175bbfa1d909f28d51dc27091b9f882d42295 /drivers/gpu/drm/amd/amdgpu | |
parent | 4412f8529c02f511b1d41e6c800cc90538ff7579 (diff) |
drm/amdgpu: add vcn_doorbell_range callback for nbio 7.11
Implement support for setting up the VCN doorbell range for
NBIO 7.11.
Reviewed-by: Lang Yu <lang.yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c b/drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c index a32d9b8ec51b..bcf5fb420fda 100644 --- a/drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c +++ b/drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c @@ -100,6 +100,27 @@ static void nbio_v7_11_vpe_doorbell_range(struct amdgpu_device *adev, int instan WREG32_PCIE_PORT(reg, doorbell_range); } +static void nbio_v7_11_vcn_doorbell_range(struct amdgpu_device *adev, + bool use_doorbell, + int doorbell_index, int instance) +{ + u32 reg = SOC15_REG_OFFSET(NBIO, 0, regGDC0_BIF_VCN0_DOORBELL_RANGE); + u32 doorbell_range = RREG32_PCIE_PORT(reg); + + if (use_doorbell) { + doorbell_range = REG_SET_FIELD(doorbell_range, + GDC0_BIF_VCN0_DOORBELL_RANGE, OFFSET, + doorbell_index); + doorbell_range = REG_SET_FIELD(doorbell_range, + GDC0_BIF_VCN0_DOORBELL_RANGE, SIZE, 8); + } else { + doorbell_range = REG_SET_FIELD(doorbell_range, + GDC0_BIF_VCN0_DOORBELL_RANGE, SIZE, 0); + } + + WREG32_PCIE_PORT(reg, doorbell_range); +} + static void nbio_v7_11_enable_doorbell_aperture(struct amdgpu_device *adev, bool enable) { @@ -256,6 +277,7 @@ const struct amdgpu_nbio_funcs nbio_v7_11_funcs = { .mc_access_enable = nbio_v7_11_mc_access_enable, .get_memsize = nbio_v7_11_get_memsize, .sdma_doorbell_range = nbio_v7_11_sdma_doorbell_range, + .vcn_doorbell_range = nbio_v7_11_vcn_doorbell_range, .vpe_doorbell_range = nbio_v7_11_vpe_doorbell_range, .enable_doorbell_aperture = nbio_v7_11_enable_doorbell_aperture, .enable_doorbell_selfring_aperture = nbio_v7_11_enable_doorbell_selfring_aperture, |