drm/amd/display: Request min clocks after disabling pipes on init
authorAlvin Lee <Alvin.Lee2@amd.com>
Wed, 14 Dec 2022 20:43:55 +0000 (15:43 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 17 Jan 2023 20:40:57 +0000 (15:40 -0500)
[Description]
- Request min clocks after disabling pipes on init
- This optimizes for power savings during init sequence
- Also handles the case where we boot up with no display connected

Tested-by: Daniel Wheeler <Daniel.Wheeler@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alvin Lee <Alvin.Lee2@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c

index 97fb37ff567bde83b075100a78eff6fc146cd688..3b44006e1a80d7199f8ee3326050cdf84eb197a3 100644 (file)
@@ -685,6 +685,25 @@ void dcn32_program_mall_pipe_config(struct dc *dc, struct dc_state *context)
        }
 }
 
+static void dcn32_initialize_min_clocks(struct dc *dc)
+{
+       struct dc_clocks *clocks = &dc->current_state->bw_ctx.bw.dcn.clk;
+
+       clocks->dcfclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0].dcfclk_mhz * 1000;
+       clocks->socclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0].socclk_mhz * 1000;
+       clocks->dramclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0].memclk_mhz * 1000;
+       clocks->dppclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0].dppclk_mhz * 1000;
+       clocks->dispclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0].dispclk_mhz * 1000;
+       clocks->ref_dtbclk_khz = dc->clk_mgr->bw_params->clk_table.entries[0].dtbclk_mhz * 1000;
+       clocks->fclk_p_state_change_support = true;
+       clocks->p_state_change_support = true;
+
+       dc->clk_mgr->funcs->update_clocks(
+                       dc->clk_mgr,
+                       dc->current_state,
+                       true);
+}
+
 void dcn32_init_hw(struct dc *dc)
 {
        struct abm **abms = dc->res_pool->multiple_abms;
@@ -779,6 +798,8 @@ void dcn32_init_hw(struct dc *dc)
                if (dc->res_pool->hubbub->funcs->allow_self_refresh_control)
                        dc->res_pool->hubbub->funcs->allow_self_refresh_control(dc->res_pool->hubbub,
                                        !dc->res_pool->hubbub->ctx->dc->debug.disable_stutter);
+
+               dcn32_initialize_min_clocks(dc);
        }
 
        /* In headless boot cases, DIG may be turned