aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
diff options
context:
space:
mode:
authorPrike Liang <Prike.Liang@amd.com>2019-08-15 16:53:08 +0800
committerAlex Deucher <alexander.deucher@amd.com>2019-08-29 15:52:32 -0500
commiteee3258e8f8be822a6d7c15faa3f4a9e3081381e (patch)
tree7378aeae35962ce6a609a2ac944f00c1d52b1848 /drivers/gpu/drm/amd/powerplay/renoir_ppt.c
parentdrm/amd/powerplay: enable populate DPM clocks table for swSMU APU (diff)
downloadwireguard-linux-eee3258e8f8be822a6d7c15faa3f4a9e3081381e.tar.xz
wireguard-linux-eee3258e8f8be822a6d7c15faa3f4a9e3081381e.zip
drm/amd/powerplay: add the interface for getting ultimate frequency v3
add the get_dpm_ultimate_freq for supporting different swSMU. -v2: Handle the unsupported clock type and read smc message failed case and return error code. Move the smu12 uclk frequency retrieved logic to renoir ppt. -v3: Use goto clause to handle invalidate clk index. Add the limited tag for smu_get_dpm_uclk to avoid other likewise interface introduced. Signed-off-by: Prike Liang <Prike.Liang@amd.com> Reviewed-by: Evan Quan <evan.quan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/renoir_ppt.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/renoir_ppt.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
index de43159564a5..2a6da546fb55 100644
--- a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c
@@ -156,11 +156,33 @@ static int renoir_tables_init(struct smu_context *smu, struct smu_table *tables)
return 0;
}
+/**
+ * This interface just for getting uclk ultimate freq and should't introduce
+ * other likewise function result in overmuch callback.
+ */
+static int renoir_get_dpm_uclk_limited(struct smu_context *smu, uint32_t *clock, bool max)
+{
+
+ DpmClocks_t *table = smu->smu_table.clocks_table;
+
+ if (!clock || !table)
+ return -EINVAL;
+
+ if (max)
+ *clock = table->FClocks[NUM_FCLK_DPM_LEVELS-1].Freq;
+ else
+ *clock = table->FClocks[0].Freq;
+
+ return 0;
+
+}
+
static const struct pptable_funcs renoir_ppt_funcs = {
.get_smu_msg_index = renoir_get_smu_msg_index,
.get_smu_table_index = renoir_get_smu_table_index,
.tables_init = renoir_tables_init,
.set_power_state = NULL,
+ .get_dpm_uclk_limited = renoir_get_dpm_uclk_limited,
};
void renoir_set_ppt_funcs(struct smu_context *smu)