Commit 71df86f0 authored by Imre Deak's avatar Imre Deak

drm/i915/tgl: Make sure FBs have a correct CCS plane stride

The CCS plane stride must be fixed on TGL, as it's not configurable for
the display. Instead the HW has a hardwired logic to determine it from
the main plane stride. Make sure userspace passes in the correct stride.

Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Reviewed-by: default avatarMika Kahola <mika.kahola@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191221120543.22816-8-imre.deak@intel.com
parent b3e57bcc
...@@ -2621,6 +2621,12 @@ bool is_ccs_modifier(u64 modifier) ...@@ -2621,6 +2621,12 @@ bool is_ccs_modifier(u64 modifier)
modifier == I915_FORMAT_MOD_Yf_TILED_CCS; modifier == I915_FORMAT_MOD_Yf_TILED_CCS;
} }
static int gen12_ccs_aux_stride(struct drm_framebuffer *fb, int ccs_plane)
{
return DIV_ROUND_UP(fb->pitches[ccs_to_main_plane(fb, ccs_plane)],
512) * 64;
}
u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv, u32 intel_plane_fb_max_stride(struct drm_i915_private *dev_priv,
u32 pixel_format, u64 modifier) u32 pixel_format, u64 modifier)
{ {
...@@ -16550,6 +16556,17 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb, ...@@ -16550,6 +16556,17 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
goto err; goto err;
} }
if (is_gen12_ccs_plane(fb, i)) {
int ccs_aux_stride = gen12_ccs_aux_stride(fb, i);
if (fb->pitches[i] != ccs_aux_stride) {
DRM_DEBUG_KMS("ccs aux plane %d pitch (%d) must be %d\n",
i,
fb->pitches[i], ccs_aux_stride);
goto err;
}
}
fb->obj[i] = &obj->base; fb->obj[i] = &obj->base;
} }
......
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