From 78f1fc9cbcb383d42d903a8b9febdcf3c438ea7c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 14 Jul 2008 09:16:45 -0700 Subject: intel-gem: Disable tiling if we get junk from the MCHBAR read. One of our systems has been returning 0xffffffff from all MCHBAR reads, which means we'll need to figure out why, or add an alternate detection method. --- linux-core/i915_gem_tiling.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'linux-core/i915_gem_tiling.c') diff --git a/linux-core/i915_gem_tiling.c b/linux-core/i915_gem_tiling.c index d66276d6..ddf83ce4 100644 --- a/linux-core/i915_gem_tiling.c +++ b/linux-core/i915_gem_tiling.c @@ -155,7 +155,10 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev) */ chdecmisc = readb(mchbar + CHDECMISC); - if (chdecmisc & CHDECMISC_FLEXMEMORY) { + if (chdecmisc == 0xff) { + DRM_ERROR("Couldn't read from MCHBAR. " + "Disabling tiling.\n"); + } else if (chdecmisc & CHDECMISC_FLEXMEMORY) { swizzle_x = I915_BIT_6_SWIZZLE_NONE; swizzle_y = I915_BIT_6_SWIZZLE_NONE; } else { @@ -197,6 +200,12 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev) } break; } + if (dcc == 0xffffffff) { + DRM_ERROR("Couldn't read from MCHBAR. " + "Disabling tiling.\n"); + swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN; + swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN; + } } iounmap(mchbar); -- cgit v1.2.3