diff options
author | Mario Limonciello <mario.limonciello@amd.com> | 2022-01-26 06:35:09 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-02-23 14:03:07 +0300 |
commit | 72808bb42c87c4887c553ea8d9f4ecaf15d867d3 (patch) | |
tree | 8e38220584a4dd7705b818c65b6c1f2378d7464f /drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | |
parent | 0ceba4d64feec0c05dc5fbd549a703e25035d7d1 (diff) | |
download | linux-72808bb42c87c4887c553ea8d9f4ecaf15d867d3.tar.xz |
drm/amd: add support to check whether the system is set to s3
[ Upstream commit f52a2b8badbd24faf73a13c9c07fdb9d07352944 ]
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 <mario.limonciello@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c index b19d40751802..0e12315fa0cb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c @@ -1033,6 +1033,19 @@ void amdgpu_acpi_detect(void) #if IS_ENABLED(CONFIG_SUSPEND) /** + * amdgpu_acpi_is_s3_active + * + * @adev: amdgpu_device_pointer + * + * returns true if supported, false if not. + */ +bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) +{ + return !(adev->flags & AMD_IS_APU) || + (pm_suspend_target_state == PM_SUSPEND_MEM); +} + +/** * amdgpu_acpi_is_s0ix_active * * @adev: amdgpu_device_pointer |