Skip to content

Commit f52a2b8

Browse files
superm1alexdeucher
authored andcommitted
drm/amd: add support to check whether the system is set to s3
This will be used to help make decisions on what to do in misconfigured systems. v2: squash in semicolon fix from Stephen Rothwell Signed-off-by: Mario Limonciello <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent a6ed203 commit f52a2b8

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,9 +1421,11 @@ static inline int amdgpu_acpi_smart_shift_update(struct drm_device *dev,
14211421
#endif
14221422

14231423
#if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND)
1424+
bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev);
14241425
bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev);
14251426
#else
14261427
static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; }
1428+
static inline bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) { return false; }
14271429
#endif
14281430

14291431
int amdgpu_cs_find_mapping(struct amdgpu_cs_parser *parser,

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,19 @@ void amdgpu_acpi_detect(void)
10321032
}
10331033

10341034
#if IS_ENABLED(CONFIG_SUSPEND)
1035+
/**
1036+
* amdgpu_acpi_is_s3_active
1037+
*
1038+
* @adev: amdgpu_device_pointer
1039+
*
1040+
* returns true if supported, false if not.
1041+
*/
1042+
bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev)
1043+
{
1044+
return !(adev->flags & AMD_IS_APU) ||
1045+
(pm_suspend_target_state == PM_SUSPEND_MEM);
1046+
}
1047+
10351048
/**
10361049
* amdgpu_acpi_is_s0ix_active
10371050
*

0 commit comments

Comments
 (0)