diff options
| author | Sonny Jiang <[email protected]> | 2023-03-20 20:17:21 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2023-06-09 13:56:15 +0000 |
| commit | 26dc0448ef36ba83be43a7c4da94d55ec626db1a (patch) | |
| tree | b52f7c80cb58e4b49d12b91b4f1a73a470750115 /drivers/gpu/drm/amd | |
| parent | drm/amdgpu: use physical AID index for ring name (diff) | |
| download | kernel-26dc0448ef36ba83be43a7c4da94d55ec626db1a.tar.gz kernel-26dc0448ef36ba83be43a7c4da94d55ec626db1a.zip | |
drm/amdgpu: A workaround for JPEG_v4_0_3 ring test fail
The jpeg_v4_0_3 jpeg_pitch register uses UVD_JRBC_SCRATCH0. It needs to
move WREG() to after jpeg_start.
Switch to a posted register write when doing the ring test to make sure
the register write lands before we test the result.
Signed-off-by: Sonny Jiang <[email protected]>
Reviewed-by: Leo Liu <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c index 388466a5f730..9a1db2bd03e7 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c @@ -124,11 +124,14 @@ int amdgpu_jpeg_dec_ring_test_ring(struct amdgpu_ring *ring) if (amdgpu_sriov_vf(adev)) return 0; - WREG32(adev->jpeg.inst[ring->me].external.jpeg_pitch[ring->pipe], 0xCAFEDEAD); r = amdgpu_ring_alloc(ring, 3); if (r) return r; + WREG32(adev->jpeg.inst[ring->me].external.jpeg_pitch[ring->pipe], 0xCAFEDEAD); + /* Add a read register to make sure the write register is executed. */ + RREG32(adev->jpeg.inst[ring->me].external.jpeg_pitch[ring->pipe]); + amdgpu_ring_write(ring, PACKET0(adev->jpeg.internal.jpeg_pitch[ring->pipe], 0)); amdgpu_ring_write(ring, 0xDEADBEEF); amdgpu_ring_commit(ring); |
