drm/amgpu/acp: Implement set_powergating_state for acp
authorRex Zhu <Rex.Zhu@amd.com>
Sun, 29 Jul 2018 10:53:02 +0000 (18:53 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 27 Aug 2018 16:09:44 +0000 (11:09 -0500)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c

index b5b66c3d1b434c7504e090571f7466cc84755fdb..297a5490ad8c0be64157364419ca6e2f5b1eab1a 100644 (file)
@@ -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;
 }