aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd
diff options
context:
space:
mode:
authorGravatar Lang Yu <Lang.Yu@amd.com> 2023-07-18 16:29:38 -0400
committerGravatar Alex Deucher <alexander.deucher@amd.com> 2023-08-31 16:33:56 -0400
commit5861e47731aa8e8c29bca5d51705a5435397c6ae (patch)
treef55b66c54cf9762f5563b0ee68d4764be8282ccd /drivers/gpu/drm/amd
parentdrm/amdgpu: add nbio callback for VPE (diff)
downloadlinux-5861e47731aa8e8c29bca5d51705a5435397c6ae.tar.gz
linux-5861e47731aa8e8c29bca5d51705a5435397c6ae.tar.bz2
linux-5861e47731aa8e8c29bca5d51705a5435397c6ae.zip
drm/amdgpu: add nbio 7.11 callback for VPE
Add nbio callback to configure doorbell settings. Signed-off-by: Lang Yu <Lang.Yu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c24
1 files changed, 24 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 7c08e5f95e97..5318f9c269c9 100644
--- a/drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c
+++ b/drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c
@@ -79,6 +79,29 @@ static void nbio_v7_11_sdma_doorbell_range(struct amdgpu_device *adev, int insta
WREG32_PCIE_PORT(reg, doorbell_range);
}
+static void nbio_v7_11_vpe_doorbell_range(struct amdgpu_device *adev, int instance,
+ bool use_doorbell, int doorbell_index,
+ int doorbell_size)
+{
+ u32 reg = SOC15_REG_OFFSET(NBIO, 0, regGDC0_BIF_VPE_DOORBELL_RANGE);
+ u32 doorbell_range = RREG32_PCIE_PORT(reg);
+
+ if (use_doorbell) {
+ doorbell_range = REG_SET_FIELD(doorbell_range,
+ GDC0_BIF_VPE_DOORBELL_RANGE,
+ OFFSET, doorbell_index);
+ doorbell_range = REG_SET_FIELD(doorbell_range,
+ GDC0_BIF_VPE_DOORBELL_RANGE,
+ SIZE, doorbell_size);
+ } else {
+ doorbell_range = REG_SET_FIELD(doorbell_range,
+ GDC0_BIF_VPE_DOORBELL_RANGE,
+ SIZE, 0);
+ }
+
+ WREG32_PCIE_PORT(reg, doorbell_range);
+}
+
static void nbio_v7_11_enable_doorbell_aperture(struct amdgpu_device *adev,
bool enable)
{
@@ -235,6 +258,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,
+ .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,
.ih_doorbell_range = nbio_v7_11_ih_doorbell_range,