[Intel-gfx] [PATCH 2/2] drm/i915: Pin unknown swizzle pages

Chris Wilson chris at chris-wilson.co.uk
Tue Nov 17 02:40:52 PST 2015


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 at chris-wilson.co.uk>
Cc: stable at vger.kernel.org
---
 drivers/gpu/drm/i915/i915_gem_fence.c | 4 ++++
 1 file changed, 4 insertions(+)

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;
 }
 
 /*
-- 
2.6.2



More information about the Intel-gfx mailing list