Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kahola <mika.kahola@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: ville.syrjala@linux.intel.com, Mika Kahola <mika.kahola@intel.com>
Subject: [PATCH v2 1/2] drm/i915/display: Reject flipq for pipe or timing changes
Date: Wed,  2 Sep 2026 10:54:46 +0000	[thread overview]
Message-ID: <20260902105448.809455-2-mika.kahola@intel.com> (raw)
In-Reply-To: <20260902105448.809455-1-mika.kahola@intel.com>

Our flipq eligibility check let pipe, M/N and LRR changes through.
Reject those too, alongside the existing async flip/VRR/PSR/color/
modeset/fastset exclusions.

v2:
- Drop the single-plane restriction, plane count doesn't matter (Ville)
- Drop the update_wm_pre/post check, dead code for flipq-capable hw (Ville)
- Drop the active/enabled planes check (Ville)

Assisted-by: Copilot:claude-sonnet-5
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 43 ++++++++++++++++----
 1 file changed, 36 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 553c60d452dd..f4b76a9547e3 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -7369,6 +7369,41 @@ 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 *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)
+		return false;
+
+	if (new_crtc_state->do_async_flip ||
+	    new_crtc_state->vrr.enable ||
+	    new_crtc_state->has_psr)
+		return false;
+
+	/*
+	 * Flipq is only suitable for simple queued plane updates that do
+	 * not require additional pipe or timing programming.
+	 */
+	if (new_crtc_state->update_pipe ||
+	    new_crtc_state->update_m_n ||
+	    new_crtc_state->update_lrr)
+		return false;
+
+	return true;
+}
+
 static void intel_atomic_dsb_prepare(struct intel_atomic_state *state,
 				     struct intel_crtc *crtc)
 {
@@ -7384,13 +7419,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


  reply	other threads:[~2026-09-02 10:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-02 10:54 [PATCH v2 0/2] drm/i915/display: fix flipq pipe CRC mismatch in kms_cursor_crc Mika Kahola
2026-09-02 10:54 ` Mika Kahola [this message]
2026-09-02 11:07   ` [PATCH v2 1/2] drm/i915/display: Reject flipq for pipe or timing changes sashiko-bot
2026-09-02 11:55   ` [PATCH v2 1/2] drm/i915/display: Reject flipq for commits with no plane updates Mika Kahola
2026-09-02 11:59   ` [PATCH v2 1/2] drm/i915/display: Reject flipq for pipe or timing changes Jani Nikula
2026-09-02 12:24     ` Kahola, Mika
2026-09-02 12:27   ` Ville Syrjälä
2026-09-02 13:52     ` Kahola, Mika
2026-09-02 10:54 ` [PATCH v2 2/2] drm/i915/display: Reset use_flipq when duplicating crtc state Mika Kahola
2026-09-02 13:33   ` Ville Syrjälä
2026-09-02 14:08     ` Kahola, Mika
2026-09-02 11:26 ` ✓ CI.KUnit: success for drm/i915/display: fix flipq pipe CRC mismatch in kms_cursor_crc (rev2) Patchwork
2026-09-02 12:13 ` ✓ CI.KUnit: success for drm/i915/display: fix flipq pipe CRC mismatch in kms_cursor_crc (rev3) Patchwork
2026-09-02 12:19 ` ✗ Xe.CI.BAT: failure for drm/i915/display: fix flipq pipe CRC mismatch in kms_cursor_crc (rev2) Patchwork
2026-09-02 12:59 ` ✓ Xe.CI.BAT: success for drm/i915/display: fix flipq pipe CRC mismatch in kms_cursor_crc (rev3) Patchwork
2026-09-02 22:42 ` ✓ Xe.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=20260902105448.809455-2-mika.kahola@intel.com \
    --to=mika.kahola@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox