Skip to content

Commit c50fe28

Browse files
committed
drm/amdgpu/swsmu: always force a state reprogram on init
Always reprogram the hardware state on init. This ensures the PMFW state is explicitly programmed and we are not relying on the default PMFW state. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3131 Reviewed-by: Kenneth Feng <kenneth.feng@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent e45a393 commit c50fe28

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,8 +2224,9 @@ static int smu_bump_power_profile_mode(struct smu_context *smu,
22242224
}
22252225

22262226
static int smu_adjust_power_state_dynamic(struct smu_context *smu,
2227-
enum amd_dpm_forced_level level,
2228-
bool skip_display_settings)
2227+
enum amd_dpm_forced_level level,
2228+
bool skip_display_settings,
2229+
bool force_update)
22292230
{
22302231
int ret = 0;
22312232
int index = 0;
@@ -2254,7 +2255,7 @@ static int smu_adjust_power_state_dynamic(struct smu_context *smu,
22542255
}
22552256
}
22562257

2257-
if (smu_dpm_ctx->dpm_level != level) {
2258+
if (force_update || smu_dpm_ctx->dpm_level != level) {
22582259
ret = smu_asic_set_performance_level(smu, level);
22592260
if (ret) {
22602261
dev_err(smu->adev->dev, "Failed to set performance level!");
@@ -2270,7 +2271,7 @@ static int smu_adjust_power_state_dynamic(struct smu_context *smu,
22702271
index = index > 0 && index <= WORKLOAD_POLICY_MAX ? index - 1 : 0;
22712272
workload[0] = smu->workload_setting[index];
22722273

2273-
if (smu->power_profile_mode != workload[0])
2274+
if (force_update || smu->power_profile_mode != workload[0])
22742275
smu_bump_power_profile_mode(smu, workload, 0);
22752276
}
22762277

@@ -2291,11 +2292,13 @@ static int smu_handle_task(struct smu_context *smu,
22912292
ret = smu_pre_display_config_changed(smu);
22922293
if (ret)
22932294
return ret;
2294-
ret = smu_adjust_power_state_dynamic(smu, level, false);
2295+
ret = smu_adjust_power_state_dynamic(smu, level, false, false);
22952296
break;
22962297
case AMD_PP_TASK_COMPLETE_INIT:
2298+
ret = smu_adjust_power_state_dynamic(smu, level, true, true);
2299+
break;
22972300
case AMD_PP_TASK_READJUST_POWER_STATE:
2298-
ret = smu_adjust_power_state_dynamic(smu, level, true);
2301+
ret = smu_adjust_power_state_dynamic(smu, level, true, false);
22992302
break;
23002303
default:
23012304
break;

0 commit comments

Comments
 (0)