Skip to content

Commit 154711a

Browse files
Nicholas Kazlauskasalexdeucher
authored andcommitted
drm/amd/display: Reset DMUB mailbox SW state after HW reset
[Why] Otherwise we can be out of sync with what's in the hardware, leading to us rerunning every command that's presently in the ringbuffer. [How] Reset software state for the mailboxes in hw_reset callback. This is already done as part of the mailbox init in hw_init, but we do need to remember to reset the last cached wptr value as well here. Reviewed-by: Hansen Dsouza <[email protected]> Acked-by: Alex Hung <[email protected]> Signed-off-by: Nicholas Kazlauskas <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 275d8a1 commit 154711a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,9 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub,
532532
if (dmub->hw_funcs.reset)
533533
dmub->hw_funcs.reset(dmub);
534534

535+
/* reset the cache of the last wptr as well now that hw is reset */
536+
dmub->inbox1_last_wptr = 0;
537+
535538
cw0.offset.quad_part = inst_fb->gpu_addr;
536539
cw0.region.base = DMUB_CW0_BASE;
537540
cw0.region.top = cw0.region.base + inst_fb->size - 1;
@@ -649,6 +652,15 @@ enum dmub_status dmub_srv_hw_reset(struct dmub_srv *dmub)
649652
if (dmub->hw_funcs.reset)
650653
dmub->hw_funcs.reset(dmub);
651654

655+
/* mailboxes have been reset in hw, so reset the sw state as well */
656+
dmub->inbox1_last_wptr = 0;
657+
dmub->inbox1_rb.wrpt = 0;
658+
dmub->inbox1_rb.rptr = 0;
659+
dmub->outbox0_rb.wrpt = 0;
660+
dmub->outbox0_rb.rptr = 0;
661+
dmub->outbox1_rb.wrpt = 0;
662+
dmub->outbox1_rb.rptr = 0;
663+
652664
dmub->hw_init = false;
653665

654666
return DMUB_STATUS_OK;

0 commit comments

Comments
 (0)