Skip to content

Commit c149947

Browse files
Dillon Varonealexdeucher
authored andcommitted
drm/amd/display: use uclk pstate latency for fw assisted mclk validation dcn32
[WHY?] DCN32 uses fclk pstate watermarks for dummy pstate, and must always be supported. [HOW?] Validation needs to be run with fclk pstate latency set as the dummy pstate latency to get correct prefetch and bandwidth outputs. Reviewed-by: Jun Lei <Jun.Lei@amd.com> Acked-by: Tom Chung <chiahsuan.chung@amd.com> Signed-off-by: Dillon Varone <Dillon.Varone@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 246e667 commit c149947

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1803,6 +1803,12 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context,
18031803
*/
18041804
context->bw_ctx.dml.soc.dram_clock_change_latency_us =
18051805
dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.pstate_latency_us;
1806+
/* For DCN32/321 need to validate with fclk pstate change latency equal to dummy so
1807+
* prefetch is scheduled correctly to account for dummy pstate.
1808+
*/
1809+
if (dummy_latency_index == 0)
1810+
context->bw_ctx.dml.soc.fclk_change_latency_us =
1811+
dc->clk_mgr->bw_params->dummy_pstate_table[dummy_latency_index].dummy_pstate_latency_us;
18061812
dcn32_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel, false);
18071813
maxMpcComb = context->bw_ctx.dml.vba.maxMpcComb;
18081814
dcfclk_from_fw_based_mclk_switching = context->bw_ctx.dml.vba.DCFCLKState[vlevel][context->bw_ctx.dml.vba.maxMpcComb];
@@ -1990,15 +1996,23 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context,
19901996

19911997
context->perf_params.stutter_period_us = context->bw_ctx.dml.vba.StutterPeriod;
19921998

1999+
if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching && dummy_latency_index == 0)
2000+
context->bw_ctx.dml.soc.fclk_change_latency_us =
2001+
dc->clk_mgr->bw_params->dummy_pstate_table[dummy_latency_index].dummy_pstate_latency_us;
2002+
19932003
dcn32_calculate_dlg_params(dc, context, pipes, pipe_cnt, vlevel);
19942004

19952005
if (!pstate_en)
19962006
/* Restore full p-state latency */
19972007
context->bw_ctx.dml.soc.dram_clock_change_latency_us =
19982008
dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.pstate_latency_us;
19992009

2000-
if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching)
2010+
if (context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching) {
20012011
dcn30_setup_mclk_switch_using_fw_based_vblank_stretch(dc, context);
2012+
if (dummy_latency_index == 0)
2013+
context->bw_ctx.dml.soc.fclk_change_latency_us =
2014+
dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.fclk_change_latency_us;
2015+
}
20022016
}
20032017

20042018
static void dcn32_get_optimal_dcfclk_fclk_for_uclk(unsigned int uclk_mts,

0 commit comments

Comments
 (0)