diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2018-07-19 13:49:07 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-08-27 11:09:41 -0500 |
commit | 982976d92f17aa8ff5d7a4d09fab4608795d12f3 (patch) | |
tree | f4c06c991cab7830dcd95377b0c7bc51e3e0af84 /drivers/gpu/drm/amd/powerplay/amd_powerplay.c | |
parent | 9650205a32e7f69c9846a205351e307ea525c1e7 (diff) |
drm/amd/pp: Add ACP PG support in SMU
when ACP block not enabled, we power off
acp block to save power.
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/amd_powerplay.c')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c index 7a646f94b478..da4ebff5b74d 100644 --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c @@ -1181,6 +1181,21 @@ static int pp_dpm_powergate_gfx(void *handle, bool gate) return hwmgr->hwmgr_func->powergate_gfx(hwmgr, gate); } +static void pp_dpm_powergate_acp(void *handle, bool gate) +{ + struct pp_hwmgr *hwmgr = handle; + + if (!hwmgr || !hwmgr->pm_en) + return; + + if (hwmgr->hwmgr_func->powergate_acp == NULL) { + pr_info("%s was not implemented.\n", __func__); + return; + } + + hwmgr->hwmgr_func->powergate_acp(hwmgr, gate); +} + static int pp_set_powergating_by_smu(void *handle, uint32_t block_type, bool gate) { @@ -1200,6 +1215,9 @@ static int pp_set_powergating_by_smu(void *handle, case AMD_IP_BLOCK_TYPE_GFX: ret = pp_dpm_powergate_gfx(handle, gate); break; + case AMD_IP_BLOCK_TYPE_ACP: + pp_dpm_powergate_acp(handle, gate); + break; default: break; } |