drm/i915: fix swizzling on gen6+
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 12 Sep 2011 18:49:16 +0000 (20:49 +0200)
committerKeith Packard <keithp@keithp.com>
Thu, 20 Oct 2011 21:11:18 +0000 (14:11 -0700)
Fixes tests/gem_tiled_pread on my snb. I know, mesa doesn't use this
on gen6+, but I also hate failing testcases.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
drivers/gpu/drm/i915/i915_gem_tiling.c

index 99c4faa59d8f3d2fdf372b4a1c53705710ea7131..103da6f2d03bf05a6900e47fc876de7ef8b25c65 100644 (file)
@@ -92,7 +92,10 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev)
        uint32_t swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN;
        uint32_t swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN;
 
-       if (INTEL_INFO(dev)->gen >= 5) {
+       if (INTEL_INFO(dev)->gen >= 6) {
+               swizzle_x = I915_BIT_6_SWIZZLE_NONE;
+               swizzle_y = I915_BIT_6_SWIZZLE_NONE;
+       } else if (IS_GEN5(dev)) {
                /* On Ironlake whatever DRAM config, GPU always do
                 * same swizzling setup.
                 */