summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLijo Lazar <lijo.lazar@amd.com>2021-01-28 18:53:27 +0800
committerAlex Deucher <alexander.deucher@amd.com>2021-03-23 22:58:10 -0400
commit26256ca8a6e773e65e7e237ff972b1b0b7a557e0 (patch)
tree3b51c4e277952b8ac14a8551b9ac14b9d12da731
parentd6f19a9949417db7264521b536fc86c7a68e23b1 (diff)
drm/amd/pm: Add DCBTC support for aldebaran
On aldebaran DCBTC should be run after enabling DPM. DCBTC won't be run if support is not enabled in PPTable. Without PPTable support the message is dummy and will return success always. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
index e08df4da57a8..2427681fab8a 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
@@ -425,16 +425,13 @@ static int aldebaran_setup_pptable(struct smu_context *smu)
static int aldebaran_run_btc(struct smu_context *smu)
{
- /* int ret = 0; */
+ int ret;
- /* ret = smu_cmn_send_smc_msg(smu, SMU_MSG_RunAfllBtc, NULL); */
- /* if (ret) { */
- /* dev_err(smu->adev->dev, "RunAfllBtc failed!\n"); */
- /* return ret; */
- /* } */
+ ret = smu_cmn_send_smc_msg(smu, SMU_MSG_RunDcBtc, NULL);
+ if (ret)
+ dev_err(smu->adev->dev, "RunDcBtc failed!\n");
- /* return smu_cmn_send_smc_msg(smu, SMU_MSG_RunDcBtc, NULL); */
- return 0;
+ return ret;
}
static int aldebaran_populate_umd_state_clk(struct smu_context *smu)
@@ -1092,6 +1089,17 @@ static int aldebaran_get_power_limit(struct smu_context *smu)
return 0;
}
+static int aldebaran_system_features_control(struct smu_context *smu, bool enable)
+{
+ int ret;
+
+ ret = smu_v13_0_system_features_control(smu, enable);
+ if (!ret && enable)
+ ret = aldebaran_run_btc(smu);
+
+ return ret;
+}
+
static int aldebaran_set_performance_level(struct smu_context *smu,
enum amd_dpm_forced_level level)
{
@@ -1300,8 +1308,6 @@ static bool aldebaran_is_mode2_reset_supported(struct smu_context *smu)
static const struct pptable_funcs aldebaran_ppt_funcs = {
/* init dpm */
.get_allowed_feature_mask = aldebaran_get_allowed_feature_mask,
- /* btc */
- .run_btc = aldebaran_run_btc,
/* dpm/clk tables */
.set_default_dpm_table = aldebaran_set_default_dpm_table,
.populate_umd_state_clk = aldebaran_populate_umd_state_clk,
@@ -1329,7 +1335,7 @@ static const struct pptable_funcs aldebaran_ppt_funcs = {
.set_driver_table_location = smu_v13_0_set_driver_table_location,
.set_tool_table_location = smu_v13_0_set_tool_table_location,
.notify_memory_pool_location = smu_v13_0_notify_memory_pool_location,
- .system_features_control = smu_v13_0_system_features_control,
+ .system_features_control = aldebaran_system_features_control,
.send_smc_msg_with_param = smu_cmn_send_smc_msg_with_param,
.send_smc_msg = smu_cmn_send_smc_msg,
.get_enabled_mask = smu_cmn_get_enabled_mask,