Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: [PATCH v2 07/13] drm/i915: Extract intel_dsb_supported()
Date: Wed,  9 Sep 2026 19:17:24 +0300	[thread overview]
Message-ID: <20260909161730.12969-8-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20260909161730.12969-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Extract the "do we have a DSB and should be use it?" check
into a helper. This mirrors intel_flipq_supported() and should
help unify the logic around selecting the codepath which will
be used to perform the commit (mmio vs. DSB. vs. flip queue).

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_dsb.c | 13 +++++++++----
 drivers/gpu/drm/i915/display/intel_dsb.h |  1 +
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c b/drivers/gpu/drm/i915/display/intel_dsb.c
index d9a270362a82..8e01e1eed291 100644
--- a/drivers/gpu/drm/i915/display/intel_dsb.c
+++ b/drivers/gpu/drm/i915/display/intel_dsb.c
@@ -1025,6 +1025,14 @@ void intel_dsb_wait(struct intel_dsb *dsb)
 			  dsb_error_int_status(display) | DSB_PROG_INT_STATUS);
 }
 
+bool intel_dsb_supported(struct intel_display *display)
+{
+	if (!display->params.enable_dsb)
+		return false;
+
+	return HAS_DSB(display);
+}
+
 /**
  * intel_dsb_prepare() - Allocate, pin and map the DSB command buffer.
  * @state: the atomic state
@@ -1049,10 +1057,7 @@ struct intel_dsb *intel_dsb_prepare(struct intel_atomic_state *state,
 	struct intel_dsb *dsb;
 	unsigned int size;
 
-	if (!HAS_DSB(display))
-		return NULL;
-
-	if (!display->params.enable_dsb)
+	if (!intel_dsb_supported(display))
 		return NULL;
 
 	dsb = kzalloc_obj(*dsb);
diff --git a/drivers/gpu/drm/i915/display/intel_dsb.h b/drivers/gpu/drm/i915/display/intel_dsb.h
index 3dcca9ed5371..87d9c90da08f 100644
--- a/drivers/gpu/drm/i915/display/intel_dsb.h
+++ b/drivers/gpu/drm/i915/display/intel_dsb.h
@@ -26,6 +26,7 @@ enum intel_dsb_id {
 	I915_MAX_DSBS,
 };
 
+bool intel_dsb_supported(struct intel_display *display);
 unsigned int intel_dsb_size(struct intel_dsb *dsb);
 unsigned int intel_dsb_head(struct intel_dsb *dsb);
 struct intel_dsb *intel_dsb_prepare(struct intel_atomic_state *state,
-- 
2.54.0


  parent reply	other threads:[~2026-09-09 16:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09 16:17 [PATCH v2 00/13] drm/i915: Some DSB/flipq stuff Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 01/13] drm/i915: Give up on DSB/flip queue if we fail to allocate the color DSB buffer Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 02/13] drm/i915: Check use_flipq in intel_crtc_needs_vblank_work() Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 03/13] drm/i915: Don't initialize flip queue on pre-LNL Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 04/13] drm/i915: Warn about use_flip==true in MMIO commit codepaths Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 05/13] drm/i915: Refine vblank evasion DSB check Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 06/13] drm/i915: Make intel_crtc_needs_vblank_work() easier on the eye Ville Syrjala
2026-09-09 16:17 ` Ville Syrjala [this message]
2026-09-09 16:17 ` [PATCH v2 08/13] drm/i915: Use intel_dsb_supported() to determine 'use_dsb' Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 09/13] drm/i915: Extract commit_dsb_max_cmds() Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 10/13] drm/i915: Introduce enum intel_commit_type Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 11/13] drm/i915: Carve intel_atomic_commit_type() up a bit Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 12/13] drm/i915/dsb: Add tracepoints for DSB commit Ville Syrjala
2026-09-09 16:34   ` sashiko-bot
2026-09-10 11:23     ` Ville Syrjälä
2026-09-09 16:17 ` [PATCH v2 13/13] drm/i915/dsb: Add tracepoints for flip queue Ville Syrjala
2026-09-09 17:50 ` ✓ i915.CI.BAT: success for drm/i915: Some DSB/flipq stuff (rev2) Patchwork
2026-09-10 10:56 ` ✗ i915.CI.Full: failure " 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=20260909161730.12969-8-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    /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