All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Mika Kahola <mika.kahola@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/i915/display: Restrict flipq to simple single-plane updates
Date: Fri, 28 Aug 2026 21:38:06 +0300	[thread overview]
Message-ID: <apHVjiELFEoIfBM4@intel.com> (raw)
In-Reply-To: <20260807121540.2032283-3-mika.kahola@intel.com>

On Fri, Aug 07, 2026 at 12:15:39PM +0000, Mika Kahola wrote:
> Our flipq eligibility check is too loose: it still lets through
> commits that change the active/enabled plane mask, or need extra
> pipe/M-N/LRR/watermark programming. Those aren't simple queued plane
> updates and have no business going through flipq.
> 
> Found this chasing a CRC mismatch in kms_cursor_crc's
> cursor-alpha-opaque: a plane enable/disable commit slipped through
> flipq ahead of the plane-content commit the CRC actually checks.
> 
> Reject flipq for anything touching more than one plane, changing the
> active/enabled plane masks, or needing async flip, VRR, PSR, color,
> pipe, M/N, LRR or watermark updates. More conservative than strictly
> necessary in some cases, but better safe than racy.
> 
> Assisted-by: Copilot:claude-sonnet-5
> Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c | 53 +++++++++++++++++---
>  1 file changed, 46 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 5cdaa59f005e..2483c031631c 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -7323,6 +7323,51 @@ static void intel_atomic_prepare_plane_clear_colors(struct intel_atomic_state *s
>  	}
>  }
>  
> +static bool intel_flipq_commit_is_eligible(struct intel_atomic_state *state,
> +					   struct intel_crtc *crtc)
> +{
> +	struct intel_display *display = to_intel_display(state);
> +	const struct intel_crtc_state *old_crtc_state =
> +		intel_atomic_get_old_crtc_state(state, crtc);
> +	const struct intel_crtc_state *new_crtc_state =
> +		intel_atomic_get_new_crtc_state(state, crtc);
> +
> +	if (!intel_flipq_supported(display))
> +		return false;
> +
> +	if (intel_crtc_needs_modeset(new_crtc_state) ||
> +	    intel_crtc_needs_fastset(new_crtc_state) ||
> +	    intel_crtc_needs_color_update(new_crtc_state))
> +		return false;
> +
> +	if (!new_crtc_state->update_planes ||
> +	    !is_power_of_2(new_crtc_state->update_planes))
> +		return false;

The number of planes being updated doesn't matter.

> +
> +	if (new_crtc_state->do_async_flip ||
> +	    new_crtc_state->vrr.enable ||
> +	    new_crtc_state->has_psr)
> +		return false;
> +
> +	if (old_crtc_state->active_planes != new_crtc_state->active_planes ||
> +	    old_crtc_state->enabled_planes != new_crtc_state->enabled_planes)
> +		return false;

Enabling/disabling planes is perfectly fine.

> +
> +	/*
> +	 * Flipq is only suitable for simple queued single-plane updates
> +	 * that do not change plane topology and do not require additional
> +	 * pipe/timing/watermark programming.
> +	 */
> +	if (new_crtc_state->update_pipe ||
> +	    new_crtc_state->update_m_n ||
> +	    new_crtc_state->update_lrr ||
> +	    new_crtc_state->update_wm_pre ||
> +	    new_crtc_state->update_wm_post)

Those update_wm_* flags are just hacks for ancient platforms.
Not relevant here.

> +		return false;
> +
> +	return true;
> +}
> +
>  static void intel_atomic_dsb_prepare(struct intel_atomic_state *state,
>  				     struct intel_crtc *crtc)
>  {
> @@ -7338,13 +7383,7 @@ static void intel_atomic_dsb_prepare(struct intel_atomic_state *state,
>  
>  	/* FIXME deal with everything */
>  	new_crtc_state->use_flipq =
> -		intel_flipq_supported(display) &&
> -		!new_crtc_state->do_async_flip &&
> -		!new_crtc_state->vrr.enable &&
> -		!new_crtc_state->has_psr &&
> -		!intel_crtc_needs_modeset(new_crtc_state) &&
> -		!intel_crtc_needs_fastset(new_crtc_state) &&
> -		!intel_crtc_needs_color_update(new_crtc_state);
> +		intel_flipq_commit_is_eligible(state, crtc);
>  
>  	new_crtc_state->use_dsb =
>  		!new_crtc_state->use_flipq &&
> -- 
> 2.43.0

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2026-08-28 18:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07 12:15 [PATCH 0/3] drm/i915/display: fix flipq pipe CRC mismatch in kms_cursor_crc Mika Kahola
2026-08-07 12:15 ` [PATCH 1/3] drm/i915/display: Flush frontbuffer tracking on flipq completion Mika Kahola
2026-08-28 18:37   ` Ville Syrjälä
2026-09-01 11:31     ` Kahola, Mika
2026-09-02 11:58       ` Ville Syrjälä
2026-08-07 12:15 ` [PATCH 2/3] drm/i915/display: Restrict flipq to simple single-plane updates Mika Kahola
2026-08-28 18:38   ` Ville Syrjälä [this message]
2026-09-01 11:34     ` Kahola, Mika
2026-08-07 12:15 ` [PATCH 3/3] drm/i915/display: Reset use_flipq when duplicating crtc state Mika Kahola
2026-08-07 12:23 ` ✓ CI.KUnit: success for drm/i915/display: fix flipq pipe CRC mismatch in kms_cursor_crc Patchwork
2026-08-07 13:16 ` ✓ Xe.CI.BAT: " Patchwork
2026-08-07 21:57 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-08-07 22:22 ` ✓ i915.CI.BAT: success " Patchwork
2026-08-08  1:08 ` ✓ i915.CI.Full: " Patchwork

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=apHVjiELFEoIfBM4@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=mika.kahola@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.