diff options
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index 95144e49c7f9..34471dbaa872 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |||
| @@ -342,6 +342,16 @@ static ssize_t amdgpu_set_dpm_forced_performance_level(struct device *dev, | |||
| 342 | if (current_level == level) | 342 | if (current_level == level) |
| 343 | return count; | 343 | return count; |
| 344 | 344 | ||
| 345 | /* profile_exit setting is valid only when current mode is in profile mode */ | ||
| 346 | if (!(current_level & (AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD | | ||
| 347 | AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK | | ||
| 348 | AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK | | ||
| 349 | AMD_DPM_FORCED_LEVEL_PROFILE_PEAK)) && | ||
| 350 | (level == AMD_DPM_FORCED_LEVEL_PROFILE_EXIT)) { | ||
| 351 | pr_err("Currently not in any profile mode!\n"); | ||
| 352 | return -EINVAL; | ||
| 353 | } | ||
| 354 | |||
| 345 | if (is_support_sw_smu(adev)) { | 355 | if (is_support_sw_smu(adev)) { |
| 346 | mutex_lock(&adev->pm.mutex); | 356 | mutex_lock(&adev->pm.mutex); |
| 347 | if (adev->pm.dpm.thermal_active) { | 357 | if (adev->pm.dpm.thermal_active) { |
