diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2015-07-14 12:26:41 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-07-16 12:39:41 -0400 |
commit | 85cfe096552b7792032105dbcedeab019ac4c26e (patch) | |
tree | f5bd336cd8b7800f4e581de1f386cfd2d3a98ebb | |
parent | 4f2d3ad6863ad5bc361c704511cd8888723085e8 (diff) |
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: Jammy Zhou <Jammy.Zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/cz_dpm.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/cz_dpm.c b/drivers/gpu/drm/amd/amdgpu/cz_dpm.c index f75a31df30bd..8d95547f263a 100644 --- a/drivers/gpu/drm/amd/amdgpu/cz_dpm.c +++ b/drivers/gpu/drm/amd/amdgpu/cz_dpm.c | |||
@@ -1687,17 +1687,23 @@ static int cz_dpm_unforce_dpm_levels(struct amdgpu_device *adev) | |||
1687 | } | 1687 | } |
1688 | 1688 | ||
1689 | static int cz_dpm_force_dpm_level(struct amdgpu_device *adev, | 1689 | static int cz_dpm_force_dpm_level(struct amdgpu_device *adev, |
1690 | enum amdgpu_dpm_forced_level level) | 1690 | enum amdgpu_dpm_forced_level level) |
1691 | { | 1691 | { |
1692 | int ret = 0; | 1692 | int ret = 0; |
1693 | 1693 | ||
1694 | switch (level) { | 1694 | switch (level) { |
1695 | case AMDGPU_DPM_FORCED_LEVEL_HIGH: | 1695 | case AMDGPU_DPM_FORCED_LEVEL_HIGH: |
1696 | ret = cz_dpm_unforce_dpm_levels(adev); | ||
1697 | if (ret) | ||
1698 | return ret; | ||
1696 | ret = cz_dpm_force_highest(adev); | 1699 | ret = cz_dpm_force_highest(adev); |
1697 | if (ret) | 1700 | if (ret) |
1698 | return ret; | 1701 | return ret; |
1699 | break; | 1702 | break; |
1700 | case AMDGPU_DPM_FORCED_LEVEL_LOW: | 1703 | case AMDGPU_DPM_FORCED_LEVEL_LOW: |
1704 | ret = cz_dpm_unforce_dpm_levels(adev); | ||
1705 | if (ret) | ||
1706 | return ret; | ||
1701 | ret = cz_dpm_force_lowest(adev); | 1707 | ret = cz_dpm_force_lowest(adev); |
1702 | if (ret) | 1708 | if (ret) |
1703 | return ret; | 1709 | return ret; |