[PATCH 2/6] drm/i915: Reject async flips if we need to change DDB/watermarks

Murthy, Arun R arun.r.murthy at intel.com
Fri Apr 19 04:27:53 UTC 2024


> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces at lists.freedesktop.org> On Behalf Of Ville
> Syrjala
> Sent: Wednesday, March 20, 2024 9:34 PM
> To: intel-gfx at lists.freedesktop.org
> Subject: [PATCH 2/6] drm/i915: Reject async flips if we need to change
> DDB/watermarks
> 
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> DDB/watermarks are always double buffered on the vblank, so we can't safely
> change them during async flips. Currently this never happens, but we'll be
> making changing between sync and async flips a bit more flexible, in which case
> we can actually end up here.

Rather on getting wm/DDB changes should we switch from async to sync flip to honour the wm/DDB changes else might end up in underrun or flicker/corruption.
Spec is also aligned to this approach.

Thanks and Regards,
Arun R Murthy
--------------------

> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/skl_watermark.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c
> b/drivers/gpu/drm/i915/display/skl_watermark.c
> index bc341abcab2f..1fa416a70d51 100644
> --- a/drivers/gpu/drm/i915/display/skl_watermark.c
> +++ b/drivers/gpu/drm/i915/display/skl_watermark.c
> @@ -2540,6 +2540,12 @@ skl_ddb_add_affected_planes(const struct
> intel_crtc_state *old_crtc_state,
>  					&new_crtc_state-
> >wm.skl.plane_ddb_y[plane_id]))
>  			continue;
> 
> +		if (new_crtc_state->do_async_flip) {
> +			drm_dbg_kms(&i915->drm, "[PLANE:%d:%s] Can't
> change DDB during async flip\n",
> +				    plane->base.base.id, plane->base.name);
> +			return -EINVAL;
> +		}
> +
>  		plane_state = intel_atomic_get_plane_state(state, plane);
>  		if (IS_ERR(plane_state))
>  			return PTR_ERR(plane_state);
> @@ -2906,6 +2912,12 @@ static int skl_wm_add_affected_planes(struct
> intel_atomic_state *state,
>  						 &new_crtc_state-
> >wm.skl.optimal))
>  			continue;
> 
> +		if (new_crtc_state->do_async_flip) {
> +			drm_dbg_kms(&i915->drm, "[PLANE:%d:%s] Can't
> change watermarks during async flip\n",
> +				    plane->base.base.id, plane->base.name);
> +			return -EINVAL;
> +		}
> +
>  		plane_state = intel_atomic_get_plane_state(state, plane);
>  		if (IS_ERR(plane_state))
>  			return PTR_ERR(plane_state);
> --
> 2.43.2



More information about the Intel-gfx mailing list