From: jsg Date: Wed, 23 Oct 2024 04:10:16 +0000 (+0000) Subject: drm/amdgpu/swsmu: Only force workload setup on init X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=afb6e02f9b1e0f9d0c9bb81e8279bb5dc116bb2a;p=openbsd drm/amdgpu/swsmu: Only force workload setup on init From Alex Deucher db0978d3ed8b1f69b6e09c3ccb66897fd2a9f6d7 in linux-6.6.y/6.6.58 cb07c8338fc2b9d5f949a19d4a07ee4d5ecf8793 in mainline linux --- diff --git a/sys/dev/pci/drm/amd/pm/swsmu/amdgpu_smu.c b/sys/dev/pci/drm/amd/pm/swsmu/amdgpu_smu.c index c890b07fee1..2a98a28fbe7 100644 --- a/sys/dev/pci/drm/amd/pm/swsmu/amdgpu_smu.c +++ b/sys/dev/pci/drm/amd/pm/swsmu/amdgpu_smu.c @@ -1843,7 +1843,7 @@ static int smu_bump_power_profile_mode(struct smu_context *smu, static int smu_adjust_power_state_dynamic(struct smu_context *smu, enum amd_dpm_forced_level level, bool skip_display_settings, - bool force_update) + bool init) { int ret = 0; int index = 0; @@ -1872,7 +1872,7 @@ static int smu_adjust_power_state_dynamic(struct smu_context *smu, } } - if (force_update || smu_dpm_ctx->dpm_level != level) { + if (smu_dpm_ctx->dpm_level != level) { ret = smu_asic_set_performance_level(smu, level); if (ret) { dev_err(smu->adev->dev, "Failed to set performance level!"); @@ -1889,7 +1889,7 @@ static int smu_adjust_power_state_dynamic(struct smu_context *smu, index = index > 0 && index <= WORKLOAD_POLICY_MAX ? index - 1 : 0; workload[0] = smu->workload_setting[index]; - if (force_update || smu->power_profile_mode != workload[0]) + if (init || smu->power_profile_mode != workload[0]) smu_bump_power_profile_mode(smu, workload, 0); }