]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/amdgpu: align pp_power_profile_mode with kernel docs
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 21 Aug 2024 18:32:02 +0000 (14:32 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 28 Aug 2024 14:00:25 +0000 (10:00 -0400)
The kernel doc says you need to select manual mode to
adjust this, but the code only allows you to adjust it when
manual mode is not selected.  Remove the manual mode check.

Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit bbb05f8a9cd87f5046d05a0c596fddfb714ee457)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

index 9d7454b3c3143dead4d3a207401aa8a6c1777e5b..bc83cd89f8a00b8ade2e583b5a12614e5138d364 100644 (file)
@@ -2265,8 +2265,7 @@ static int smu_adjust_power_state_dynamic(struct smu_context *smu,
                smu_dpm_ctx->dpm_level = level;
        }
 
-       if (smu_dpm_ctx->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL &&
-               smu_dpm_ctx->dpm_level != AMD_DPM_FORCED_LEVEL_PERF_DETERMINISM) {
+       if (smu_dpm_ctx->dpm_level != AMD_DPM_FORCED_LEVEL_PERF_DETERMINISM) {
                index = fls(smu->workload_mask);
                index = index > 0 && index <= WORKLOAD_POLICY_MAX ? index - 1 : 0;
                workload[0] = smu->workload_setting[index];
@@ -2343,8 +2342,7 @@ static int smu_switch_power_profile(void *handle,
                workload[0] = smu->workload_setting[index];
        }
 
-       if (smu_dpm_ctx->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL &&
-               smu_dpm_ctx->dpm_level != AMD_DPM_FORCED_LEVEL_PERF_DETERMINISM)
+       if (smu_dpm_ctx->dpm_level != AMD_DPM_FORCED_LEVEL_PERF_DETERMINISM)
                smu_bump_power_profile_mode(smu, workload, 0);
 
        return 0;