aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/amd_powerplay.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/amd_powerplay.c
parentdrm/amd/powerplay: unified VRAM address for driver table interaction with SMU V2 (diff)
downloadlinux-dev-29a45960647b243af5f2aa73fd7a822ef3db33eb.tar.xz
linux-dev-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/amd_powerplay.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/amd_powerplay.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
index 7293763d524c..c195575366a3 100644
--- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
+++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c
@@ -927,9 +927,12 @@ static int pp_dpm_set_mp1_state(void *handle, enum pp_mp1_state mp1_state)
{
struct pp_hwmgr *hwmgr = handle;
- if (!hwmgr || !hwmgr->pm_en)
+ if (!hwmgr)
return -EINVAL;
+ if (!hwmgr->pm_en)
+ return 0;
+
if (hwmgr->hwmgr_func->set_mp1_state)
return hwmgr->hwmgr_func->set_mp1_state(hwmgr, mp1_state);