drm/amdgpu/vcn: mmsch_v4_0_3 requires doorbell on 32 byte boundary
authorSamir Dhume <samir.dhume@amd.com>
Mon, 17 Jul 2023 15:27:02 +0000 (11:27 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 Aug 2023 22:08:27 +0000 (18:08 -0400)
Align on 32 byte boundary.

Signed-off-by: Samir Dhume <samir.dhume@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c

index e62472e6e7b3e848cd698834bf50c9a97252c326..71eb6b55deef99271b7cd53cc9d5c38aa66f4179 100644 (file)
@@ -111,9 +111,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,