Commit 0da6bfe8 authored by Clint Taylor's avatar Clint Taylor Committed by Nirmoy Das

drm/i915/mtl: Add MTL for remapping CCS FBs

Add support for remapping CCS FBs on MTL to remove the restriction
of the power-of-two sized stride and the 2MB surface offset alignment
for these FBs.
Signed-off-by: default avatarClint Taylor <clinton.a.taylor@intel.com>
Signed-off-by: default avatarJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: default avatarRadhakrishna Sripada <radhakrishna.sripada@intel.com>
Signed-off-by: default avatarNirmoy Das <nirmoy.das@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230505144005.23480-2-nirmoy.das@intel.com
parent 00b9dd06
...@@ -1190,7 +1190,8 @@ bool intel_fb_needs_pot_stride_remap(const struct intel_framebuffer *fb) ...@@ -1190,7 +1190,8 @@ bool intel_fb_needs_pot_stride_remap(const struct intel_framebuffer *fb)
{ {
struct drm_i915_private *i915 = to_i915(fb->base.dev); struct drm_i915_private *i915 = to_i915(fb->base.dev);
return IS_ALDERLAKE_P(i915) && intel_fb_uses_dpt(&fb->base); return (IS_ALDERLAKE_P(i915) || DISPLAY_VER(i915) >= 14) &&
intel_fb_uses_dpt(&fb->base);
} }
static int intel_fb_pitch(const struct intel_framebuffer *fb, int color_plane, unsigned int rotation) static int intel_fb_pitch(const struct intel_framebuffer *fb, int color_plane, unsigned int rotation)
...@@ -1326,9 +1327,10 @@ plane_view_scanout_stride(const struct intel_framebuffer *fb, int color_plane, ...@@ -1326,9 +1327,10 @@ plane_view_scanout_stride(const struct intel_framebuffer *fb, int color_plane,
unsigned int tile_width, unsigned int tile_width,
unsigned int src_stride_tiles, unsigned int dst_stride_tiles) unsigned int src_stride_tiles, unsigned int dst_stride_tiles)
{ {
struct drm_i915_private *i915 = to_i915(fb->base.dev);
unsigned int stride_tiles; unsigned int stride_tiles;
if (IS_ALDERLAKE_P(to_i915(fb->base.dev))) if (IS_ALDERLAKE_P(i915) || DISPLAY_VER(i915) >= 14)
stride_tiles = src_stride_tiles; stride_tiles = src_stride_tiles;
else else
stride_tiles = dst_stride_tiles; stride_tiles = dst_stride_tiles;
...@@ -1522,7 +1524,8 @@ static void intel_fb_view_init(struct drm_i915_private *i915, struct intel_fb_vi ...@@ -1522,7 +1524,8 @@ static void intel_fb_view_init(struct drm_i915_private *i915, struct intel_fb_vi
memset(view, 0, sizeof(*view)); memset(view, 0, sizeof(*view));
view->gtt.type = view_type; view->gtt.type = view_type;
if (view_type == I915_GTT_VIEW_REMAPPED && IS_ALDERLAKE_P(i915)) if (view_type == I915_GTT_VIEW_REMAPPED &&
(IS_ALDERLAKE_P(i915) || DISPLAY_VER(i915) >= 14))
view->gtt.remapped.plane_alignment = SZ_2M / PAGE_SIZE; view->gtt.remapped.plane_alignment = SZ_2M / PAGE_SIZE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment