From 0660311d986ca8b2a4759f5c5eeea0e4a76db097 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 20 Feb 2013 14:41:41 +0000 Subject: [PATCH] drm/i915: Align cursors to 64k when VT-d is enabled From the w/a database: 'To prevent false VT-d type 6 error, the cursors must be 64KiB aligned, and require an extra 2 PTEs of padding afterward' This implements the first step of aligning the cursors as required. References: https://bugs.freedesktop.org/show_bug.cgi?id=59631 Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/intel_display.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index f97de05..ec22576 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -6375,13 +6375,19 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc, /* we only need to pin inside GTT if cursor is non-phy */ mutex_lock(&dev->struct_mutex); if (!dev_priv->info->cursor_needs_physical) { + unsigned alignment; + if (obj->tiling_mode) { DRM_ERROR("cursor cannot be tiled\n"); ret = -EINVAL; goto fail_locked; } - ret = i915_gem_object_pin_to_display_plane(obj, 0, NULL); + alignment = 0; + if (need_vtd_wa(dev)) + alignment = 64*1024; + + ret = i915_gem_object_pin_to_display_plane(obj, alignment, NULL); if (ret) { DRM_ERROR("failed to move cursor bo into the GTT\n"); goto fail_locked; -- 1.7.10.4