DRM/i915: Remove i965_hpd_irq_setup.
authorEgbert Eich <eich@suse.de>
Mon, 25 Feb 2013 17:06:51 +0000 (12:06 -0500)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 27 Mar 2013 16:12:53 +0000 (17:12 +0100)
After
"Convert HPD interrupts to make use of HPD pin assignment in encoders."
This function is now basically the same as i915_hpd_irq_setup().

Consolidating both functions in one requires one more check for
I915_HAS_HOTPLUG(dev) in the i965 code path and one more check for
IS_G4X(dev) in the i915 code path. These are considered harmless.

Signed-off-by: Egbert Eich <eich@suse.de>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: Fixup patch conflict and make it compile.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_irq.c

index 64c79a0cb57099ba2296b97ef7ddb57700a5c890..666a0ecebb1228a640cc9147d19d89f986a82300 100644 (file)
@@ -2526,25 +2526,6 @@ static int i915_irq_postinstall(struct drm_device *dev)
        return 0;
 }
 
-static void i915_hpd_irq_setup(struct drm_device *dev)
-{
-       if (I915_HAS_HOTPLUG(dev)) {
-               drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
-               struct drm_mode_config *mode_config = &dev->mode_config;
-               struct intel_encoder *encoder;
-               u32 hotplug_en = I915_READ(PORT_HOTPLUG_EN);
-
-               hotplug_en &= ~HOTPLUG_INT_EN_MASK;
-               list_for_each_entry(encoder, &mode_config->encoder_list, base.head)
-                       hotplug_en |= hpd_mask_i915[encoder->hpd_pin];
-               hotplug_en |= CRT_HOTPLUG_VOLTAGE_COMPARE_50;
-
-               /* Ignore TV since it's buggy */
-
-               I915_WRITE(PORT_HOTPLUG_EN, hotplug_en);
-       }
-}
-
 /*
  * Returns true when a page flip has completed.
  */
@@ -2774,29 +2755,31 @@ static int i965_irq_postinstall(struct drm_device *dev)
        return 0;
 }
 
-static void i965_hpd_irq_setup(struct drm_device *dev)
+static void i915_hpd_irq_setup(struct drm_device *dev)
 {
        drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
        struct drm_mode_config *mode_config = &dev->mode_config;
        struct intel_encoder *encoder;
        u32 hotplug_en;
 
-       /* Note HDMI and DP share hotplug bits */
-       hotplug_en = 0;
-       list_for_each_entry(encoder, &mode_config->encoder_list, base.head)
+       if (I915_HAS_HOTPLUG(dev)) {
+               hotplug_en = I915_READ(PORT_HOTPLUG_EN);
+               hotplug_en &= ~HOTPLUG_INT_EN_MASK;
+               /* Note HDMI and DP share hotplug bits */
                /* enable bits are the same for all generations */
-               hotplug_en |= hpd_mask_i915[encoder->hpd_pin];
-       /* Programming the CRT detection parameters tends
-          to generate a spurious hotplug event about three
-          seconds later.  So just do it once.
-       */
-       if (IS_G4X(dev))
-               hotplug_en |= CRT_HOTPLUG_ACTIVATION_PERIOD_64;
-       hotplug_en |= CRT_HOTPLUG_VOLTAGE_COMPARE_50;
-
-       /* Ignore TV since it's buggy */
+               list_for_each_entry(encoder, &mode_config->encoder_list, base.head)
+                       hotplug_en |= hpd_mask_i915[encoder->hpd_pin];
+               /* Programming the CRT detection parameters tends
+                  to generate a spurious hotplug event about three
+                  seconds later.  So just do it once.
+               */
+               if (IS_G4X(dev))
+                       hotplug_en |= CRT_HOTPLUG_ACTIVATION_PERIOD_64;
+               hotplug_en |= CRT_HOTPLUG_VOLTAGE_COMPARE_50;
 
-       I915_WRITE(PORT_HOTPLUG_EN, hotplug_en);
+               /* Ignore TV since it's buggy */
+               I915_WRITE(PORT_HOTPLUG_EN, hotplug_en);
+       }
 }
 
 static irqreturn_t i965_irq_handler(int irq, void *arg)
@@ -3008,7 +2991,7 @@ void intel_irq_init(struct drm_device *dev)
                        dev->driver->irq_postinstall = i965_irq_postinstall;
                        dev->driver->irq_uninstall = i965_irq_uninstall;
                        dev->driver->irq_handler = i965_irq_handler;
-                       dev_priv->display.hpd_irq_setup = i965_hpd_irq_setup;
+                       dev_priv->display.hpd_irq_setup = i915_hpd_irq_setup;
                }
                dev->driver->enable_vblank = i915_enable_vblank;
                dev->driver->disable_vblank = i915_disable_vblank;