summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2018-07-29 18:53:02 +0800
committerAlex Deucher <alexander.deucher@amd.com>2018-08-27 11:09:44 -0500
commitc36628d8989a7a0d1cc4fe2ae93c6cd99a865f68 (patch)
tree944e35b35c93ce629909bbcb5f7c6ae921422a5e
parent3a54d2c8951113171655425bd173f43bbcb531c5 (diff)
downloadlinux-c36628d8989a7a0d1cc4fe2ae93c6cd99a865f68.tar.gz
linux-c36628d8989a7a0d1cc4fe2ae93c6cd99a865f68.tar.bz2
linux-c36628d8989a7a0d1cc4fe2ae93c6cd99a865f68.zip
drm/amgpu/acp: Implement set_powergating_state for acp
so driver can powergate acp block after asic initialized 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>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
index b5b66c3d1b43..297a5490ad8c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
@@ -514,6 +514,12 @@ static int acp_set_clockgating_state(void *handle,
static int acp_set_powergating_state(void *handle,
enum amd_powergating_state state)
{
+ struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+ bool enable = state == AMD_PG_STATE_GATE ? true : false;
+
+ if (adev->powerplay.pp_funcs->set_powergating_by_smu)
+ amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, enable);
+
return 0;
}