summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2011-05-21 14:31:24 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2011-05-21 14:31:24 +0000
commitc7f4e256e12129ad2d28cf67dc6351f9ea11244e (patch)
tree8a567f1634b4a00dd3570eff1140f7e6ad5bfd34 /sys/dev/pci/drm
parent62d952b9e74b43648549b13661d599ff7f869b4b (diff)
Make inteldrm_intr only do any work if we know for sure that interrupts
are unmasked (so we aren't vt switched). Delay mutex aquisition until after we've make sure we have to worry about interrupts. The ironlake version of this behaves funny for guenther@ with interaction on docking then restarting X. so has been left out of this commit until I work out what the hell is going on. Joint work with deraadt@ been in snaps for weeks
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r--sys/dev/pci/drm/i915_drv.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c
index 6fb20fed36a..cb8d7069df4 100644
--- a/sys/dev/pci/drm/i915_drv.c
+++ b/sys/dev/pci/drm/i915_drv.c
@@ -711,20 +711,22 @@ inteldrm_intr(void *arg)
struct drm_device *dev = (struct drm_device *)dev_priv->drmdev;
u_int32_t iir, pipea_stats = 0, pipeb_stats = 0;
- /* we're not set up, don't poke the hw */
- if (dev_priv->hw_status_page == NULL)
- return (0);
/*
- * lock is to protect from writes to PIPESTAT and IMR from other cores.
+ * we're not set up, don't poke the hw and if we're vt switched
+ * then nothing will be enabled
*/
- mtx_enter(&dev_priv->user_irq_lock);
+ if (dev_priv->hw_status_page == NULL || dev_priv->mm.suspended)
+ return (0);
+
iir = I915_READ(IIR);
- if (iir == 0) {
- mtx_leave(&dev_priv->user_irq_lock);
+ if (iir == 0)
return (0);
- }
/*
+ * lock is to protect from writes to PIPESTAT and IMR from other cores.
+ */
+ mtx_enter(&dev_priv->user_irq_lock);
+ /*
* Clear the PIPE(A|B)STAT regs before the IIR
*/
if (iir & I915_DISPLAY_PIPE_A_EVENT_INTERRUPT) {