Skip to content

Commit 04ef860

Browse files
superm1alexdeucher
authored andcommitted
drm/amd: Only run s3 or s0ix if system is configured properly
This will cause misconfigured systems to not run the GPU suspend routines. * In APUs that are properly configured system will go into s2idle. * In APUs that are intended to be S3 but user selects s2idle the GPU will stay fully powered for the suspend. * In APUs that are intended to be s2idle and system misconfigured the GPU will stay fully powered for the suspend. * In systems that are intended to be s2idle, but AMD dGPU is also present, the dGPU will go through S3 Signed-off-by: Mario Limonciello <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent f52a2b8 commit 04ef860

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2246,6 +2246,7 @@ static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work)
22462246
static int amdgpu_pmops_prepare(struct device *dev)
22472247
{
22482248
struct drm_device *drm_dev = dev_get_drvdata(dev);
2249+
struct amdgpu_device *adev = drm_to_adev(drm_dev);
22492250

22502251
/* Return a positive number here so
22512252
* DPM_FLAG_SMART_SUSPEND works properly
@@ -2254,6 +2255,13 @@ static int amdgpu_pmops_prepare(struct device *dev)
22542255
return pm_runtime_suspended(dev) &&
22552256
pm_suspend_via_firmware();
22562257

2258+
/* if we will not support s3 or s2i for the device
2259+
* then skip suspend
2260+
*/
2261+
if (!amdgpu_acpi_is_s0ix_active(adev) &&
2262+
!amdgpu_acpi_is_s3_active(adev))
2263+
return 1;
2264+
22572265
return 0;
22582266
}
22592267

0 commit comments

Comments
 (0)