drm/amdgpu/swsmu: Only force workload setup on init
authorjsg <jsg@openbsd.org>
Wed, 23 Oct 2024 04:10:16 +0000 (04:10 +0000)
committerjsg <jsg@openbsd.org>
Wed, 23 Oct 2024 04:10:16 +0000 (04:10 +0000)
From Alex Deucher
db0978d3ed8b1f69b6e09c3ccb66897fd2a9f6d7 in linux-6.6.y/6.6.58
cb07c8338fc2b9d5f949a19d4a07ee4d5ecf8793 in mainline linux

sys/dev/pci/drm/amd/pm/swsmu/amdgpu_smu.c

index c890b07..2a98a28 100644 (file)
@@ -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);
        }