summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
diff options
context:
space:
mode:
authorEvan Quan <evan.quan@amd.com>2020-01-03 14:18:22 +0800
committerAlex Deucher <alexander.deucher@amd.com>2020-01-07 12:01:40 -0500
commit29a45960647b243af5f2aa73fd7a822ef3db33eb (patch)
tree148e5a7cdc653661d0b5f1bd4575501c62ed58ea /drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
parentce0d0ec3390c5cf997e4ca43bd2047fa41e77bf1 (diff)
downloadlinux-29a45960647b243af5f2aa73fd7a822ef3db33eb.tar.gz
linux-29a45960647b243af5f2aa73fd7a822ef3db33eb.tar.bz2
linux-29a45960647b243af5f2aa73fd7a822ef3db33eb.zip
drm/amd/powerplay: refine code to support no-dpm case
With "dpm=0", there will be no DPM enabled. The code needs to be refined to support this. Signed-off-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/amdgpu_smu.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/amdgpu_smu.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
index b13e3af79587..9320cf3ef036 100644
--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
@@ -1363,6 +1363,9 @@ static int smu_hw_fini(void *handle)
smu_powergate_jpeg(&adev->smu, true);
}
+ if (!smu->pm_enabled)
+ return 0;
+
if (!amdgpu_sriov_vf(adev)){
ret = smu_stop_thermal_control(smu);
if (ret) {
@@ -1435,6 +1438,9 @@ static int smu_suspend(void *handle)
struct smu_context *smu = &adev->smu;
bool baco_feature_is_enabled = false;
+ if (!smu->pm_enabled)
+ return 0;
+
if(!smu->is_apu)
baco_feature_is_enabled = smu_feature_is_enabled(smu, SMU_FEATURE_BACO_BIT);