]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
ce02a3ac2e64c879f4e122ae26d7b519f60f26bd
[thirdparty/kernel/stable-queue.git] /
1 From 324b70e997aab0a7deab8cb90711faccda4e98c8 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
3 Date: Mon, 4 Dec 2023 22:24:43 +0200
4 Subject: drm/i915: Fix ADL+ tiled plane stride when the POT stride is smaller than the original
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 From: Ville Syrjälä <ville.syrjala@linux.intel.com>
10
11 commit 324b70e997aab0a7deab8cb90711faccda4e98c8 upstream.
12
13 plane_view_scanout_stride() currently assumes that we had to pad the
14 mapping stride with dummy pages in order to align it. But that is not
15 the case if the original fb stride exceeds the aligned stride used
16 to populate the remapped view, which is calculated from the user
17 specified framebuffer width rather than the user specified framebuffer
18 stride.
19
20 Ignore the original fb stride in this case and just stick to the POT
21 aligned stride. Getting this wrong will cause the plane to fetch the
22 wrong data, and can lead to fault errors if the page tables at the
23 bogus location aren't even populated.
24
25 TODO: figure out if this is OK for CCS, or if we should instead increase
26 the width of the view to cover the entire user specified fb stride
27 instead...
28
29 Cc: Imre Deak <imre.deak@intel.com>
30 Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
31 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
32 Link: https://patchwork.freedesktop.org/patch/msgid/20231204202443.31247-1-ville.syrjala@linux.intel.com
33 Reviewed-by: Imre Deak <imre.deak@intel.com>
34 Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
35 (cherry picked from commit 01a39f1c4f1220a4e6a25729fae87ff5794cbc52)
36 Cc: stable@vger.kernel.org
37 Signed-off-by: Jani Nikula <jani.nikula@intel.com>
38 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
39 ---
40 drivers/gpu/drm/i915/display/intel_fb.c | 3 ++-
41 1 file changed, 2 insertions(+), 1 deletion(-)
42
43 --- a/drivers/gpu/drm/i915/display/intel_fb.c
44 +++ b/drivers/gpu/drm/i915/display/intel_fb.c
45 @@ -1370,7 +1370,8 @@ plane_view_scanout_stride(const struct i
46 struct drm_i915_private *i915 = to_i915(fb->base.dev);
47 unsigned int stride_tiles;
48
49 - if (IS_ALDERLAKE_P(i915) || DISPLAY_VER(i915) >= 14)
50 + if ((IS_ALDERLAKE_P(i915) || DISPLAY_VER(i915) >= 14) &&
51 + src_stride_tiles < dst_stride_tiles)
52 stride_tiles = src_stride_tiles;
53 else
54 stride_tiles = dst_stride_tiles;