Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2] drm/i915/display: Ignore disabled planes in async flip checks
       [not found] <20261115-i915-async-planes-v2-1-c5163dfea5b2@gmail.com>
@ 2026-11-16  9:22 ` Ville Syrjälä
  0 siblings, 0 replies; only message in thread
From: Ville Syrjälä @ 2026-11-16  9:22 UTC (permalink / raw)
  To: aot.lerwin
  Cc: Jani Nikula, Rodrigo Vivi, Joonas Lahtinen, Tvrtko Ursulin,
	David Airlie, Simona Vetter, intel-gfx, intel-xe, dri-devel,
	linux-kernel

On Sun, Nov 15, 2026 at 04:43:35PM +0100, Erwin Springer via B4 Relay wrote:
> From: Erwin Springer <aot.lerwin@gmail.com>
> 
> Atomic async flips may carry properties that don't change, so compositors
> tend to send their whole plane state with every commit. KWin for example
> adds all planes of the pipe, including the ones that are disabled and stay
> disabled (CRTC_ID=0, FB_ID=0).

I have slightly more universal solution to this atomic+async issue.
I just posted it and Cc:d you.

> 
> intel_async_flip_check_uapi() fails the commit as soon as the state
> contains any plane of the pipe that can't do async flips:
> 
>   [drm:intel_atomic_check [i915]] [PLANE:66:plane 2A] async flip not supported
>   [drm:drm_atomic_check_only.cold] atomic driver check for ... failed: -22
> 
> So with such a compositor tearing never works on a pipe with sprite or
> cursor planes, even though only the FB of the primary plane changes. KWin
> silently falls back to vsynced flips, about 60 rejected commits per second.
> 
> A plane without a framebuffer before and after the commit takes no part in
> the flip. Skip it in both async flip checks.
> 
> A plane that is disabled in uapi may still be used by the hardware as the
> Y plane of a planar framebuffer on another plane (planar_linked_plane on
> ICL+). Don't skip such a plane in the uapi check, so the commit is still
> rejected there as before, instead of the linked planes being pulled into
> the state later and tripping the drm_WARN_ON() in
> intel_async_flip_check_hw().
> 
> Tested on Raptor Lake-U (Iris Xe) with the patch applied to the i915 of
> Linux 7.3.4, unmodified KWin 6.8.2 and a fullscreen client that requests
> tearing through wp_tearing_control_v1. Before, none of about 350 frames per
> run was presented without vsync. With the patch 3334 of 3340 frames tear
> and the message above is gone. What is still rejected is the first flip
> after the modifier or format changed, once per run, as intended.
> 
> Signed-off-by: Erwin Springer <aot.lerwin@gmail.com>
> ---
> Changes in v2:
> - Don't skip a disabled plane that is in use as the Y plane of a planar
>   framebuffer, it would trip the drm_WARN_ON() in
>   intel_async_flip_check_hw() (found by the Sashiko review)
>   The device test was done with v1, no planar framebuffer was in use
>   there. v2 is compile-tested (W=1).
> - Link to v1: https://patch.msgid.link/20261115-i915-async-planes-v1-1-d13498d0b6be@gmail.com
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index f4d9148ef..9be7596fa 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -6281,6 +6281,16 @@ static int intel_async_flip_check_uapi(struct intel_atomic_state *state,
>  		if (plane->pipe != crtc->pipe)
>  			continue;
>  
> +		/*
> +		 * Userspace may add planes it doesn't change to the commit.
> +		 * A plane that is disabled and stays disabled takes no part
> +		 * in the async flip, unless it is in use as the Y plane of
> +		 * a planar format on another plane.
> +		 */
> +		if (!old_plane_state->uapi.fb && !new_plane_state->uapi.fb &&
> +		    !old_plane_state->planar_linked_plane)
> +			continue;
> +
>  		/*
>  		 * TODO: Async flip is only supported through the page flip IOCTL
>  		 * as of now. So support currently added for primary plane only.
> @@ -6346,6 +6356,10 @@ static int intel_async_flip_check_hw(struct intel_atomic_state *state, struct in
>  		if (plane->pipe != crtc->pipe)
>  			continue;
>  
> +		/* Disabled planes that stay disabled take no part in the flip. */
> +		if (!old_plane_state->hw.fb && !new_plane_state->hw.fb)
> +			continue;
> +
>  		/*
>  		 * Only async flip capable planes should be in the state
>  		 * if we're really about to ask the hardware to perform
> 
> ---
> base-commit: 419bb0e4cadd214a0847010c02ade95e5fc511f7
> change-id: 20261115-i915-async-planes-d532ca94cf3c
> 
> Best regards,
> --  
> Erwin Springer <aot.lerwin@gmail.com>
> 

-- 
Ville Syrjälä
Intel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-16  9:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20261115-i915-async-planes-v2-1-c5163dfea5b2@gmail.com>
2026-11-16  9:22 ` [PATCH v2] drm/i915/display: Ignore disabled planes in async flip checks Ville Syrjälä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox