drm/i915: fix non-Ironlake 965 class crashes
authorJesse Barnes <jbarnes@virtuousgeek.org>
Fri, 23 Apr 2010 16:32:23 +0000 (09:32 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 23 Apr 2010 17:39:20 +0000 (10:39 -0700)
My PIPE_CONTROL fix (just sent via Eric's tree) was buggy; I was
testing a whole set of patches together and missed a conversion to the
new HAS_PIPE_CONTROL macro, which will cause breakage on non-Ironlake
965 class chips.  Fortunately, the fix is trivial and has been tested.

Be sure to use the HAS_PIPE_CONTROL macro in i915_get_gem_seqno, or
we'll end up reading the wrong graphics memory, likely causing hangs,
crashes, or worse.

Reported-by: Zdenek Kabelac <zdenek.kabelac@gmail.com>
Reported-by: Toralf Förster <toralf.foerster@gmx.de>
Tested-by: Toralf Förster <toralf.foerster@gmx.de>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/gpu/drm/i915/i915_gem.c

index 7f52cc124cfe3663ed9c80c293af533f866097c6..ef3d91dda71a9a8a0ce0e1ab61a9731afed1f5f8 100644 (file)
@@ -1793,7 +1793,7 @@ i915_get_gem_seqno(struct drm_device *dev)
 {
        drm_i915_private_t *dev_priv = dev->dev_private;
 
-       if (IS_I965G(dev))
+       if (HAS_PIPE_CONTROL(dev))
                return ((volatile u32 *)(dev_priv->seqno_page))[0];
        else
                return READ_HWSP(dev_priv, I915_GEM_HWS_INDEX);