Skip to content

Commit 8c50bf9

Browse files
Lijo Lazaralexdeucher
authored andcommitted
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 shouldn't be written, both packets shouldn't be sent. Fixes: a78b481 ("drm/amdgpu: Skip PCTL0_MMHUB_DEEPSLEEP_IB write in jpegv4.0.3 under SRIOV") Signed-off-by: Lijo Lazar <[email protected]> Acked-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 631c54f commit 8c50bf9

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -674,11 +674,12 @@ void jpeg_v4_0_3_dec_ring_insert_start(struct amdgpu_ring *ring)
674674
amdgpu_ring_write(ring, PACKETJ(regUVD_JRBC_EXTERNAL_REG_INTERNAL_OFFSET,
675675
0, 0, PACKETJ_TYPE0));
676676
amdgpu_ring_write(ring, 0x62a04); /* PCTL0_MMHUB_DEEPSLEEP_IB */
677-
}
678677

679-
amdgpu_ring_write(ring, PACKETJ(JRBC_DEC_EXTERNAL_REG_WRITE_ADDR,
680-
0, 0, PACKETJ_TYPE0));
681-
amdgpu_ring_write(ring, 0x80004000);
678+
amdgpu_ring_write(ring,
679+
PACKETJ(JRBC_DEC_EXTERNAL_REG_WRITE_ADDR, 0,
680+
0, PACKETJ_TYPE0));
681+
amdgpu_ring_write(ring, 0x80004000);
682+
}
682683
}
683684

684685
/**
@@ -694,11 +695,12 @@ void jpeg_v4_0_3_dec_ring_insert_end(struct amdgpu_ring *ring)
694695
amdgpu_ring_write(ring, PACKETJ(regUVD_JRBC_EXTERNAL_REG_INTERNAL_OFFSET,
695696
0, 0, PACKETJ_TYPE0));
696697
amdgpu_ring_write(ring, 0x62a04);
697-
}
698698

699-
amdgpu_ring_write(ring, PACKETJ(JRBC_DEC_EXTERNAL_REG_WRITE_ADDR,
700-
0, 0, PACKETJ_TYPE0));
701-
amdgpu_ring_write(ring, 0x00004000);
699+
amdgpu_ring_write(ring,
700+
PACKETJ(JRBC_DEC_EXTERNAL_REG_WRITE_ADDR, 0,
701+
0, PACKETJ_TYPE0));
702+
amdgpu_ring_write(ring, 0x00004000);
703+
}
702704
}
703705

704706
/**

0 commit comments

Comments
 (0)