From c7f4e256e12129ad2d28cf67dc6351f9ea11244e Mon Sep 17 00:00:00 2001 From: Owain Ainsworth Date: Sat, 21 May 2011 14:31:24 +0000 Subject: 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 --- sys/dev/pci/drm/i915_drv.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'sys') 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,19 +711,21 @@ 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 */ -- cgit v1.2.3