summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/powerplay/smu_v12_0.c
diff options
context:
space:
mode:
authorAaron Liu <aaron.liu@amd.com>2019-07-30 11:28:27 +0800
committerAlex Deucher <alexander.deucher@amd.com>2019-08-22 17:38:05 -0500
commit723d473537778f3f1bd9a91eb286aa5c349c8f0e (patch)
tree82b5eab4c816f4ae8e08830bbfd20c3f3c485384 /drivers/gpu/drm/amd/powerplay/smu_v12_0.c
parent049284bd5264563965e106f03f152a70df9342ca (diff)
drm/amd/powerplay: add DPMCLOCKS table implementation
This patch adds add DPMCLOCKS table implementation Rename smu_populate_smc_pptable to smu_populate_smc_tables Signed-off-by: Aaron Liu <aaron.liu@amd.com> Reviewed-by: Kenneth Feng <kenneth.feng@amd.com> Reviewed-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Kevin Wang <kevin1.wang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/smu_v12_0.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/smu_v12_0.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smu_v12_0.c b/drivers/gpu/drm/amd/powerplay/smu_v12_0.c
index 76a6c4b7b63c..0f5d08ae71ae 100644
--- a/drivers/gpu/drm/amd/powerplay/smu_v12_0.c
+++ b/drivers/gpu/drm/amd/powerplay/smu_v12_0.c
@@ -295,11 +295,30 @@ static int smu_v12_0_fini_smc_tables(struct smu_context *smu)
if (!smu_table->tables || smu_table->table_count == 0)
return -EINVAL;
+ kfree(smu_table->clocks_table);
kfree(smu_table->tables);
+
+ smu_table->clocks_table = NULL;
smu_table->tables = NULL;
return 0;
}
+
+static int smu_v12_0_populate_smc_tables(struct smu_context *smu)
+{
+ struct smu_table_context *smu_table = &smu->smu_table;
+ struct smu_table *table = NULL;
+
+ table = &smu_table->tables[SMU_TABLE_DPMCLOCKS];
+ if (!table)
+ return -EINVAL;
+
+ if (!table->cpu_addr)
+ return -EINVAL;
+
+ return smu_update_table(smu, SMU_TABLE_DPMCLOCKS, 0, smu_table->clocks_table, false);
+}
+
static const struct smu_funcs smu_v12_0_funcs = {
.check_fw_status = smu_v12_0_check_fw_status,
.check_fw_version = smu_v12_0_check_fw_version,
@@ -312,6 +331,7 @@ static const struct smu_funcs smu_v12_0_funcs = {
.gfx_off_control = smu_v12_0_gfx_off_control,
.init_smc_tables = smu_v12_0_init_smc_tables,
.fini_smc_tables = smu_v12_0_fini_smc_tables,
+ .populate_smc_tables = smu_v12_0_populate_smc_tables,
};
void smu_v12_0_set_smu_funcs(struct smu_context *smu)