Signed-off-by: Samir Dhume <samir.dh...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c 
b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
index ac405dfcfaf1..fa9abcb08c22 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
@@ -113,9 +113,16 @@ static int vcn_v4_0_3_sw_init(void *handle)
 
                ring = &adev->vcn.inst[i].ring_enc[0];
                ring->use_doorbell = true;
-               ring->doorbell_index =
-                       (adev->doorbell_index.vcn.vcn_ring0_1 << 1) +
-                       9 * vcn_inst;
+
+               if (!amdgpu_sriov_vf(adev))
+                       ring->doorbell_index =
+                               (adev->doorbell_index.vcn.vcn_ring0_1 << 1) +
+                               9 * vcn_inst;
+               else
+                       ring->doorbell_index =
+                               (adev->doorbell_index.vcn.vcn_ring0_1 << 1) +
+                               32 * vcn_inst;
+
                ring->vm_hub = AMDGPU_MMHUB0(adev->vcn.inst[i].aid_id);
                sprintf(ring->name, "vcn_unified_%d", adev->vcn.inst[i].aid_id);
                r = amdgpu_ring_init(adev, ring, 512, &adev->vcn.inst->irq, 0,
-- 
2.34.1

Reply via email to