From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: [PATCH 08/11] drm/i915: Extract intel_plane_needs_fence()
Date: Thu, 16 Apr 2026 20:44:44 +0300 [thread overview]
Message-ID: <20260416174448.28264-9-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20260416174448.28264-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Extract the naked DISPLA_VER<4 checks into a descriptive little
helper (intel_plane_needs_fence()).
And while at it document the reason why the check is what it is.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_fb.c | 2 +-
drivers/gpu/drm/i915/display/intel_plane.c | 9 +++++++++
drivers/gpu/drm/i915/display/intel_plane.h | 1 +
drivers/gpu/drm/i915/i915_fb_pin.c | 2 +-
4 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
index cbeb39ebdb73..1c0859d5f829 100644
--- a/drivers/gpu/drm/i915/display/intel_fb.c
+++ b/drivers/gpu/drm/i915/display/intel_fb.c
@@ -1287,7 +1287,7 @@ bool intel_plane_uses_fence(const struct intel_plane_state *plane_state)
struct intel_display *display = to_intel_display(plane_state);
struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane);
- return DISPLAY_VER(display) < 4 ||
+ return intel_plane_needs_fence(display) ||
(plane->fbc && !plane_state->no_fbc_reason &&
i915_gtt_view_is_normal(&plane_state->view.gtt));
}
diff --git a/drivers/gpu/drm/i915/display/intel_plane.c b/drivers/gpu/drm/i915/display/intel_plane.c
index f41f4c2ac320..c2b58d3b9c23 100644
--- a/drivers/gpu/drm/i915/display/intel_plane.c
+++ b/drivers/gpu/drm/i915/display/intel_plane.c
@@ -192,6 +192,15 @@ bool intel_plane_needs_physical(struct intel_plane *plane)
DISPLAY_INFO(display)->cursor_needs_physical;
}
+bool intel_plane_needs_fence(struct intel_display *display)
+{
+ /*
+ * pre-i965 planes use the fence for tiled scanout.
+ * i965+ planes have their own tiled scanout control bit.
+ */
+ return DISPLAY_VER(display) < 4;
+}
+
bool intel_plane_can_async_flip(struct intel_plane *plane,
const struct drm_format_info *info,
u64 modifier)
diff --git a/drivers/gpu/drm/i915/display/intel_plane.h b/drivers/gpu/drm/i915/display/intel_plane.h
index 7fa7fbbb58dc..7b5456f56f42 100644
--- a/drivers/gpu/drm/i915/display/intel_plane.h
+++ b/drivers/gpu/drm/i915/display/intel_plane.h
@@ -82,6 +82,7 @@ void intel_plane_set_invisible(struct intel_crtc_state *crtc_state,
void intel_plane_helper_add(struct intel_plane *plane);
bool intel_plane_needs_low_address(struct intel_display *display);
bool intel_plane_needs_physical(struct intel_plane *plane);
+bool intel_plane_needs_fence(struct intel_display *display);
void intel_plane_init_cursor_vblank_work(struct intel_plane_state *old_plane_state,
struct intel_plane_state *new_plane_state);
int intel_plane_add_affected(struct intel_atomic_state *state,
diff --git a/drivers/gpu/drm/i915/i915_fb_pin.c b/drivers/gpu/drm/i915/i915_fb_pin.c
index bfe9a5342e13..a8ed888183cb 100644
--- a/drivers/gpu/drm/i915/i915_fb_pin.c
+++ b/drivers/gpu/drm/i915/i915_fb_pin.c
@@ -188,7 +188,7 @@ intel_fb_pin_to_ggtt(const struct drm_framebuffer *fb,
* mode that matches the user configuration.
*/
ret = i915_vma_pin_fence(vma);
- if (ret != 0 && DISPLAY_VER(display) < 4) {
+ if (ret != 0 && intel_plane_needs_fence(display)) {
i915_vma_unpin(vma);
goto err_unpin;
}
--
2.52.0
next prev parent reply other threads:[~2026-04-16 17:45 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-16 17:44 [PATCH 00/11] drm/i915: Eliminate FB usage from low level pinning code Ville Syrjala
2026-04-16 17:44 ` [PATCH 01/11] drm/xe/fb: Use the correct gtt view for remapped FBs Ville Syrjala
2026-04-16 17:44 ` [PATCH 02/11] drm/i915: Introduce struct intel_fb_pin_params Ville Syrjala
2026-04-17 9:40 ` Jani Nikula
2026-04-16 17:44 ` [PATCH 03/11] drm/i915: Extract intel_fb_needs_cpu_access() Ville Syrjala
2026-04-17 9:40 ` Jani Nikula
2026-04-16 17:44 ` [PATCH 04/11] drm/i915: Introduce pin_params.needs_cpu_lmem_access Ville Syrjala
2026-04-17 9:39 ` Jani Nikula
2026-04-17 11:33 ` Ville Syrjälä
2026-04-17 16:19 ` Ville Syrjälä
2026-04-16 17:44 ` [PATCH 05/11] drm/i915: Extract intel_plane_needs_low_address() Ville Syrjala
2026-04-17 9:43 ` Jani Nikula
2026-04-16 17:44 ` [PATCH 06/11] drm/i915: Introduce pin_params.needs_low_address Ville Syrjala
2026-04-17 9:48 ` Jani Nikula
2026-04-16 17:44 ` [PATCH 07/11] drm/i915: Introduce pin_params.needs_physical Ville Syrjala
2026-04-17 9:50 ` Jani Nikula
2026-04-16 17:44 ` Ville Syrjala [this message]
2026-04-17 9:53 ` [PATCH 08/11] drm/i915: Extract intel_plane_needs_fence() Jani Nikula
2026-04-16 17:44 ` [PATCH 09/11] drm/i915: Introduce pin_params.needs_fence Ville Syrjala
2026-04-17 9:58 ` Jani Nikula
2026-04-17 12:25 ` Ville Syrjälä
2026-04-16 17:44 ` [PATCH 10/11] drm/xe: Eliminate intel_fb_uses_dpt() call from __xe_pin_fb_vma() Ville Syrjala
2026-04-17 10:19 ` Jani Nikula
2026-04-16 17:44 ` [PATCH 11/11] drm/i915: Don't pass the framebuffer to low level pinning functions Ville Syrjala
2026-04-17 10:25 ` Jani Nikula
2026-04-16 17:52 ` ✓ CI.KUnit: success for drm/i915: Eliminate FB usage from low level pinning code Patchwork
2026-04-16 18:51 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-16 20:43 ` ✗ Xe.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=20260416174448.28264-9-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