intel-gem: Disable tiling if we get junk from the MCHBAR read.
authorEric Anholt <eric@anholt.net>
Mon, 14 Jul 2008 16:16:45 +0000 (09:16 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 14 Jul 2008 16:16:45 +0000 (09:16 -0700)
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

index d66276d..ddf83ce 100644 (file)
@@ -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);