Skip to content

Commit 822b84e

Browse files
Rodrigo Siqueiraalexdeucher
authored andcommitted
drm/amd/display: Add missing WA and MCLK validation
When the commit fff7eb5 ("drm/amd/display: Don't set dram clock change requirement for SubVP") was merged, we missed some parts associated with the MCLK switch. This commit adds all the missing parts. Fixes: fff7eb5 ("drm/amd/display: Don't set dram clock change requirement for SubVP") Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent ce560ac commit 822b84e

3 files changed

Lines changed: 19 additions & 2 deletions

File tree

drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -948,6 +948,7 @@ void dcn32_init_hw(struct dc *dc)
948948
if (dc->ctx->dmub_srv) {
949949
dc_dmub_srv_query_caps_cmd(dc->ctx->dmub_srv->dmub);
950950
dc->caps.dmub_caps.psr = dc->ctx->dmub_srv->dmub->feature_caps.psr;
951+
dc->caps.dmub_caps.mclk_sw = dc->ctx->dmub_srv->dmub->feature_caps.fw_assisted_mclk_switch;
951952
}
952953
}
953954

drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2023,7 +2023,7 @@ int dcn32_populate_dml_pipes_from_context(
20232023
// In general cases we want to keep the dram clock change requirement
20242024
// (prefer configs that support MCLK switch). Only override to false
20252025
// for SubVP
2026-
if (subvp_in_use)
2026+
if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching || subvp_in_use)
20272027
context->bw_ctx.dml.soc.dram_clock_change_requirement_final = false;
20282028
else
20292029
context->bw_ctx.dml.soc.dram_clock_change_requirement_final = true;

drivers/gpu/drm/amd/display/dc/dml/dcn30/dcn30_fpu.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,9 @@ void dcn30_fpu_update_soc_for_wm_a(struct dc *dc, struct dc_state *context)
368368
dc_assert_fp_enabled();
369369

370370
if (dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].valid) {
371-
context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.pstate_latency_us;
371+
if (!context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching ||
372+
context->bw_ctx.dml.soc.dram_clock_change_latency_us == 0)
373+
context->bw_ctx.dml.soc.dram_clock_change_latency_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.pstate_latency_us;
372374
context->bw_ctx.dml.soc.sr_enter_plus_exit_time_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.sr_enter_plus_exit_time_us;
373375
context->bw_ctx.dml.soc.sr_exit_time_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.sr_exit_time_us;
374376
}
@@ -563,6 +565,20 @@ void dcn30_fpu_calculate_wm_and_dlg(
563565
pipe_idx++;
564566
}
565567

568+
// WA: restrict FPO to use first non-strobe mode (NV24 BW issue)
569+
if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching &&
570+
dc->dml.soc.num_chans <= 4 &&
571+
context->bw_ctx.dml.vba.DRAMSpeed <= 1700 &&
572+
context->bw_ctx.dml.vba.DRAMSpeed >= 1500) {
573+
574+
for (i = 0; i < dc->dml.soc.num_states; i++) {
575+
if (dc->dml.soc.clock_limits[i].dram_speed_mts > 1700) {
576+
context->bw_ctx.dml.vba.DRAMSpeed = dc->dml.soc.clock_limits[i].dram_speed_mts;
577+
break;
578+
}
579+
}
580+
}
581+
566582
dcn20_calculate_dlg_params(dc, context, pipes, pipe_cnt, vlevel);
567583

568584
if (!pstate_en)

0 commit comments

Comments
 (0)