diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2018-02-22 20:46:49 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-02-26 23:09:41 -0500 |
commit | cd277585d69394507137b513b51f40d2590abda4 (patch) | |
tree | 6ffdced91fdc56a872043cf4852653d1ef83b224 /drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | |
parent | e21148ecbac33b854156a2741d35c33892c2ac34 (diff) | |
download | op-kernel-dev-cd277585d69394507137b513b51f40d2590abda4.zip op-kernel-dev-cd277585d69394507137b513b51f40d2590abda4.tar.gz |
drm/amd/pp: Move common dpm check functions to hardwaremanager.c
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c index fdd2c05..33480de 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c @@ -79,6 +79,11 @@ int phm_enable_dynamic_state_management(struct pp_hwmgr *hwmgr) bool enabled; PHM_FUNC_CHECK(hwmgr); + if (smum_is_dpm_running(hwmgr)) { + pr_info("dpm has been enabled\n"); + return 0; + } + if (NULL != hwmgr->hwmgr_func->dynamic_state_management_enable) ret = hwmgr->hwmgr_func->dynamic_state_management_enable(hwmgr); @@ -96,6 +101,11 @@ int phm_disable_dynamic_state_management(struct pp_hwmgr *hwmgr) PHM_FUNC_CHECK(hwmgr); + if (!smum_is_dpm_running(hwmgr)) { + pr_info("dpm has been disabled\n"); + return 0; + } + if (hwmgr->hwmgr_func->dynamic_state_management_disable) ret = hwmgr->hwmgr_func->dynamic_state_management_disable(hwmgr); |