Skip to content

Commit

Permalink
drm/amdgpu/cz: unforce dpm levels before forcing to low/high
Browse files Browse the repository at this point in the history
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: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Alex Deucher committed Jul 16, 2015
1 parent 4f2d3ad commit 85cfe09
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/cz_dpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1687,17 +1687,23 @@ static int cz_dpm_unforce_dpm_levels(struct amdgpu_device *adev)
}

static int cz_dpm_force_dpm_level(struct amdgpu_device *adev,
enum amdgpu_dpm_forced_level level)
enum amdgpu_dpm_forced_level level)
{
int ret = 0;

switch (level) {
case AMDGPU_DPM_FORCED_LEVEL_HIGH:
ret = cz_dpm_unforce_dpm_levels(adev);
if (ret)
return ret;
ret = cz_dpm_force_highest(adev);
if (ret)
return ret;
break;
case AMDGPU_DPM_FORCED_LEVEL_LOW:
ret = cz_dpm_unforce_dpm_levels(adev);
if (ret)
return ret;
ret = cz_dpm_force_lowest(adev);
if (ret)
return ret;
Expand Down

0 comments on commit 85cfe09

Please sign in to comment.