Commit ac18b610 authored by Alvin Lee's avatar Alvin Lee Committed by Alex Deucher

drm/amd/display: Enable FPO for configs that could reduce vlevel

[Description]
- On high refresh rate DRR displays that support VBLANK naturally,
  UCLK could be idling at DPM1 instead of DPM0 since it doesn't use
  FPO
- To achieve DPM0, enable FPO on these configs even though it can
  support P-State without FPO
- Default disable for now, have debug option to enable
Reviewed-by: default avatarJun Lei <Jun.Lei@amd.com>
Acked-by: default avatarQingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: default avatarAlvin Lee <Alvin.Lee2@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d29fb7ba
...@@ -873,6 +873,7 @@ struct dc_debug_options { ...@@ -873,6 +873,7 @@ struct dc_debug_options {
bool dig_fifo_off_in_blank; bool dig_fifo_off_in_blank;
bool temp_mst_deallocation_sequence; bool temp_mst_deallocation_sequence;
bool override_dispclk_programming; bool override_dispclk_programming;
bool disable_fpo_optimizations;
}; };
struct gpu_info_soc_bounding_box_v1_0; struct gpu_info_soc_bounding_box_v1_0;
......
...@@ -725,6 +725,7 @@ static const struct dc_debug_options debug_defaults_drv = { ...@@ -725,6 +725,7 @@ static const struct dc_debug_options debug_defaults_drv = {
.min_prefetch_in_strobe_ns = 60000, // 60us .min_prefetch_in_strobe_ns = 60000, // 60us
.disable_unbounded_requesting = false, .disable_unbounded_requesting = false,
.override_dispclk_programming = true, .override_dispclk_programming = true,
.disable_fpo_optimizations = true,
}; };
static const struct dc_debug_options debug_defaults_diags = { static const struct dc_debug_options debug_defaults_diags = {
......
...@@ -723,6 +723,7 @@ static const struct dc_debug_options debug_defaults_drv = { ...@@ -723,6 +723,7 @@ static const struct dc_debug_options debug_defaults_drv = {
.min_prefetch_in_strobe_ns = 60000, // 60us .min_prefetch_in_strobe_ns = 60000, // 60us
.disable_unbounded_requesting = false, .disable_unbounded_requesting = false,
.override_dispclk_programming = true, .override_dispclk_programming = true,
.disable_fpo_optimizations = true,
}; };
static const struct dc_debug_options debug_defaults_diags = { static const struct dc_debug_options debug_defaults_diags = {
......
...@@ -1961,7 +1961,8 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context, ...@@ -1961,7 +1961,8 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context,
context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching = false; context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching = false;
if (!pstate_en) { if (!pstate_en || (!dc->debug.disable_fpo_optimizations &&
pstate_en && vlevel != 0)) {
/* only when the mclk switch can not be natural, is the fw based vblank stretch attempted */ /* only when the mclk switch can not be natural, is the fw based vblank stretch attempted */
context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching = context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching =
dcn30_can_support_mclk_switch_using_fw_based_vblank_stretch(dc, context); dcn30_can_support_mclk_switch_using_fw_based_vblank_stretch(dc, context);
...@@ -1985,11 +1986,21 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context, ...@@ -1985,11 +1986,21 @@ void dcn32_calculate_wm_and_dlg_fpu(struct dc *dc, struct dc_state *context,
context->bw_ctx.dml.soc.fclk_change_latency_us = context->bw_ctx.dml.soc.fclk_change_latency_us =
dc->clk_mgr->bw_params->dummy_pstate_table[dummy_latency_index].dummy_pstate_latency_us; dc->clk_mgr->bw_params->dummy_pstate_table[dummy_latency_index].dummy_pstate_latency_us;
} }
dcn32_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel, false); dcn32_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel_temp, false);
maxMpcComb = context->bw_ctx.dml.vba.maxMpcComb; if (vlevel_temp < vlevel) {
dcfclk_from_fw_based_mclk_switching = context->bw_ctx.dml.vba.DCFCLKState[vlevel][context->bw_ctx.dml.vba.maxMpcComb]; vlevel = vlevel_temp;
pstate_en = context->bw_ctx.dml.vba.DRAMClockChangeSupport[vlevel][maxMpcComb] != maxMpcComb = context->bw_ctx.dml.vba.maxMpcComb;
dm_dram_clock_change_unsupported; dcfclk_from_fw_based_mclk_switching = context->bw_ctx.dml.vba.DCFCLKState[vlevel][context->bw_ctx.dml.vba.maxMpcComb];
pstate_en = true;
} else {
/* Restore FCLK latency and re-run validation to go back to original validation
* output if we find that enabling FPO does not give us any benefit (i.e. lower
* voltage level)
*/
context->bw_ctx.bw.dcn.clk.fw_based_mclk_switching = false;
context->bw_ctx.dml.soc.fclk_change_latency_us = dc->clk_mgr->bw_params->wm_table.nv_entries[WM_A].dml_input.fclk_change_latency_us;
dcn32_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel, false);
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment