Skip to content

Commit c3ea03c

Browse files
Austin Zhengalexdeucher
authored andcommitted
drm/amd/display: Populate Power Profile In Case of Early Return
Early return possible if context has no clk_mgr. This will lead to an invalid power profile being returned which looks identical to a profile with the lowest power level. Add back logic that populated the power profile and overwrite the value if needed. Cc: [email protected] Fixes: d016d0d ("drm/amd/display: Update Interface to Check UCLK DPM") Reviewed-by: Dillon Varone <[email protected]> Signed-off-by: Austin Zheng <[email protected]> Signed-off-by: Hamza Mahfooz <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent e017958 commit c3ea03c

File tree

1 file changed

+2
-2
lines changed
  • drivers/gpu/drm/amd/display/dc/core

1 file changed

+2
-2
lines changed

drivers/gpu/drm/amd/display/dc/core/dc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6100,11 +6100,11 @@ struct dc_power_profile dc_get_power_profile_for_dc_state(const struct dc_state
61006100
{
61016101
struct dc_power_profile profile = { 0 };
61026102

6103-
if (!context || !context->clk_mgr || !context->clk_mgr->ctx || !context->clk_mgr->ctx->dc)
6103+
profile.power_level = !context->bw_ctx.bw.dcn.clk.p_state_change_support;
6104+
if (!context->clk_mgr || !context->clk_mgr->ctx || !context->clk_mgr->ctx->dc)
61046105
return profile;
61056106
struct dc *dc = context->clk_mgr->ctx->dc;
61066107

6107-
61086108
if (dc->res_pool->funcs->get_power_profile)
61096109
profile.power_level = dc->res_pool->funcs->get_power_profile(context);
61106110
return profile;

0 commit comments

Comments
 (0)