Currently we don't account for the VT-d alignment w/a in
plane->min_alignment() which means that panning inside a larger
framebuffer can still cause the plane SURF to be misaligned.
Fix the issue by moving the VT-d alignment w/a into
plane->min_alignment() itself (for the affected platforms).
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250122151755.6928-2-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
const struct drm_framebuffer *fb,
int color_plane)
{
+ struct drm_i915_private *i915 = to_i915(plane->base.dev);
+
if (intel_plane_can_async_flip(plane, fb->modifier))
return 256 * 1024;
+ if (intel_scanout_needs_vtd_wa(i915))
+ return 256 * 1024;
+
switch (fb->modifier) {
case I915_FORMAT_MOD_X_TILED:
return 4 * 1024;
const struct drm_framebuffer *fb,
int color_plane)
{
+ struct drm_i915_private *i915 = to_i915(plane->base.dev);
+
if (intel_plane_can_async_flip(plane, fb->modifier))
return 256 * 1024;
+ if (intel_scanout_needs_vtd_wa(i915))
+ return 256 * 1024;
+
switch (fb->modifier) {
case I915_FORMAT_MOD_X_TILED:
case DRM_FORMAT_MOD_LINEAR:
const struct drm_framebuffer *fb,
int color_plane)
{
+ struct drm_i915_private *i915 = to_i915(plane->base.dev);
+
+ if (intel_scanout_needs_vtd_wa(i915))
+ return 256 * 1024;
+
return 4 * 1024; /* physical for i915/i945 */
}
if (drm_WARN_ON(dev, alignment && !is_power_of_2(alignment)))
return ERR_PTR(-EINVAL);
- /* Note that the w/a also requires 64 PTE of padding following the
- * bo. We currently fill all unused PTE with the shadow page and so
- * we should always have valid PTE following the scanout preventing
- * the VT-d warning.
- */
- if (intel_scanout_needs_vtd_wa(dev_priv) && alignment < 256 * 1024)
- alignment = 256 * 1024;
-
/*
* Global gtt pte registers are special registers which actually forward
* writes to a chunk of system memory. Which means that there is no risk
const struct drm_framebuffer *fb,
int color_plane)
{
+ struct drm_i915_private *i915 = to_i915(plane->base.dev);
+
+ if (intel_scanout_needs_vtd_wa(i915))
+ return 256 * 1024;
+
return 4 * 1024;
}
if (color_plane != 0)
return 4 * 1024;
+ /*
+ * VT-d needs at least 256k alignment,
+ * but that's already covered below.
+ */
switch (fb->modifier) {
case DRM_FORMAT_MOD_LINEAR:
case I915_FORMAT_MOD_X_TILED: