summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-07-14 09:16:45 -0700
committerEric Anholt <eric@anholt.net>2008-07-14 09:16:45 -0700
commit78f1fc9cbcb383d42d903a8b9febdcf3c438ea7c (patch)
tree4d26c1145cca741bfa5d04062b488d009146df1a /linux-core
parenta0474be4e78d678eb615b37aad355effb955ee19 (diff)
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.
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/i915_gem_tiling.c11
1 files changed, 10 insertions, 1 deletions
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);