Skip to content

Commit 6d8f738

Browse files
Dillon Varonealexdeucher
authored andcommitted
drm/amd/display: Modify DCN401 DMUB reset & halt sequence
[WHY&HOW] If DMCUB is already disabled or reset, no need to send the halt command again. Reviewed-by: Nicholas Kazlauskas <[email protected]> Signed-off-by: Dillon Varone <[email protected]> Signed-off-by: Tom Chung <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 4a16285 commit 6d8f738

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

drivers/gpu/drm/amd/display/dmub/src/dmub_dcn401.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,20 @@ void dmub_dcn401_reset(struct dmub_srv *dmub)
6666
const uint32_t timeout_us = 1 * 1000 * 1000; //1s
6767
const uint32_t poll_delay_us = 1; //1us
6868
uint32_t i = 0;
69-
uint32_t in_reset, scratch, pwait_mode;
69+
uint32_t enabled, in_reset, scratch, pwait_mode;
7070

71-
REG_GET(DMCUB_CNTL2, DMCUB_SOFT_RESET, &in_reset);
71+
REG_GET(DMCUB_CNTL,
72+
DMCUB_ENABLE, &enabled);
73+
REG_GET(DMCUB_CNTL2,
74+
DMCUB_SOFT_RESET, &in_reset);
7275

73-
if (in_reset == 0) {
76+
if (enabled && in_reset == 0) {
7477
cmd.bits.status = 1;
7578
cmd.bits.command_code = DMUB_GPINT__STOP_FW;
7679
cmd.bits.param = 0;
7780

7881
dmub->hw_funcs.set_gpint(dmub, cmd);
7982

80-
for (i = 0; i < timeout_us; i++) {
81-
if (dmub->hw_funcs.is_gpint_acked(dmub, cmd))
82-
break;
83-
84-
udelay(poll_delay_us);
85-
}
86-
8783
for (; i < timeout_us; i++) {
8884
scratch = dmub->hw_funcs.get_gpint_response(dmub);
8985
if (scratch == DMUB_GPINT__STOP_FW_RESPONSE)

0 commit comments

Comments
 (0)