]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/pm: add populate_umd_state_clk support
authorAsad Kamal <asad.kamal@amd.com>
Thu, 25 Dec 2025 15:44:20 +0000 (23:44 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 23 Mar 2026 18:18:36 +0000 (14:18 -0400)
add populate_umd_state_clk support for smu 15.0.8

v2: remove gl2clk/socclk/fclk, restrict to only current min/max (Lijo)

Signed-off-by: Asad Kamal <asad.kamal@amd.com>
Signed-off-by: Yang Wang <kevinyang.wang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/pm/swsmu/smu15/smu_v15_0_8_ppt.c

index 2a74acb2790fdcc1c40509a5fcd25c47c91efe66..c13d9e506082461461b18807d423fe3e092a0bd1 100644 (file)
@@ -1376,6 +1376,21 @@ static int smu_v15_0_8_get_power_limit(struct smu_context *smu,
        return 0;
 }
 
+static int smu_v15_0_8_populate_umd_state_clk(struct smu_context *smu)
+{
+       struct smu_15_0_dpm_context *dpm_context = smu->smu_dpm.dpm_context;
+       struct smu_dpm_table *gfx_table = &dpm_context->dpm_tables.gfx_table;
+       struct smu_dpm_table *mem_table = &dpm_context->dpm_tables.uclk_table;
+       struct smu_umd_pstate_table *pstate_table = &smu->pstate_table;
+
+       pstate_table->gfxclk_pstate.curr.min = SMU_DPM_TABLE_MIN(gfx_table);
+       pstate_table->gfxclk_pstate.curr.max = SMU_DPM_TABLE_MAX(gfx_table);
+
+       pstate_table->uclk_pstate.curr.min = SMU_DPM_TABLE_MIN(mem_table);
+       pstate_table->uclk_pstate.curr.max = SMU_DPM_TABLE_MAX(mem_table);
+       return 0;
+}
+
 static const struct pptable_funcs smu_v15_0_8_ppt_funcs = {
        .init_allowed_features = smu_v15_0_8_init_allowed_features,
        .set_default_dpm_table = smu_v15_0_8_set_default_dpm_table,
@@ -1404,7 +1419,8 @@ static const struct pptable_funcs smu_v15_0_8_ppt_funcs = {
        .get_power_limit = smu_v15_0_8_get_power_limit,
        .set_power_limit = smu_v15_0_set_power_limit,
        .emit_clk_levels = smu_v15_0_8_emit_clk_levels,
-};
+       .populate_umd_state_clk = smu_v15_0_8_populate_umd_state_clk,
+       };
 
 static void smu_v15_0_8_init_msg_ctl(struct smu_context *smu,
                                     const struct cmn2asic_msg_mapping *message_map)