[PATCH] drm/amd: apply s0ix codepath to more cases

Mario Limonciello mario.limonciello at amd.com
Tue Jan 11 17:29:40 UTC 2022


On some OEM setups users can configure the BIOS for S3 or S2idle.
When configured to S3 users can still choose 's2idle' in the kernel
by using `/sys/power/mem_sleep`.  When configured this way, the system
will use more power but should still work for suspend and resume.

As such, remove the checks that put the GPU driver into the S3 codepaths
when the user has selected s2idle.

Reported-by: Bjoren Dasse <bjoern.daase at gmail.com>
BugLink: https://gitlab.freedesktop.org/drm/amd/-/issues/1824
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215387
Signed-off-by: Mario Limonciello <mario.limonciello at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
index 4811b0faafd9..a46bac8f79af 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -1040,11 +1040,14 @@ void amdgpu_acpi_detect(void)
  */
 bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
 {
-#if IS_ENABLED(CONFIG_AMD_PMC) && IS_ENABLED(CONFIG_SUSPEND)
-	if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) {
-		if (adev->flags & AMD_IS_APU)
-			return pm_suspend_target_state == PM_SUSPEND_TO_IDLE;
-	}
+	if (!(adev->flags & AMD_IS_APU))
+		return false;
+	if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0))
+		dev_warn_once(adev->dev,
+			      "BIOS is not configured for suspend-to-idle, power consumption will be higher\n");
+#if !IS_ENABLED(CONFIG_AMD_PMC)
+	dev_warn_once(adev->dev,
+		      "amd-pmc is not enabled in the kernel, power consumption will be higher\n");
 #endif
-	return false;
+	return pm_suspend_target_state == PM_SUSPEND_TO_IDLE;
 }
-- 
2.25.1



More information about the amd-gfx mailing list