diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2011-07-06 01:50:09 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2011-07-06 01:50:09 +0000 |
commit | 45b3845c4bcc6cce64d0a683b18f928a9bda8d6a (patch) | |
tree | b354640cff3d9291a031067d3ab7595fcec72a35 /sys | |
parent | 25bb7d4aa9c94e53d29ef5d4df5d5e815d5671db (diff) |
so... there is some crazy bug exposed on non-ironlake chips, when the
ironlake interrupt handler is changed. some nasty bug lurks in here,
and any binary change randomly exposes this and screws up the chip.
back this out for now; until it is found.
ok oga
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/drm/i915_drv.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c index 046a912fbad..f5ba8353926 100644 --- a/sys/dev/pci/drm/i915_drv.c +++ b/sys/dev/pci/drm/i915_drv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_drv.c,v 1.114 2011/07/04 23:10:07 oga Exp $ */ +/* $OpenBSD: i915_drv.c,v 1.115 2011/07/06 01:50:08 deraadt Exp $ */ /* * Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org> * @@ -672,25 +672,20 @@ inteldrm_ironlake_intr(void *arg) { struct inteldrm_softc *dev_priv = arg; struct drm_device *dev = (struct drm_device *)dev_priv->drmdev; - u_int32_t de_iir, gt_iir, pch_iir = 0; + u_int32_t de_iir, gt_iir, de_ier, pch_iir; + int ret = 0; - /* - * If we're vt switched then no interrupts should be enabled - * Unfortunately we can't keep track of state and quit early - * other times because if we're running commands then error interrupts - * could happen any time - */ - if (dev_priv->mm.suspended) - return (0); + de_ier = I915_READ(DEIER); + I915_WRITE(DEIER, de_ier & ~DE_MASTER_IRQ_CONTROL); + (void)I915_READ(DEIER); de_iir = I915_READ(DEIIR); gt_iir = I915_READ(GTIIR); -#ifdef notyet /* nothing enabled yet, don't read it */ pch_iir = I915_READ(SDEIIR); -#endif if (de_iir == 0 && gt_iir == 0 && pch_iir == 0) - return (0); + goto done; + ret = 1; if (gt_iir & GT_USER_INTERRUPT) { wakeup(dev_priv); @@ -706,13 +701,15 @@ inteldrm_ironlake_intr(void *arg) drm_handle_vblank(dev, 1); /* should clear PCH hotplug event before clearing CPU irq */ -#ifdef notyet /* nothing enabled yet, don't read it */ I915_WRITE(SDEIIR, pch_iir); -#endif I915_WRITE(GTIIR, gt_iir); I915_WRITE(DEIIR, de_iir); - return (1); +done: + I915_WRITE(DEIER, de_ier); + (void)I915_READ(DEIER); + + return (ret); } int |