From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: aot.lerwin@gmail.com
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>,
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
Tvrtko Ursulin <tursulin@ursulin.net>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] drm/i915/display: Ignore disabled planes in async flip checks
Date: Mon, 16 Nov 2026 11:22:32 +0200 [thread overview]
Message-ID: <avrLWCctBVWAjOo4@intel.com> (raw)
In-Reply-To: <20261115-i915-async-planes-v2-1-c5163dfea5b2@gmail.com>
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
prev parent reply other threads:[~2026-11-16 9:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-15 15:43 Erwin Springer via B4 Relay
2026-11-16 9:22 ` Ville Syrjälä [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=avrLWCctBVWAjOo4@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=airlied@gmail.com \
--cc=aot.lerwin@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rodrigo.vivi@intel.com \
--cc=simona@ffwll.ch \
--cc=tursulin@ursulin.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®