drm/amdgpu: Fix JPEG v4.0.3 register write
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fix JPEG v4.0.3 register write
EXTERNAL_REG_INTERNAL_OFFSET/EXTERNAL_REG_WRITE_ADDR should be used in pairs. If an external register shoudln't be written, both packets shouldn't be sent.
jpegv4.0.3 under SRIOV")
--- drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c +10 -8
@@ -674,11 +674,12 @@ void jpeg_v4_0_3_dec_ring_insert_start(struct amdgpu_ring *ring)amdgpu_ring_write (ring,PACKETJ (regUVD_JRBC_EXTERNAL_REG_INTERNAL_OFFSET,0 ,0 ,PACKETJ_TYPE0 ));amdgpu_ring_write (ring,0x62a04 );/* PCTL0_MMHUB_DEEPSLEEP_IB */ - } -amdgpu_ring_write (ring,PACKETJ (JRBC_DEC_EXTERNAL_REG_WRITE_ADDR , -0 ,0 ,PACKETJ_TYPE0 )); -amdgpu_ring_write (ring,0x80004000 ); +amdgpu_ring_write (ring, +PACKETJ (JRBC_DEC_EXTERNAL_REG_WRITE_ADDR ,0 , +0 ,PACKETJ_TYPE0 )); +amdgpu_ring_write (ring,0x80004000 ); + } }/**
@@ -694,11 +695,12 @@ void jpeg_v4_0_3_dec_ring_insert_end(struct amdgpu_ring *ring)amdgpu_ring_write (ring,PACKETJ (regUVD_JRBC_EXTERNAL_REG_INTERNAL_OFFSET,0 ,0 ,PACKETJ_TYPE0 ));amdgpu_ring_write (ring,0x62a04 ); - } -amdgpu_ring_write (ring,PACKETJ (JRBC_DEC_EXTERNAL_REG_WRITE_ADDR , -0 ,0 ,PACKETJ_TYPE0 )); -amdgpu_ring_write (ring,0x00004000 ); +amdgpu_ring_write (ring, +PACKETJ (JRBC_DEC_EXTERNAL_REG_WRITE_ADDR ,0 , +0 ,PACKETJ_TYPE0 )); +amdgpu_ring_write (ring,0x00004000 ); + } }/**
Signature · 1 line
2.25.1
[AMD Official Use Only - AMD Internal Distribution Only]
Quoted 73 lines
-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: September 6, 2024 4:46 AM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander <[email protected]>; Liu, Leo <[email protected]>; Jian, Jane <[email protected]>; Lu, Victor Cheng Chi (Victor) <[email protected]>
Subject: [PATCH] drm/amdgpu: Fix JPEG v4.0.3 register writeEXTERNAL_REG_INTERNAL_OFFSET/EXTERNAL_REG_WRITE_ADDR should be used in pairs. If an external register shoudln't be written, both packets shouldn't be sent.
Fixes a78b48146972 ("drm/amdgpu: Skip PCTL0_MMHUB_DEEPSLEEP_IBwrite in
jpegv4.0.3 under SRIOV")Signed-off-by Lijo Lazar <[email protected]>--- drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c +0
-0@@ -674,11 +674,12 @@ void jpeg_v4_0_3_dec_ring_insert_start(struct amdgpu_ring *ring)amdgpu_ring_write (ring ,PACKETJ (regUVD_JRBC_EXTERNAL_REG_INTERNAL_OFFSET , 0, 0, PACKETJ_TYPE0));amdgpu_ring_write (ring,0x62a04 );/*
PCTL0_MMHUB_DEEPSLEEP_IB*/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c +0
-2- } - amdgpu_ring_write(ring,PACKETJ(JRBC_DEC_EXTERNAL_REG_WRITE_ADDR,
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c +2
-2- 0, 0, PACKETJ_TYPE0)); -amdgpu_ring_write (ring,0x80004000 ); + amdgpu_ring_write(ring, +PACKETJ(JRBC_DEC_EXTERNAL_REG_WRITE_ADDR, 0,
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c +5
-4+ 0, PACKETJ_TYPE0)); +amdgpu_ring_write (ring,0x80004000 ); + } }/** @@ -694,11 +695,12 @@ void jpeg_v4_0_3_dec_ring_insert_end(struct amdgpu_ring *ring)amdgpu_ring_write (ring ,PACKETJ (regUVD_JRBC_EXTERNAL_REG_INTERNAL_OFFSET , 0, 0, PACKETJ_TYPE0));amdgpu_ring_write (ring,0x62a04 ); - } -amdgpu_ring_write (ring, PACKETJ(JRBC_DEC_EXTERNAL_REG_WRITE_ADDR, -0 ,0 ,PACKETJ_TYPE0 )); -amdgpu_ring_write (ring,0x00004000 ); + amdgpu_ring_write(ring, +PACKETJ(JRBC_DEC_EXTERNAL_REG_WRITE_ADDR, 0,
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c +3
-1+ 0, PACKETJ_TYPE0)); +amdgpu_ring_write (ring,0x00004000 ); + } }/** -- 2.25.1