[PATCH 1/3] drm/amd: Allow dGPUs that support BACO to use smart suspend

Quan, Evan Evan.Quan at amd.com
Wed Feb 22 01:27:14 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 1/3] drm/amd: Allow dGPUs that support BACO to use smart
> suspend
> 
> If a dGPU is already runtime suspended using BACO, there is no point
> to waking it up to run regular suspend callbacks.
Not quite sure about this.. Since the expectations for runtime suspend(over BACO) and regular suspend seem different:
- For runtime suspending over BACO, part of the chip(SMU, NBIO) is still alive.
- For regular suspend(suspend to ram), the whole chip is expected to be powered down.
That means the resuming sequences for them might be slightly different. Not sure whether that will cause some problems.

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_drv.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 1f6d93dc3d72..c3d3a042946d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -2187,8 +2187,9 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
>  		/* only need to skip on ATPX */
>  		if (amdgpu_device_supports_px(ddev))
>  			dev_pm_set_driver_flags(ddev->dev,
> DPM_FLAG_NO_DIRECT_COMPLETE);
> -		/* we want direct complete for BOCO */
> -		if (amdgpu_device_supports_boco(ddev))
> +		/* we want direct complete for BOCO and for BACO */
> +		if (amdgpu_device_supports_boco(ddev) ||
> +		    amdgpu_device_supports_baco(ddev))
>  			dev_pm_set_driver_flags(ddev->dev,
> DPM_FLAG_SMART_PREPARE |
> 
> 	DPM_FLAG_SMART_SUSPEND |
> 
> 	DPM_FLAG_MAY_SKIP_RESUME);
> @@ -2389,7 +2390,8 @@ static int amdgpu_pmops_prepare(struct device
> *dev)
>  	/* Return a positive number here so
>  	 * DPM_FLAG_SMART_SUSPEND works properly
>  	 */
> -	if (amdgpu_device_supports_boco(drm_dev))
> +	if (amdgpu_device_supports_boco(drm_dev) ||
> +	    amdgpu_device_supports_baco(drm_dev))
>  		return pm_runtime_suspended(dev);
> 
>  	/* if we will not support s3 or s2i for the device
> --
> 2.34.1


More information about the amd-gfx mailing list