Skip to content

Commit 91e2737

Browse files
Pratik Vishwakarmaalexdeucher
authored andcommitted
drm/amdgpu: Check pmops for desired suspend state
[Why] User might change the suspend behaviour from OS. [How] Check with pm for target suspend state and set s0ix flag only for s2idle state. v2: User might change default suspend state, use target state v3: squash in build fix Suggested-by: Lijo Lazar <[email protected]> Signed-off-by: Pratik Vishwakarma <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
1 parent 6aade58 commit 91e2737

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <linux/slab.h>
2727
#include <linux/power_supply.h>
2828
#include <linux/pm_runtime.h>
29+
#include <linux/suspend.h>
2930
#include <acpi/video.h>
3031
#include <acpi/actbl.h>
3132

@@ -1042,7 +1043,7 @@ bool amdgpu_acpi_is_s0ix_supported(struct amdgpu_device *adev)
10421043
#if defined(CONFIG_AMD_PMC) || defined(CONFIG_AMD_PMC_MODULE)
10431044
if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) {
10441045
if (adev->flags & AMD_IS_APU)
1045-
return true;
1046+
return pm_suspend_target_state == PM_SUSPEND_TO_IDLE;
10461047
}
10471048
#endif
10481049
return false;

0 commit comments

Comments
 (0)