]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/amdgpu: enable gfxoff on gc 12.0.1
authorKenneth Feng <kenneth.feng@amd.com>
Mon, 11 Mar 2024 06:11:39 +0000 (14:11 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 2 May 2024 20:18:15 +0000 (16:18 -0400)
Enable gfxoff on gc 12.0.1

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Jack Gui <Jack.Gui@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c

index 3c555f78d4da37bd61bd7c8e0eb77355fcbe0ce0..b53ca25012e6a9e555735daf0b3e7163efb4b8b4 100644 (file)
@@ -3606,7 +3606,19 @@ static void gfx_v12_cntl_pg(struct amdgpu_device *adev, bool enable)
 static int gfx_v12_0_set_powergating_state(void *handle,
                                           enum amd_powergating_state state)
 {
-       /* TODO */
+       struct amdgpu_device *adev = (struct amdgpu_device *)handle;
+       bool enable = (state == AMD_PG_STATE_GATE);
+
+       if (amdgpu_sriov_vf(adev))
+               return 0;
+
+       switch (amdgpu_ip_version(adev, GC_HWIP, 0)) {
+       case IP_VERSION(12, 0, 1):
+               amdgpu_gfx_off_ctrl(adev, enable);
+               break;
+       default:
+               break;
+       }
 
        return 0;
 }
index 68b9bf822e8d88e8cc839f0f4ac065939ffac140..fe6834f1648b99245eab02b9b44e03db250d0b72 100644 (file)
@@ -758,6 +758,7 @@ int smu_v14_0_gfx_off_control(struct smu_context *smu, bool enable)
        case IP_VERSION(14, 0, 0):
        case IP_VERSION(14, 0, 1):
        case IP_VERSION(14, 0, 2):
+       case IP_VERSION(14, 0, 3):
                if (!(adev->pm.pp_feature & PP_GFXOFF_MASK))
                        return 0;
                if (enable)