summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/soc21.c
diff options
context:
space:
mode:
authorLikun Gao <Likun.Gao@amd.com>2022-05-06 21:53:31 +0300
committerAlex Deucher <alexander.deucher@amd.com>2022-05-11 00:53:12 +0300
commit41967850e4f0720f0b472beb84b908957cbc1ebe (patch)
treeb9171b1da6a55ed5e8500d189803e30d5e331b2e /drivers/gpu/drm/amd/amdgpu/soc21.c
parent74c9b2e704c99d09e3b7e6928df9d8d5891b5174 (diff)
downloadlinux-41967850e4f0720f0b472beb84b908957cbc1ebe.tar.xz
drm/amdgpu: support memory power gating for lsdma
Support memory power gating control for LSDMA. Signed-off-by: Likun Gao <Likun.Gao@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/soc21.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/soc21.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/soc21.c b/drivers/gpu/drm/amd/amdgpu/soc21.c
index 741ed3ba84d6..3303e02f85d1 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc21.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc21.c
@@ -676,7 +676,17 @@ static int soc21_common_set_clockgating_state(void *handle,
static int soc21_common_set_powergating_state(void *handle,
enum amd_powergating_state state)
{
- /* TODO */
+ struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+
+ switch (adev->ip_versions[LSDMA_HWIP][0]) {
+ case IP_VERSION(6, 0, 0):
+ adev->lsdma.funcs->update_memory_power_gating(adev,
+ state == AMD_PG_STATE_GATE);
+ break;
+ default:
+ break;
+ }
+
return 0;
}