Skip to content

Commit f5a972d

Browse files
Qili Lualexdeucher
authored andcommitted
drm/amd/display: fix dccg root clock optimization related hang
[Why] enable dpp rcg before we disable dppclk in hw_init cause system hang/reboot [How] we remove dccg rcg related code from init into a separate function and call it after we init pipe Reviewed-by: Nicholas Kazlauskas <[email protected]> Signed-off-by: Qili Lu <[email protected]> Signed-off-by: Hamza Mahfooz <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 5359d5b commit f5a972d

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1748,10 +1748,6 @@ void dccg35_init(struct dccg *dccg)
17481748
dccg35_set_dpstreamclk_root_clock_gating(dccg, otg_inst, false);
17491749
}
17501750

1751-
if (dccg->ctx->dc->debug.root_clock_optimization.bits.dpp)
1752-
for (otg_inst = 0; otg_inst < 4; otg_inst++)
1753-
dccg35_set_dppclk_root_clock_gating(dccg, otg_inst, 0);
1754-
17551751
/*
17561752
dccg35_enable_global_fgcg_rep(
17571753
dccg, dccg->ctx->dc->debug.enable_fine_grain_clock_gating.bits
@@ -2336,6 +2332,14 @@ static void dccg35_disable_symclk_se_cb(
23362332
/* DMU PHY sequence switches SYMCLK_BE (link_enc_inst) to ref clock once PHY is turned off */
23372333
}
23382334

2335+
void dccg35_root_gate_disable_control(struct dccg *dccg, uint32_t pipe_idx, uint32_t disable_clock_gating)
2336+
{
2337+
2338+
if (dccg->ctx->dc->debug.root_clock_optimization.bits.dpp) {
2339+
dccg35_set_dppclk_root_clock_gating(dccg, pipe_idx, disable_clock_gating);
2340+
}
2341+
}
2342+
23392343
static const struct dccg_funcs dccg35_funcs_new = {
23402344
.update_dpp_dto = dccg35_update_dpp_dto_cb,
23412345
.dpp_root_clock_control = dccg35_dpp_root_clock_control_cb,
@@ -2396,7 +2400,7 @@ static const struct dccg_funcs dccg35_funcs = {
23962400
.enable_symclk_se = dccg35_enable_symclk_se,
23972401
.disable_symclk_se = dccg35_disable_symclk_se,
23982402
.set_dtbclk_p_src = dccg35_set_dtbclk_p_src,
2399-
2403+
.dccg_root_gate_disable_control = dccg35_root_gate_disable_control,
24002404
};
24012405

24022406
struct dccg *dccg35_create(

drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ struct dccg *dccg35_create(
241241
void dccg35_init(struct dccg *dccg);
242242

243243
void dccg35_enable_global_fgcg_rep(struct dccg *dccg, bool value);
244+
void dccg35_root_gate_disable_control(struct dccg *dccg, uint32_t pipe_idx, uint32_t disable_clock_gating);
244245

245246

246247
#endif //__DCN35_DCCG_H__

drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,10 @@ void dcn35_init_hw(struct dc *dc)
240240
dc->res_pool->hubbub->funcs->allow_self_refresh_control(dc->res_pool->hubbub,
241241
!dc->res_pool->hubbub->ctx->dc->debug.disable_stutter);
242242
}
243+
if (res_pool->dccg->funcs->dccg_root_gate_disable_control) {
244+
for (i = 0; i < res_pool->pipe_count; i++)
245+
res_pool->dccg->funcs->dccg_root_gate_disable_control(res_pool->dccg, i, 0);
246+
}
243247

244248
for (i = 0; i < res_pool->audio_count; i++) {
245249
struct audio *audio = res_pool->audios[i];

drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ struct dccg_funcs {
213213
uint32_t otg_inst);
214214
void (*set_dto_dscclk)(struct dccg *dccg, uint32_t dsc_inst);
215215
void (*set_ref_dscclk)(struct dccg *dccg, uint32_t dsc_inst);
216+
void (*dccg_root_gate_disable_control)(struct dccg *dccg, uint32_t pipe_idx, uint32_t disable_clock_gating);
216217
};
217218

218219
#endif //__DAL_DCCG_H__

0 commit comments

Comments
 (0)