Commit 2f55c264 authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/powerplay: drop unused APIs and unnecessary checks

Minor code cleanups.
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 31157341
...@@ -720,30 +720,6 @@ int smu_feature_is_supported(struct smu_context *smu, enum smu_feature_mask mask ...@@ -720,30 +720,6 @@ int smu_feature_is_supported(struct smu_context *smu, enum smu_feature_mask mask
return ret; return ret;
} }
int smu_feature_set_supported(struct smu_context *smu,
enum smu_feature_mask mask,
bool enable)
{
struct smu_feature *feature = &smu->smu_feature;
int feature_id;
int ret = 0;
feature_id = smu_feature_get_index(smu, mask);
if (feature_id < 0)
return -EINVAL;
WARN_ON(feature_id > feature->feature_num);
mutex_lock(&feature->mutex);
if (enable)
test_and_set_bit(feature_id, feature->supported);
else
test_and_clear_bit(feature_id, feature->supported);
mutex_unlock(&feature->mutex);
return ret;
}
static int smu_set_funcs(struct amdgpu_device *adev) static int smu_set_funcs(struct amdgpu_device *adev)
{ {
struct smu_context *smu = &adev->smu; struct smu_context *smu = &adev->smu;
...@@ -823,22 +799,10 @@ int smu_get_atom_data_table(struct smu_context *smu, uint32_t table, ...@@ -823,22 +799,10 @@ int smu_get_atom_data_table(struct smu_context *smu, uint32_t table,
return 0; return 0;
} }
static int smu_initialize_pptable(struct smu_context *smu)
{
/* TODO */
return 0;
}
static int smu_smc_table_sw_init(struct smu_context *smu) static int smu_smc_table_sw_init(struct smu_context *smu)
{ {
int ret; int ret;
ret = smu_initialize_pptable(smu);
if (ret) {
pr_err("Failed to init smu_initialize_pptable!\n");
return ret;
}
/** /**
* Create smu_table structure, and init smc tables such as * Create smu_table structure, and init smc tables such as
* TABLE_PPTABLE, TABLE_WATERMARKS, TABLE_SMU_METRICS, and etc. * TABLE_PPTABLE, TABLE_WATERMARKS, TABLE_SMU_METRICS, and etc.
...@@ -1137,20 +1101,17 @@ static int smu_smc_table_hw_init(struct smu_context *smu, ...@@ -1137,20 +1101,17 @@ static int smu_smc_table_hw_init(struct smu_context *smu,
return ret; return ret;
} }
if (smu->ppt_funcs->set_power_source) {
/* /*
* For Navi1X, manually switch it to AC mode as PMFW * For Navi1X, manually switch it to AC mode as PMFW
* may boot it with DC mode. * may boot it with DC mode.
*/ */
if (adev->pm.ac_power) ret = smu_set_power_source(smu,
ret = smu_set_power_source(smu, SMU_POWER_SOURCE_AC); adev->pm.ac_power ? SMU_POWER_SOURCE_AC :
else SMU_POWER_SOURCE_DC);
ret = smu_set_power_source(smu, SMU_POWER_SOURCE_DC);
if (ret) { if (ret) {
pr_err("Failed to switch to %s mode!\n", adev->pm.ac_power ? "AC" : "DC"); pr_err("Failed to switch to %s mode!\n", adev->pm.ac_power ? "AC" : "DC");
return ret; return ret;
} }
}
ret = smu_notify_display_change(smu); ret = smu_notify_display_change(smu);
if (ret) if (ret)
...@@ -2138,15 +2099,12 @@ int smu_set_ac_dc(struct smu_context *smu) ...@@ -2138,15 +2099,12 @@ int smu_set_ac_dc(struct smu_context *smu)
return 0; return 0;
mutex_lock(&smu->mutex); mutex_lock(&smu->mutex);
if (smu->ppt_funcs->set_power_source) { ret = smu_set_power_source(smu,
if (smu->adev->pm.ac_power) smu->adev->pm.ac_power ? SMU_POWER_SOURCE_AC :
ret = smu_set_power_source(smu, SMU_POWER_SOURCE_AC); SMU_POWER_SOURCE_DC);
else
ret = smu_set_power_source(smu, SMU_POWER_SOURCE_DC);
if (ret) if (ret)
pr_err("Failed to switch to %s mode!\n", pr_err("Failed to switch to %s mode!\n",
smu->adev->pm.ac_power ? "AC" : "DC"); smu->adev->pm.ac_power ? "AC" : "DC");
}
mutex_unlock(&smu->mutex); mutex_unlock(&smu->mutex);
return ret; return ret;
......
...@@ -668,8 +668,6 @@ extern int smu_feature_set_enabled(struct smu_context *smu, ...@@ -668,8 +668,6 @@ extern int smu_feature_set_enabled(struct smu_context *smu,
enum smu_feature_mask mask, bool enable); enum smu_feature_mask mask, bool enable);
extern int smu_feature_is_supported(struct smu_context *smu, extern int smu_feature_is_supported(struct smu_context *smu,
enum smu_feature_mask mask); enum smu_feature_mask mask);
extern int smu_feature_set_supported(struct smu_context *smu,
enum smu_feature_mask mask, bool enable);
int smu_update_table(struct smu_context *smu, enum smu_table_id table_index, int argument, int smu_update_table(struct smu_context *smu, enum smu_table_id table_index, int argument,
void *table_data, bool drv2smu); void *table_data, bool drv2smu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment