[PATCH 3/3] drm/amd: Don't always set s3 for dGPUs in all sleep modes

Quan, Evan Evan.Quan at amd.com
Wed Feb 22 01:15:07 UTC 2023


[AMD Official Use Only - General]



> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of
> Mario Limonciello
> Sent: Tuesday, February 21, 2023 4:16 AM
> To: amd-gfx at lists.freedesktop.org
> Cc: Peter Kopec <pekopec at redhat.com>; Limonciello, Mario
> <Mario.Limonciello at amd.com>
> Subject: [PATCH 3/3] drm/amd: Don't always set s3 for dGPUs in all sleep
> modes
> 
> dGPUs that will be using BACO or BOCO shouldn't be put into S3
> when the system is being put into s2idle.
Will this break regular suspend to ram scenario? I mean
- For s2idle scenario, amdgpu_pmops_prepare will be called. And for this scenario, it is expected dgpu using BACO or BOCO to be not put into S3. Right?
- For regular s2ram scenario, amdgpu_pmops_prepare will also get called. Then dgpu using BACO or BOCO will be not put into S3 either?

BR
Evan
> 
> Cc: Peter Kopec <pekopec at redhat.com>
> Signed-off-by: Mario Limonciello <mario.limonciello at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> index 25e902077caf..5c69116bc883 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> @@ -1038,8 +1038,13 @@ void amdgpu_acpi_detect(void)
>   */
>  bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev)
>  {
> -	return !(adev->flags & AMD_IS_APU) ||
> -		(pm_suspend_target_state == PM_SUSPEND_MEM);
> +	if (pm_suspend_target_state == PM_SUSPEND_MEM)
> +		return true;
> +	if (adev->flags & AMD_IS_APU)
> +		return false;
> +	return !amdgpu_device_supports_baco(&adev->ddev) &&
> +		!amdgpu_device_supports_boco(&adev->ddev);
> +
>  }
> 
>  /**
> --
> 2.34.1


More information about the amd-gfx mailing list