Commit 42b3aa9a authored by Kevin Wang's avatar Kevin Wang Committed by Alex Deucher

drm/amd/powerplay: avoid double check feature enabled

the unforce_dpm_levels doesn't need to check feature enablement.
because the smu_get_dpm_freq_range function has check feature logic.
Signed-off-by: default avatarKevin Wang <kevin1.wang@amd.com>
Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 75728f51
...@@ -833,27 +833,20 @@ static int navi10_force_dpm_limit_value(struct smu_context *smu, bool highest) ...@@ -833,27 +833,20 @@ static int navi10_force_dpm_limit_value(struct smu_context *smu, bool highest)
return ret; return ret;
} }
static int navi10_unforce_dpm_levels(struct smu_context *smu) { static int navi10_unforce_dpm_levels(struct smu_context *smu)
{
int ret = 0, i = 0; int ret = 0, i = 0;
uint32_t min_freq, max_freq; uint32_t min_freq, max_freq;
enum smu_clk_type clk_type; enum smu_clk_type clk_type;
struct clk_feature_map { enum smu_clk_type clks[] = {
enum smu_clk_type clk_type; SMU_GFXCLK,
uint32_t feature; SMU_MCLK,
} clk_feature_map[] = { SMU_SOCCLK,
{SMU_GFXCLK, SMU_FEATURE_DPM_GFXCLK_BIT},
{SMU_MCLK, SMU_FEATURE_DPM_UCLK_BIT},
{SMU_SOCCLK, SMU_FEATURE_DPM_SOCCLK_BIT},
}; };
for (i = 0; i < ARRAY_SIZE(clk_feature_map); i++) { for (i = 0; i < ARRAY_SIZE(clks); i++) {
if (!smu_feature_is_enabled(smu, clk_feature_map[i].feature)) clk_type = clks[i];
continue;
clk_type = clk_feature_map[i].clk_type;
ret = smu_get_dpm_freq_range(smu, clk_type, &min_freq, &max_freq); ret = smu_get_dpm_freq_range(smu, clk_type, &min_freq, &max_freq);
if (ret) if (ret)
return ret; return ret;
......
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