[PATCH] drm/amdgpu: Check pmops for desired suspend state

Lazar, Lijo lijo.lazar at amd.com
Fri Jul 23 04:10:18 UTC 2021



On 7/22/2021 10:57 AM, Pratik Vishwakarma wrote:
> [Why]
> User might set mem_sleep as deep and it will result
> in amdgpu resume errors.
> 
> [How]
> Check with pm for default suspend state
> 
> Signed-off-by: Pratik Vishwakarma <Pratik.Vishwakarma at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index af1710971ff3..d92196429741 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -1468,7 +1468,8 @@ static int amdgpu_pmops_suspend(struct device *dev)
>   	struct amdgpu_device *adev = drm_to_adev(drm_dev);
>   	int r;
>   
> -	if (amdgpu_acpi_is_s0ix_supported(adev))
> +	if (amdgpu_acpi_is_s0ix_supported(adev)
> +		&& pm_suspend_default_s2idle())

A better way would be to use the exported pm_suspend_target_state - 
(pm_suspend_target_state == PM_SUSPEND_TO_IDLE)

Thanks,
Lijo

>   		adev->in_s0ix = true;
>   	adev->in_s3 = true;
>   	r = amdgpu_device_suspend(drm_dev, true);
> 


More information about the amd-gfx mailing list