Skip to content

Commit 01a39f1

Browse files
committed
drm/i915: Fix ADL+ tiled plane stride when the POT stride is smaller than the original
plane_view_scanout_stride() currently assumes that we had to pad the mapping stride with dummy pages in order to align it. But that is not the case if the original fb stride exceeds the aligned stride used to populate the remapped view, which is calculated from the user specified framebuffer width rather than the user specified framebuffer stride. Ignore the original fb stride in this case and just stick to the POT aligned stride. Getting this wrong will cause the plane to fetch the wrong data, and can lead to fault errors if the page tables at the bogus location aren't even populated. TODO: figure out if this is OK for CCS, or if we should instead increase the width of the view to cover the entire user specified fb stride instead... Cc: Imre Deak <imre.deak@intel.com> Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231204202443.31247-1-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
1 parent 4de7715 commit 01a39f1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/gpu/drm/i915/display/intel_fb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,8 @@ plane_view_scanout_stride(const struct intel_framebuffer *fb, int color_plane,
13811381
struct drm_i915_private *i915 = to_i915(fb->base.dev);
13821382
unsigned int stride_tiles;
13831383

1384-
if (IS_ALDERLAKE_P(i915) || DISPLAY_VER(i915) >= 14)
1384+
if ((IS_ALDERLAKE_P(i915) || DISPLAY_VER(i915) >= 14) &&
1385+
src_stride_tiles < dst_stride_tiles)
13851386
stride_tiles = src_stride_tiles;
13861387
else
13871388
stride_tiles = dst_stride_tiles;

0 commit comments

Comments
 (0)