<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#008000;margin:15pt;" align="Left">
[Public]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Series is:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Mario Limonciello <mario.limonciello@amd.com><br>
<b>Sent:</b> Wednesday, January 26, 2022 5:58 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Liang, Prike <Prike.Liang@amd.com>; Limonciello, Mario <Mario.Limonciello@amd.com><br>
<b>Subject:</b> [PATCH v6 4/4] drm/amd: Only run s3 or s0ix if system is configured properly</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">This will cause misconfigured systems to not run the GPU suspend<br>
routines.<br>
<br>
* In APUs that are properly configured system will go into s2idle.<br>
* In APUs that are intended to be S3 but user selects<br>
s2idle the GPU will stay fully powered for the suspend.<br>
* In APUs that are intended to be s2idle and system misconfigured<br>
the GPU will stay fully powered for the suspend.<br>
* In systems that are intended to be s2idle, but AMD dGPU is also<br>
present, the dGPU will go through S3<br>
<br>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com><br>
---<br>
v5->v6:<br>
* Move code into prepare vfunc and use DPM_FLAG_SMART_SUSPEND to skip<br>
suspend code in incorrectly configured systems.<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 8 ++++++++<br>
1 file changed, 8 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
index 922accdd4246..3e581f35f19d 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c<br>
@@ -2289,6 +2289,7 @@ static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work)<br>
static int amdgpu_pmops_prepare(struct device *dev)<br>
{<br>
struct drm_device *drm_dev = dev_get_drvdata(dev);<br>
+ struct amdgpu_device *adev = drm_to_adev(drm_dev);<br>
<br>
/* Return a positive number here so<br>
* DPM_FLAG_SMART_SUSPEND works properly<br>
@@ -2296,6 +2297,13 @@ static int amdgpu_pmops_prepare(struct device *dev)<br>
if (amdgpu_device_supports_boco(drm_dev))<br>
return pm_runtime_suspended(dev);<br>
<br>
+ /* if we will not support s3 or s2i for the device<br>
+ * then skip suspend<br>
+ */<br>
+ if (!amdgpu_acpi_is_s0ix_active(adev) &&<br>
+ !amdgpu_acpi_is_s3_active(adev))<br>
+ return 1;<br>
+<br>
return 0;<br>
}<br>
<br>
-- <br>
2.25.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>