Commit adca4730 authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter

drm/i915: All members of gen4 have hotplug, so unconditionally enable its irq

Also as we set the HOTPLUG_EN to 0 during pre-install, we can simply set
it during post-install, and nor do we wish to enable unwanted hotplug
events.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent f15b4ca2
...@@ -2320,10 +2320,8 @@ static void i965_irq_preinstall(struct drm_device * dev) ...@@ -2320,10 +2320,8 @@ static void i965_irq_preinstall(struct drm_device * dev)
atomic_set(&dev_priv->irq_received, 0); atomic_set(&dev_priv->irq_received, 0);
if (I915_HAS_HOTPLUG(dev)) {
I915_WRITE(PORT_HOTPLUG_EN, 0); I915_WRITE(PORT_HOTPLUG_EN, 0);
I915_WRITE(PORT_HOTPLUG_STAT, I915_READ(PORT_HOTPLUG_STAT)); I915_WRITE(PORT_HOTPLUG_STAT, I915_READ(PORT_HOTPLUG_STAT));
}
I915_WRITE(HWSTAM, 0xeffe); I915_WRITE(HWSTAM, 0xeffe);
for_each_pipe(pipe) for_each_pipe(pipe)
...@@ -2336,11 +2334,13 @@ static void i965_irq_preinstall(struct drm_device * dev) ...@@ -2336,11 +2334,13 @@ static void i965_irq_preinstall(struct drm_device * dev)
static int i965_irq_postinstall(struct drm_device *dev) static int i965_irq_postinstall(struct drm_device *dev)
{ {
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
u32 hotplug_en;
u32 enable_mask; u32 enable_mask;
u32 error_mask; u32 error_mask;
/* Unmask the interrupts that we always want on. */ /* Unmask the interrupts that we always want on. */
dev_priv->irq_mask = ~(I915_ASLE_INTERRUPT | dev_priv->irq_mask = ~(I915_ASLE_INTERRUPT |
I915_DISPLAY_PORT_INTERRUPT |
I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | I915_DISPLAY_PIPE_A_EVENT_INTERRUPT |
I915_DISPLAY_PIPE_B_EVENT_INTERRUPT | I915_DISPLAY_PIPE_B_EVENT_INTERRUPT |
I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT | I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT |
...@@ -2356,13 +2356,6 @@ static int i965_irq_postinstall(struct drm_device *dev) ...@@ -2356,13 +2356,6 @@ static int i965_irq_postinstall(struct drm_device *dev)
dev_priv->pipestat[0] = 0; dev_priv->pipestat[0] = 0;
dev_priv->pipestat[1] = 0; dev_priv->pipestat[1] = 0;
if (I915_HAS_HOTPLUG(dev)) {
/* Enable in IER... */
enable_mask |= I915_DISPLAY_PORT_INTERRUPT;
/* and unmask in IMR */
dev_priv->irq_mask &= ~I915_DISPLAY_PORT_INTERRUPT;
}
/* /*
* Enable some error detection, note the instruction error mask * Enable some error detection, note the instruction error mask
* bit is reserved, so we leave it masked. * bit is reserved, so we leave it masked.
...@@ -2382,10 +2375,8 @@ static int i965_irq_postinstall(struct drm_device *dev) ...@@ -2382,10 +2375,8 @@ static int i965_irq_postinstall(struct drm_device *dev)
I915_WRITE(IER, enable_mask); I915_WRITE(IER, enable_mask);
POSTING_READ(IER); POSTING_READ(IER);
if (I915_HAS_HOTPLUG(dev)) { /* Note HDMI and DP share hotplug bits */
u32 hotplug_en = I915_READ(PORT_HOTPLUG_EN); hotplug_en = 0;
/* Note HDMI and DP share bits */
if (dev_priv->hotplug_supported_mask & HDMIB_HOTPLUG_INT_STATUS) if (dev_priv->hotplug_supported_mask & HDMIB_HOTPLUG_INT_STATUS)
hotplug_en |= HDMIB_HOTPLUG_INT_EN; hotplug_en |= HDMIB_HOTPLUG_INT_EN;
if (dev_priv->hotplug_supported_mask & HDMIC_HOTPLUG_INT_STATUS) if (dev_priv->hotplug_supported_mask & HDMIC_HOTPLUG_INT_STATUS)
...@@ -2411,7 +2402,6 @@ static int i965_irq_postinstall(struct drm_device *dev) ...@@ -2411,7 +2402,6 @@ static int i965_irq_postinstall(struct drm_device *dev)
/* Ignore TV since it's buggy */ /* Ignore TV since it's buggy */
I915_WRITE(PORT_HOTPLUG_EN, hotplug_en); I915_WRITE(PORT_HOTPLUG_EN, hotplug_en);
}
intel_opregion_enable_asle(dev); intel_opregion_enable_asle(dev);
...@@ -2469,8 +2459,7 @@ static irqreturn_t i965_irq_handler(DRM_IRQ_ARGS) ...@@ -2469,8 +2459,7 @@ static irqreturn_t i965_irq_handler(DRM_IRQ_ARGS)
ret = IRQ_HANDLED; ret = IRQ_HANDLED;
/* Consume port. Then clear IIR or we'll miss events */ /* Consume port. Then clear IIR or we'll miss events */
if ((I915_HAS_HOTPLUG(dev)) && if (iir & I915_DISPLAY_PORT_INTERRUPT) {
(iir & I915_DISPLAY_PORT_INTERRUPT)) {
u32 hotplug_status = I915_READ(PORT_HOTPLUG_STAT); u32 hotplug_status = I915_READ(PORT_HOTPLUG_STAT);
DRM_DEBUG_DRIVER("hotplug event received, stat 0x%08x\n", DRM_DEBUG_DRIVER("hotplug event received, stat 0x%08x\n",
...@@ -2543,10 +2532,8 @@ static void i965_irq_uninstall(struct drm_device * dev) ...@@ -2543,10 +2532,8 @@ static void i965_irq_uninstall(struct drm_device * dev)
if (!dev_priv) if (!dev_priv)
return; return;
if (I915_HAS_HOTPLUG(dev)) {
I915_WRITE(PORT_HOTPLUG_EN, 0); I915_WRITE(PORT_HOTPLUG_EN, 0);
I915_WRITE(PORT_HOTPLUG_STAT, I915_READ(PORT_HOTPLUG_STAT)); I915_WRITE(PORT_HOTPLUG_STAT, I915_READ(PORT_HOTPLUG_STAT));
}
I915_WRITE(HWSTAM, 0xffffffff); I915_WRITE(HWSTAM, 0xffffffff);
for_each_pipe(pipe) for_each_pipe(pipe)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment