Skip to content

Commit becbab4

Browse files
Ivan Lipskialexdeucher
authored andcommitted
drm/amd/display: Check for S0i3 to be done before DCCG init on DCN21
[WHY] On DCN21, dccg2_init() is called in dcn10_init_hw() before bios_golden_init(). During S0i3 resume, BIOS sets MICROSECOND_TIME_BASE_DIV to 0x00120464 as a marker. dccg2_init() overwrites this to 0x00120264, causing dcn21_s0i3_golden_init_wa() to misdetect the state and skip golden init. Eventually during the resume sequence, a flip timeout occurs. [HOW] Skip DCCG on dccg2_is_s0i3_golden_init_wa_done() on DCN21. Fixes: 4c595e7 ("drm/amd/display: Migrate DCCG registers access from hwseq to dccg component.") Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Signed-off-by: Ivan Lipski <ivan.lipski@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit c61eda4)
1 parent 33efc63 commit becbab4

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

drivers/gpu/drm/amd/display/dc/dccg/dcn21/dcn21_dccg.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,33 @@ static void dccg21_update_dpp_dto(struct dccg *dccg, int dpp_inst, int req_dppcl
9696
dccg->pipe_dppclk_khz[dpp_inst] = req_dppclk;
9797
}
9898

99+
/*
100+
* On DCN21 S0i3 resume, BIOS programs MICROSECOND_TIME_BASE_DIV to
101+
* 0x00120464 as a marker that golden init has already been done.
102+
* dcn21_s0i3_golden_init_wa() reads this marker later in bios_golden_init()
103+
* to decide whether to skip golden init.
104+
*
105+
* dccg2_init() unconditionally overwrites MICROSECOND_TIME_BASE_DIV to
106+
* 0x00120264, destroying the marker before it can be read.
107+
*
108+
* Guard the call: if the S0i3 marker is present, skip dccg2_init() so the
109+
* WA can function correctly. bios_golden_init() will handle init in that case.
110+
*/
111+
static void dccg21_init(struct dccg *dccg)
112+
{
113+
if (dccg2_is_s0i3_golden_init_wa_done(dccg))
114+
return;
115+
116+
dccg2_init(dccg);
117+
}
99118

100119
static const struct dccg_funcs dccg21_funcs = {
101120
.update_dpp_dto = dccg21_update_dpp_dto,
102121
.get_dccg_ref_freq = dccg2_get_dccg_ref_freq,
103122
.set_fifo_errdet_ovr_en = dccg2_set_fifo_errdet_ovr_en,
104123
.otg_add_pixel = dccg2_otg_add_pixel,
105124
.otg_drop_pixel = dccg2_otg_drop_pixel,
106-
.dccg_init = dccg2_init,
125+
.dccg_init = dccg21_init,
107126
.refclk_setup = dccg2_refclk_setup, /* Deprecated - for backward compatibility only */
108127
.allow_clock_gating = dccg2_allow_clock_gating,
109128
.enable_memory_low_power = dccg2_enable_memory_low_power,

0 commit comments

Comments
 (0)