Skip to content

Commit 3abd1e9

Browse files
Evan Quanalexdeucher
authored andcommitted
drm/amd/powerplay: error out on forcing clock setting not supported
For Arcturus, forcing clock to some specific level is not supported with 54.18 and onwards SMU firmware. As according to firmware team, they adopt new gfx dpm tuned parameters which can cover all the use case in a much smooth way. Thus setting through driver interface is not needed and maybe do a disservice. Signed-off-by: Evan Quan <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 487eca1 commit 3abd1e9

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

drivers/gpu/drm/amd/powerplay/arcturus_ppt.c

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,8 +794,21 @@ static int arcturus_force_clk_levels(struct smu_context *smu,
794794
struct arcturus_dpm_table *dpm_table;
795795
struct arcturus_single_dpm_table *single_dpm_table;
796796
uint32_t soft_min_level, soft_max_level;
797+
uint32_t smu_version;
797798
int ret = 0;
798799

800+
ret = smu_get_smc_version(smu, NULL, &smu_version);
801+
if (ret) {
802+
pr_err("Failed to get smu version!\n");
803+
return ret;
804+
}
805+
806+
if (smu_version >= 0x361200) {
807+
pr_err("Forcing clock level is not supported with "
808+
"54.18 and onwards SMU firmwares\n");
809+
return -EOPNOTSUPP;
810+
}
811+
799812
soft_min_level = mask ? (ffs(mask) - 1) : 0;
800813
soft_max_level = mask ? (fls(mask) - 1) : 0;
801814

@@ -1512,6 +1525,38 @@ static int arcturus_set_power_profile_mode(struct smu_context *smu,
15121525
return 0;
15131526
}
15141527

1528+
static int arcturus_set_performance_level(struct smu_context *smu,
1529+
enum amd_dpm_forced_level level)
1530+
{
1531+
uint32_t smu_version;
1532+
int ret;
1533+
1534+
ret = smu_get_smc_version(smu, NULL, &smu_version);
1535+
if (ret) {
1536+
pr_err("Failed to get smu version!\n");
1537+
return ret;
1538+
}
1539+
1540+
switch (level) {
1541+
case AMD_DPM_FORCED_LEVEL_HIGH:
1542+
case AMD_DPM_FORCED_LEVEL_LOW:
1543+
case AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD:
1544+
case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK:
1545+
case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK:
1546+
case AMD_DPM_FORCED_LEVEL_PROFILE_PEAK:
1547+
if (smu_version >= 0x361200) {
1548+
pr_err("Forcing clock level is not supported with "
1549+
"54.18 and onwards SMU firmwares\n");
1550+
return -EOPNOTSUPP;
1551+
}
1552+
break;
1553+
default:
1554+
break;
1555+
}
1556+
1557+
return smu_v11_0_set_performance_level(smu, level);
1558+
}
1559+
15151560
static void arcturus_dump_pptable(struct smu_context *smu)
15161561
{
15171562
struct smu_table_context *table_context = &smu->smu_table;
@@ -2285,7 +2330,7 @@ static const struct pptable_funcs arcturus_ppt_funcs = {
22852330
.get_profiling_clk_mask = arcturus_get_profiling_clk_mask,
22862331
.get_power_profile_mode = arcturus_get_power_profile_mode,
22872332
.set_power_profile_mode = arcturus_set_power_profile_mode,
2288-
.set_performance_level = smu_v11_0_set_performance_level,
2333+
.set_performance_level = arcturus_set_performance_level,
22892334
/* debug (internal used) */
22902335
.dump_pptable = arcturus_dump_pptable,
22912336
.get_power_limit = arcturus_get_power_limit,

0 commit comments

Comments
 (0)