mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-03 11:13:56 +08:00
drm/amd/powerplay: add feature check in unforce_dpm_levels function (v2)
if not check dpm feature is enabled, it will cause show smc send message failed log in dmesg log. eg: echo "auto" > power_dpm_force_performance_level v2: whitespace fix (Alex) Signed-off-by: Kevin Wang <kevin1.wang@amd.com> Reviewed-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Rui Teng <rui.teng@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
ac1092b341
commit
cb2a782eb8
@ -815,14 +815,21 @@ static int navi10_unforce_dpm_levels(struct smu_context *smu) {
|
|||||||
uint32_t min_freq, max_freq;
|
uint32_t min_freq, max_freq;
|
||||||
enum smu_clk_type clk_type;
|
enum smu_clk_type clk_type;
|
||||||
|
|
||||||
enum smu_clk_type clks[] = {
|
struct clk_feature_map {
|
||||||
SMU_GFXCLK,
|
enum smu_clk_type clk_type;
|
||||||
SMU_MCLK,
|
uint32_t feature;
|
||||||
SMU_SOCCLK,
|
} clk_feature_map[] = {
|
||||||
|
{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(clks); i++) {
|
for (i = 0; i < ARRAY_SIZE(clk_feature_map); i++) {
|
||||||
clk_type = clks[i];
|
if (!smu_feature_is_enabled(smu, clk_feature_map[i].feature))
|
||||||
|
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;
|
||||||
|
Loading…
Reference in New Issue
Block a user