diff mbox

[2/2] drm/i915: Pin unknown swizzle pages

Message ID 1447756852-15183-2-git-send-email-chris@chris-wilson.co.uk
State New, archived
Headers show

Commit Message

Chris Wilson Nov. 17, 2015, 10:40 a.m. UTC
Another oddity associated with gen4 desktop is that some machines
experience swizzling corruption across swapping. Typically this would
imply that those machines have bit17 swizzling (where the swizzle
depends upon the physical address of the page). Play it safe and apply
the bit17 quirk to keep unknown swizzle pages pinned.

References: https://bugs.freedesktop.org/show_bug.cgi?id=90725
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/i915/i915_gem_fence.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem_fence.c b/drivers/gpu/drm/i915/i915_gem_fence.c
index 6ba68083aa95..b5ae97c3d3b2 100644
--- a/drivers/gpu/drm/i915/i915_gem_fence.c
+++ b/drivers/gpu/drm/i915/i915_gem_fence.c
@@ -687,6 +687,10 @@  i915_gem_detect_bit_6_swizzle(struct drm_device *dev)
 
 	dev_priv->mm.bit_6_swizzle_x = swizzle_x;
 	dev_priv->mm.bit_6_swizzle_y = swizzle_y;
+
+	if (swizzle_x == I915_BIT_6_SWIZZLE_UNKNOWN ||
+	    swizzle_y == I915_BIT_6_SWIZZLE_UNKNOWN)
+		dev_priv->quirks |= QUIRK_PIN_SWIZZLED_PAGES;
 }
 
 /*