]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915/fb: Use intel_fb_needs_pot_stride_remap() in intel_fb_view_init()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 7 Apr 2026 15:50:53 +0000 (18:50 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 10 Apr 2026 10:29:29 +0000 (13:29 +0300)
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>
Link: https://patch.msgid.link/20260407155053.32156-13-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_fb.c

index ceed695d3ad499b8e4fdcc38f34e4314c2c21284..c4af368deffda6b562b477dd9922870861111e52 100644 (file)
@@ -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;