summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/i915_drv.c29
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