Commit 85cfe096 authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu/cz: unforce dpm levels before forcing to low/high

This is necessary to properly reset the min/max limits before
clamping them otherwise we may get improper clamping depending
on what what was the last forced level.
Reviewed-by: default avatarJammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4f2d3ad6
...@@ -1693,11 +1693,17 @@ static int cz_dpm_force_dpm_level(struct amdgpu_device *adev, ...@@ -1693,11 +1693,17 @@ static int cz_dpm_force_dpm_level(struct amdgpu_device *adev,
switch (level) { switch (level) {
case AMDGPU_DPM_FORCED_LEVEL_HIGH: case AMDGPU_DPM_FORCED_LEVEL_HIGH:
ret = cz_dpm_unforce_dpm_levels(adev);
if (ret)
return ret;
ret = cz_dpm_force_highest(adev); ret = cz_dpm_force_highest(adev);
if (ret) if (ret)
return ret; return ret;
break; break;
case AMDGPU_DPM_FORCED_LEVEL_LOW: case AMDGPU_DPM_FORCED_LEVEL_LOW:
ret = cz_dpm_unforce_dpm_levels(adev);
if (ret)
return ret;
ret = cz_dpm_force_lowest(adev); ret = cz_dpm_force_lowest(adev);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment