Skip to content

Commit dba2429

Browse files
Samir Dhumealexdeucher
authored andcommitted
drm/amdgpu/jpeg: mmsch_v4_0_3 requires doorbell on 32 byte boundary
BASE: VCN0 unified (32 byte boundary) BASE+4: MJPEG0 BASE+5: MJPEG1 BASE+6: MJPEG2 BASE+7: MJPEG3 BASE+12: MJPEG4 BASE+13: MJPEG5 BASE+14: MJPEG6 BASE+15: MJPEG7 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>
1 parent 3cc0f8f commit dba2429

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,20 @@ static int jpeg_v4_0_3_sw_init(void *handle)
109109
ring = &adev->jpeg.inst[i].ring_dec[j];
110110
ring->use_doorbell = true;
111111
ring->vm_hub = AMDGPU_MMHUB0(adev->jpeg.inst[i].aid_id);
112-
ring->doorbell_index =
113-
(adev->doorbell_index.vcn.vcn_ring0_1 << 1) +
114-
1 + j + 9 * jpeg_inst;
112+
if (!amdgpu_sriov_vf(adev)) {
113+
ring->doorbell_index =
114+
(adev->doorbell_index.vcn.vcn_ring0_1 << 1) +
115+
1 + j + 9 * jpeg_inst;
116+
} else {
117+
if (j < 4)
118+
ring->doorbell_index =
119+
(adev->doorbell_index.vcn.vcn_ring0_1 << 1) +
120+
4 + j + 32 * jpeg_inst;
121+
else
122+
ring->doorbell_index =
123+
(adev->doorbell_index.vcn.vcn_ring0_1 << 1) +
124+
8 + j + 32 * jpeg_inst;
125+
}
115126
sprintf(ring->name, "jpeg_dec_%d.%d", adev->jpeg.inst[i].aid_id, j);
116127
r = amdgpu_ring_init(adev, ring, 512, &adev->jpeg.inst->irq, 0,
117128
AMDGPU_RING_PRIO_DEFAULT, NULL);

0 commit comments

Comments
 (0)