All of 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 12/12] drm/i915/fb: Use intel_fb_needs_pot_stride_remap() in intel_fb_view_init()
Date: Tue,  7 Apr 2026 18:50:53 +0300	[thread overview]
Message-ID: <20260407155053.32156-13-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20260407155053.32156-1-ville.syrjala@linux.intel.com>

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

Replace the open coded intel_fb_needs_pot_stride_remap() check
inside intel_fb_view_init() with the real thing.

The current check doesn't have the intel_fb_uses_dpt() in there, but
that is the only situation when we use the remapped view, and thus
was always implied.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_fb.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_fb.c b/drivers/gpu/drm/i915/display/intel_fb.c
index ceed695d3ad4..c4af368deffd 100644
--- a/drivers/gpu/drm/i915/display/intel_fb.c
+++ b/drivers/gpu/drm/i915/display/intel_fb.c
@@ -1627,13 +1627,14 @@ calc_plane_normal_size(const struct intel_framebuffer *fb, int color_plane,
 
 static void intel_fb_view_init(struct intel_display *display,
 			       struct intel_fb_view *view,
-			       enum i915_gtt_view_type view_type)
+			       enum i915_gtt_view_type view_type,
+			       const struct intel_framebuffer *fb)
 {
 	memset(view, 0, sizeof(*view));
 	view->gtt.type = view_type;
 
 	if (i915_gtt_view_is_remapped(&view->gtt) &&
-	    (display->platform.alderlake_p || DISPLAY_VER(display) >= 14))
+	    intel_fb_needs_pot_stride_remap(fb))
 		view->gtt.remapped.plane_alignment = SZ_2M / PAGE_SIZE;
 }
 
@@ -1699,16 +1700,19 @@ int intel_fill_fb_info(struct intel_display *display, struct intel_framebuffer *
 	int i, num_planes = fb->base.format->num_planes;
 	unsigned int tile_size = intel_tile_size(display);
 
-	intel_fb_view_init(display, &fb->normal_view, I915_GTT_VIEW_NORMAL);
+	intel_fb_view_init(display, &fb->normal_view,
+			   I915_GTT_VIEW_NORMAL, fb);
 
 	drm_WARN_ON(display->drm,
 		    intel_fb_supports_90_270_rotation(fb) &&
 		    intel_fb_needs_pot_stride_remap(fb));
 
 	if (intel_fb_supports_90_270_rotation(fb))
-		intel_fb_view_init(display, &fb->rotated_view, I915_GTT_VIEW_ROTATED);
+		intel_fb_view_init(display, &fb->rotated_view,
+				   I915_GTT_VIEW_ROTATED, fb);
 	if (intel_fb_needs_pot_stride_remap(fb))
-		intel_fb_view_init(display, &fb->remapped_view, I915_GTT_VIEW_REMAPPED);
+		intel_fb_view_init(display, &fb->remapped_view,
+				   I915_GTT_VIEW_REMAPPED, fb);
 
 	for (i = 0; i < num_planes; i++) {
 		struct fb_plane_view_dims view_dims;
@@ -1835,8 +1839,9 @@ static void intel_plane_remap_gtt(struct intel_plane_state *plane_state)
 	u32 gtt_offset = 0;
 
 	intel_fb_view_init(display, &plane_state->view,
-			   drm_rotation_90_or_270(rotation) ? I915_GTT_VIEW_ROTATED :
-							      I915_GTT_VIEW_REMAPPED);
+			   drm_rotation_90_or_270(rotation) ?
+			   I915_GTT_VIEW_ROTATED : I915_GTT_VIEW_REMAPPED,
+			   intel_fb);
 
 	src_x = plane_state->uapi.src.x1 >> 16;
 	src_y = plane_state->uapi.src.y1 >> 16;
-- 
2.52.0


  parent reply	other threads:[~2026-04-07 15:51 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-07 15:50 [PATCH 00/12] drm/i915/fb: Prep work for more generic remapping support Ville Syrjala
2026-04-07 15:50 ` [PATCH 01/12] drm/i915/fb: Nuke intel_tile_row_size() Ville Syrjala
2026-04-08  8:42   ` Jani Nikula
2026-04-07 15:50 ` [PATCH 02/12] drm/i915/fb: Make intel_fb_needs_pot_stride_remap() static Ville Syrjala
2026-04-08  8:43   ` Jani Nikula
2026-04-07 15:50 ` [PATCH 03/12] drm/i915/fb: Reject per-plane remapping with DPT Ville Syrjala
2026-04-08  8:43   ` Jani Nikula
2026-04-07 15:50 ` [PATCH 04/12] drm/xe/fb: Use the correct gtt view for remapped FBs Ville Syrjala
2026-04-08  8:44   ` Jani Nikula
2026-04-07 15:50 ` [PATCH 05/12] drm/xe/fb: Remove weird VMA end alignemnt Ville Syrjala
2026-04-08  8:45   ` Jani Nikula
2026-04-07 15:50 ` [PATCH 06/12] drm/xe/fb: Extract xe_dpt_size() Ville Syrjala
2026-04-08  8:47   ` Jani Nikula
2026-04-07 15:50 ` [PATCH 07/12] drm/i915/vma: Add helpers to check GTT view type Ville Syrjala
2026-04-08  8:50   ` Jani Nikula
2026-04-08  9:11     ` Jani Nikula
2026-04-07 15:50 ` [PATCH 08/12] drm/xe/fb: Use i915_gtt_view_is_*() Ville Syrjala
2026-04-08  8:52   ` Jani Nikula
2026-04-07 15:50 ` [PATCH 09/12] drm/i915/fb: " Ville Syrjala
2026-04-08  8:53   ` Jani Nikula
2026-04-07 15:50 ` [PATCH 10/12] drm/i915/selftests: Eliminate duplicate vma size check Ville Syrjala
2026-04-08  9:01   ` Jani Nikula
2026-04-08 11:28     ` Ville Syrjälä
2026-04-07 15:50 ` [PATCH 11/12] drm/i915/selftests: Use i915_gtt_view_is_*() Ville Syrjala
2026-04-08  9:03   ` Jani Nikula
2026-04-08  9:04     ` Jani Nikula
2026-04-07 15:50 ` Ville Syrjala [this message]
2026-04-08  9:09   ` [PATCH 12/12] drm/i915/fb: Use intel_fb_needs_pot_stride_remap() in intel_fb_view_init() Jani Nikula
2026-04-07 15:57 ` ✗ CI.checkpatch: warning for drm/i915/fb: Prep work for more generic remapping support Patchwork
2026-04-07 15:58 ` ✓ CI.KUnit: success " Patchwork
2026-04-07 16:37 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-07 18:51 ` ✓ i915.CI.BAT: " Patchwork
2026-04-07 19:34 ` ✓ Xe.CI.FULL: " Patchwork
2026-04-08  1:31 ` ✓ i915.CI.Full: " Patchwork
2026-04-10 11:25 ` [PATCH 00/12] " Ville Syrjälä

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=20260407155053.32156-13-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 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.