aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorEgbert Eich <eich@suse.de>2013-02-25 12:06:51 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-03-27 12:12:53 -0400
commitbac56d5b9535f16409b294d92ecc01c354059b41 (patch)
treebed481e993cdaf335638b3bb6d2a7e707a674ac3 /drivers/gpu/drm
parent82a28bcf5606ef1e9f527e9750cf9f44b0986de7 (diff)
DRM/i915: Remove i965_hpd_irq_setup.
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>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c53
1 files changed, 18 insertions, 35 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 64c79a0cb570..666a0ecebb12 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -2526,25 +2526,6 @@ static int i915_irq_postinstall(struct drm_device *dev)
2526 return 0; 2526 return 0;
2527} 2527}
2528 2528
2529static void i915_hpd_irq_setup(struct drm_device *dev)
2530{
2531 if (I915_HAS_HOTPLUG(dev)) {
2532 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
2533 struct drm_mode_config *mode_config = &dev->mode_config;
2534 struct intel_encoder *encoder;
2535 u32 hotplug_en = I915_READ(PORT_HOTPLUG_EN);
2536
2537 hotplug_en &= ~HOTPLUG_INT_EN_MASK;
2538 list_for_each_entry(encoder, &mode_config->encoder_list, base.head)
2539 hotplug_en |= hpd_mask_i915[encoder->hpd_pin];
2540 hotplug_en |= CRT_HOTPLUG_VOLTAGE_COMPARE_50;
2541
2542 /* Ignore TV since it's buggy */
2543
2544 I915_WRITE(PORT_HOTPLUG_EN, hotplug_en);
2545 }
2546}
2547
2548/* 2529/*
2549 * Returns true when a page flip has completed. 2530 * Returns true when a page flip has completed.
2550 */ 2531 */
@@ -2774,29 +2755,31 @@ static int i965_irq_postinstall(struct drm_device *dev)
2774 return 0; 2755 return 0;
2775} 2756}
2776 2757
2777static void i965_hpd_irq_setup(struct drm_device *dev) 2758static void i915_hpd_irq_setup(struct drm_device *dev)
2778{ 2759{
2779 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; 2760 drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
2780 struct drm_mode_config *mode_config = &dev->mode_config; 2761 struct drm_mode_config *mode_config = &dev->mode_config;
2781 struct intel_encoder *encoder; 2762 struct intel_encoder *encoder;
2782 u32 hotplug_en; 2763 u32 hotplug_en;
2783 2764
2784 /* Note HDMI and DP share hotplug bits */ 2765 if (I915_HAS_HOTPLUG(dev)) {
2785 hotplug_en = 0; 2766 hotplug_en = I915_READ(PORT_HOTPLUG_EN);
2786 list_for_each_entry(encoder, &mode_config->encoder_list, base.head) 2767 hotplug_en &= ~HOTPLUG_INT_EN_MASK;
2768 /* Note HDMI and DP share hotplug bits */
2787 /* enable bits are the same for all generations */ 2769 /* enable bits are the same for all generations */
2788 hotplug_en |= hpd_mask_i915[encoder->hpd_pin]; 2770 list_for_each_entry(encoder, &mode_config->encoder_list, base.head)
2789 /* Programming the CRT detection parameters tends 2771 hotplug_en |= hpd_mask_i915[encoder->hpd_pin];
2790 to generate a spurious hotplug event about three 2772 /* Programming the CRT detection parameters tends
2791 seconds later. So just do it once. 2773 to generate a spurious hotplug event about three
2792 */ 2774 seconds later. So just do it once.
2793 if (IS_G4X(dev)) 2775 */
2794 hotplug_en |= CRT_HOTPLUG_ACTIVATION_PERIOD_64; 2776 if (IS_G4X(dev))
2795 hotplug_en |= CRT_HOTPLUG_VOLTAGE_COMPARE_50; 2777 hotplug_en |= CRT_HOTPLUG_ACTIVATION_PERIOD_64;
2796 2778 hotplug_en |= CRT_HOTPLUG_VOLTAGE_COMPARE_50;
2797 /* Ignore TV since it's buggy */
2798 2779
2799 I915_WRITE(PORT_HOTPLUG_EN, hotplug_en); 2780 /* Ignore TV since it's buggy */
2781 I915_WRITE(PORT_HOTPLUG_EN, hotplug_en);
2782 }
2800} 2783}
2801 2784
2802static irqreturn_t i965_irq_handler(int irq, void *arg) 2785static irqreturn_t i965_irq_handler(int irq, void *arg)
@@ -3008,7 +2991,7 @@ void intel_irq_init(struct drm_device *dev)
3008 dev->driver->irq_postinstall = i965_irq_postinstall; 2991 dev->driver->irq_postinstall = i965_irq_postinstall;
3009 dev->driver->irq_uninstall = i965_irq_uninstall; 2992 dev->driver->irq_uninstall = i965_irq_uninstall;
3010 dev->driver->irq_handler = i965_irq_handler; 2993 dev->driver->irq_handler = i965_irq_handler;
3011 dev_priv->display.hpd_irq_setup = i965_hpd_irq_setup; 2994 dev_priv->display.hpd_irq_setup = i915_hpd_irq_setup;
3012 } 2995 }
3013 dev->driver->enable_vblank = i915_enable_vblank; 2996 dev->driver->enable_vblank = i915_enable_vblank;
3014 dev->driver->disable_vblank = i915_disable_vblank; 2997 dev->driver->disable_vblank = i915_disable_vblank;