summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_irq.c
diff options
context:
space:
mode:
authorMatthew Garrett <mjg59@srcf.ucam.org>2008-08-05 19:37:25 +0100
committerDave Airlie <airlied@linux.ie>2008-10-18 07:10:10 +1000
commit8ee1c3db9075cb3211352e737e0feb98fd733b20 (patch)
treead91cc8b4ce57fdfdbac8920ba4b352a6871c782 /drivers/gpu/drm/i915/i915_irq.c
parent398c9cb20b5c6c5d1313912b937d653a46fec578 (diff)
Add Intel ACPI IGD OpRegion support
This adds the support necessary for allowing ACPI backlight control to work on some newer Intel-based graphics systems. Tested on Thinkpad T61 and HP 2510p hardware. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_irq.c')
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 24d11ed5bbc..ae7d3a82a6d 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -36,9 +36,11 @@
/** These are the interrupts used by the driver */
#define I915_INTERRUPT_ENABLE_MASK (I915_USER_INTERRUPT | \
I915_DISPLAY_PIPE_A_VBLANK_INTERRUPT | \
- I915_DISPLAY_PIPE_B_VBLANK_INTERRUPT)
+ I915_DISPLAY_PIPE_B_VBLANK_INTERRUPT | \
+ I915_ASLE_INTERRUPT | \
+ I915_DISPLAY_PIPE_B_EVENT_INTERRUPT)
-static inline void
+void
i915_enable_irq(drm_i915_private_t *dev_priv, u32 mask)
{
if ((dev_priv->irq_mask_reg & mask) != 0) {
@@ -274,6 +276,9 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
return IRQ_NONE;
}
+ I915_WRITE(PIPEASTAT, pipea_stats);
+ I915_WRITE(PIPEBSTAT, pipeb_stats);
+
I915_WRITE(IIR, iir);
if (dev->pdev->msi_enabled)
I915_WRITE(IMR, dev_priv->irq_mask_reg);
@@ -306,14 +311,14 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
if (dev_priv->swaps_pending > 0)
drm_locked_tasklet(dev, i915_vblank_tasklet);
- I915_WRITE(PIPEASTAT,
- pipea_stats|I915_VBLANK_INTERRUPT_ENABLE|
- PIPE_VBLANK_INTERRUPT_STATUS);
- I915_WRITE(PIPEBSTAT,
- pipeb_stats|I915_VBLANK_INTERRUPT_ENABLE|
- PIPE_VBLANK_INTERRUPT_STATUS);
}
+ if (iir & I915_ASLE_INTERRUPT)
+ opregion_asle_intr(dev);
+
+ if (iir & I915_DISPLAY_PIPE_B_EVENT_INTERRUPT)
+ opregion_asle_intr(dev);
+
return IRQ_HANDLED;
}
@@ -661,10 +666,14 @@ void i915_driver_irq_postinstall(struct drm_device * dev)
if (dev_priv->vblank_pipe & DRM_I915_VBLANK_PIPE_B)
dev_priv->irq_mask_reg &= ~I915_DISPLAY_PIPE_B_VBLANK_INTERRUPT;
+ dev_priv->irq_mask_reg &= I915_INTERRUPT_ENABLE_MASK;
+
I915_WRITE(IMR, dev_priv->irq_mask_reg);
I915_WRITE(IER, I915_INTERRUPT_ENABLE_MASK);
(void) I915_READ(IER);
+ opregion_enable_asle(dev);
+
DRM_INIT_WAITQUEUE(&dev_priv->irq_queue);
}