[PATCH v3] drm/amdgpu: complete gfxoff allow signal during suspend without delay

Quan, Evan Evan.Quan at amd.com
Mon Nov 7 08:52:24 UTC 2022


[AMD Official Use Only - General]

Reviewed-by: Evan Quan <evan.quan at amd.com>

> -----Original Message-----
> From: Jain, Harsh <Harsh.Jain at amd.com>
> Sent: Monday, November 7, 2022 4:43 PM
> To: Deucher, Alexander <Alexander.Deucher at amd.com>; Quan, Evan
> <Evan.Quan at amd.com>
> Cc: amd-gfx at lists.freedesktop.org; Jain, Harsh <Harsh.Jain at amd.com>
> Subject: [PATCH v3] drm/amdgpu: complete gfxoff allow signal during
> suspend without delay
> 
> change guarantees that gfxoff is allowed before moving further in
> s2idle sequence to add more reliablity about gfxoff in amdgpu IP's
> suspend flow
> 
> Signed-off-by: Harsh Jain <harsh.jain at amd.com>
> 
> ---
> 
> v2: replaced flush_work with direct call to
> amdgpu_dpm_set_powergating_by_smu
> and edited title
> v3: added braces for readbility
> ---
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> index 9546adc8a76f..23692e5d4d13 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
> @@ -583,10 +583,14 @@ void amdgpu_gfx_off_ctrl(struct amdgpu_device
> *adev, bool enable)
>  		if (adev->gfx.gfx_off_req_count == 0 &&
>  		    !adev->gfx.gfx_off_state) {
>  			/* If going to s2idle, no need to wait */
> -			if (adev->in_s0ix)
> -				delay = GFX_OFF_NO_DELAY;
> -			schedule_delayed_work(&adev-
> >gfx.gfx_off_delay_work,
> +			if (adev->in_s0ix) {
> +				if
> (!amdgpu_dpm_set_powergating_by_smu(adev,
> +						AMD_IP_BLOCK_TYPE_GFX,
> true))
> +					adev->gfx.gfx_off_state = true;
> +			} else {
> +				schedule_delayed_work(&adev-
> >gfx.gfx_off_delay_work,
>  					      delay);
> +			}
>  		}
>  	} else {
>  		if (adev->gfx.gfx_off_req_count == 0) {
> --
> 2.25.1


More information about the amd-gfx mailing list