summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Stewart <Matthew.Stewart2@amd.com>2026-06-08 11:22:02 -0400
committerAlex Deucher <alexander.deucher@amd.com>2026-07-01 11:16:45 -0400
commit46fda8bda6f93a38db8ea8cca6d84eae304deff3 (patch)
tree969c3839305b7106734e5ea3851d5069611a737f
parent64142f9d51aff32f4130d916cb8f044a072ad27d (diff)
drm/amd/display: Rewrite dccg42_init
[why] DCN42 reuses dccg42_init, which causes problems due to undefined masks. [how] - Read res_pool to determine the quantities of the respective resources - Remove the physymclk root_clock_optimization check, as it seems like it shouldn't do anything (defaults to disabled already). Reviewed-by: Ovidiu (Ovi) Bunea <ovidiu.bunea@amd.com> Signed-off-by: Matthew Stewart <Matthew.Stewart2@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/dc/dccg/dcn42/dcn42_dccg.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dccg/dcn42/dcn42_dccg.c b/drivers/gpu/drm/amd/display/dc/dccg/dcn42/dcn42_dccg.c
index adc453c81831..8989761c6078 100644
--- a/drivers/gpu/drm/amd/display/dc/dccg/dcn42/dcn42_dccg.c
+++ b/drivers/gpu/drm/amd/display/dc/dccg/dcn42/dcn42_dccg.c
@@ -269,37 +269,26 @@ void dccg42_trigger_dio_fifo_resync(struct dccg *dccg)
static void dccg42_init(struct dccg *dccg)
{
- int otg_inst;
- struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
+ unsigned int i;
+ struct resource_pool *res_pool = dccg->ctx->dc->res_pool;
/* Set HPO stream encoder to use refclk to avoid case where PHY is
* disabled and SYMCLK32 for HPO SE is sourced from PHYD32CLK which
* will cause DCN to hang.
*/
- for (otg_inst = 0; otg_inst < 4; otg_inst++)
- dccg35_disable_symclk32_se(dccg, otg_inst);
+ for (i = 0; i < res_pool->hpo_dp_stream_enc_count; i++)
+ dccg35_disable_symclk32_se(dccg, i);
if (dccg->ctx->dc->debug.root_clock_optimization.bits.symclk32_le) {
- dccg401_disable_symclk32_le(dccg, 0);
- dccg401_disable_symclk32_le(dccg, 1);
- dccg401_disable_symclk32_le(dccg, 2);
- dccg401_disable_symclk32_le(dccg, 3);
+ for (i = 0; i < res_pool->hpo_dp_link_enc_count; i++)
+ dccg401_disable_symclk32_le(dccg, i);
}
if (dccg->ctx->dc->debug.root_clock_optimization.bits.dpstream) {
- dccg401_disable_dpstreamclk(dccg, 0);
- dccg401_disable_dpstreamclk(dccg, 1);
- dccg401_disable_dpstreamclk(dccg, 2);
- dccg401_disable_dpstreamclk(dccg, 3);
- }
- if (!dccg->ctx->dc->debug.root_clock_optimization.bits.physymclk) {
- REG_UPDATE_5(DCCG_GATE_DISABLE_CNTL2,
- PHYASYMCLK_ROOT_GATE_DISABLE, 1,
- PHYBSYMCLK_ROOT_GATE_DISABLE, 1,
- PHYCSYMCLK_ROOT_GATE_DISABLE, 1,
- PHYDSYMCLK_ROOT_GATE_DISABLE, 1,
- PHYESYMCLK_ROOT_GATE_DISABLE, 1);
+ for (i = 0; i < res_pool->hpo_dp_stream_enc_count; i++)
+ dccg401_disable_dpstreamclk(dccg, i);
}
+
dccg42_disable_hdmistreamclk(dccg);
if (dccg->ctx->dc->debug.root_clock_optimization.bits.hdmichar)
dccg42_disable_hdmicharclk(dccg, 0);