Commit 9085914a authored by Leo Liu's avatar Leo Liu Committed by Alex Deucher

drm/amdgpu: add JPEG2.0 decode ring test

Use register from JPEG tile, the UVD tile reg won't work for JPEG
Signed-off-by: default avatarLeo Liu <leo.liu@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 60a2309e
...@@ -631,19 +631,17 @@ int amdgpu_vcn_jpeg_ring_test_ring(struct amdgpu_ring *ring) ...@@ -631,19 +631,17 @@ int amdgpu_vcn_jpeg_ring_test_ring(struct amdgpu_ring *ring)
unsigned i; unsigned i;
int r; int r;
WREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SCRATCH9), 0xCAFEDEAD); WREG32(adev->vcn.external.jpeg_pitch, 0xCAFEDEAD);
r = amdgpu_ring_alloc(ring, 3); r = amdgpu_ring_alloc(ring, 3);
if (r) if (r)
return r; return r;
amdgpu_ring_write(ring, amdgpu_ring_write(ring, PACKET0(adev->vcn.internal.jpeg_pitch, 0));
PACKETJ(SOC15_REG_OFFSET(UVD, 0, mmUVD_SCRATCH9), 0, 0, 0));
amdgpu_ring_write(ring, 0xDEADBEEF); amdgpu_ring_write(ring, 0xDEADBEEF);
amdgpu_ring_commit(ring); amdgpu_ring_commit(ring);
for (i = 0; i < adev->usec_timeout; i++) { for (i = 0; i < adev->usec_timeout; i++) {
tmp = RREG32(SOC15_REG_OFFSET(UVD, 0, mmUVD_SCRATCH9)); tmp = RREG32(adev->vcn.external.jpeg_pitch);
if (tmp == 0xDEADBEEF) if (tmp == 0xDEADBEEF)
break; break;
DRM_UDELAY(1); DRM_UDELAY(1);
......
...@@ -93,6 +93,7 @@ struct amdgpu_vcn_reg{ ...@@ -93,6 +93,7 @@ struct amdgpu_vcn_reg{
unsigned cmd; unsigned cmd;
unsigned nop; unsigned nop;
unsigned scratch9; unsigned scratch9;
unsigned jpeg_pitch;
}; };
struct amdgpu_vcn { struct amdgpu_vcn {
......
...@@ -154,6 +154,8 @@ static int vcn_v1_0_sw_init(void *handle) ...@@ -154,6 +154,8 @@ static int vcn_v1_0_sw_init(void *handle)
return r; return r;
adev->vcn.pause_dpg_mode = vcn_v1_0_pause_dpg_mode; adev->vcn.pause_dpg_mode = vcn_v1_0_pause_dpg_mode;
adev->vcn.internal.jpeg_pitch = adev->vcn.external.jpeg_pitch =
SOC15_REG_OFFSET(UVD, 0, mmUVD_JPEG_PITCH);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment