drm/i915: Support IGD EOS
[pandora-kernel.git] / drivers / gpu / drm / i915 / i915_irq.c
index 7ebc84c..6c89f2f 100644 (file)
@@ -565,6 +565,27 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
 
                        I915_WRITE(PORT_HOTPLUG_STAT, hotplug_status);
                        I915_READ(PORT_HOTPLUG_STAT);
+
+                       /* EOS interrupts occurs */
+                       if (IS_IGD(dev) &&
+                               (hotplug_status & CRT_EOS_INT_STATUS)) {
+                               u32 temp;
+
+                               DRM_DEBUG("EOS interrupt occurs\n");
+                               /* status is already cleared */
+                               temp = I915_READ(ADPA);
+                               temp &= ~ADPA_DAC_ENABLE;
+                               I915_WRITE(ADPA, temp);
+
+                               temp = I915_READ(PORT_HOTPLUG_EN);
+                               temp &= ~CRT_EOS_INT_EN;
+                               I915_WRITE(PORT_HOTPLUG_EN, temp);
+
+                               temp = I915_READ(PORT_HOTPLUG_STAT);
+                               if (temp & CRT_EOS_INT_STATUS)
+                                       I915_WRITE(PORT_HOTPLUG_STAT,
+                                               CRT_EOS_INT_STATUS);
+                       }
                }
 
                I915_WRITE(IIR, iir);