drm/amd/display: Add check for forced_clocks debug option
authorCharlene Liu <Charlene.Liu@amd.com>
Thu, 16 Dec 2021 21:33:04 +0000 (16:33 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 7 Jan 2022 22:21:45 +0000 (17:21 -0500)
[why]
driver missed the check.

[how]
add the check.
add min display clock = 100mhz check based on dccg doc.

[note]
add SetPhyclkVoltageByFreq as confirmed with smu, but not enabled in
this change.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Charlene Liu <Charlene.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c

index ba4c33500a6d2f20fae61cb5578fd93690445df0..8d64187478e42dcf51aa549258e28e507d6c9d5d 100644 (file)
@@ -1984,7 +1984,7 @@ static void dcn31_calculate_wm_and_dlg_fp(
                pipes[pipe_idx].clks_cfg.dispclk_mhz = get_dispclk_calculated(&context->bw_ctx.dml, pipes, pipe_cnt);
                pipes[pipe_idx].clks_cfg.dppclk_mhz = get_dppclk_calculated(&context->bw_ctx.dml, pipes, pipe_cnt, pipe_idx);
 
-               if (dc->config.forced_clocks) {
+               if (dc->config.forced_clocks || dc->debug.max_disp_clk) {
                        pipes[pipe_idx].clks_cfg.dispclk_mhz = context->bw_ctx.dml.soc.clock_limits[0].dispclk_mhz;
                        pipes[pipe_idx].clks_cfg.dppclk_mhz = context->bw_ctx.dml.soc.clock_limits[0].dppclk_mhz;
                }