aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index b29b76fe1123..3d92a7cef154 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -877,15 +877,13 @@ static inline void intel_hpd_irq_handler(struct drm_device *dev,
877 const u32 *hpd) 877 const u32 *hpd)
878{ 878{
879 drm_i915_private_t *dev_priv = dev->dev_private; 879 drm_i915_private_t *dev_priv = dev->dev_private;
880 unsigned long irqflags;
881 int i; 880 int i;
882 bool storm_detected = false; 881 bool storm_detected = false;
883 882
884 if (!hotplug_trigger) 883 if (!hotplug_trigger)
885 return; 884 return;
886 885
887 spin_lock_irqsave(&dev_priv->irq_lock, irqflags); 886 spin_lock(&dev_priv->irq_lock);
888
889 for (i = 1; i < HPD_NUM_PINS; i++) { 887 for (i = 1; i < HPD_NUM_PINS; i++) {
890 888
891 if (!(hpd[i] & hotplug_trigger) || 889 if (!(hpd[i] & hotplug_trigger) ||
@@ -908,10 +906,9 @@ static inline void intel_hpd_irq_handler(struct drm_device *dev,
908 } 906 }
909 } 907 }
910 908
911 spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
912
913 if (storm_detected) 909 if (storm_detected)
914 dev_priv->display.hpd_irq_setup(dev); 910 dev_priv->display.hpd_irq_setup(dev);
911 spin_unlock(&dev_priv->irq_lock);
915 912
916 queue_work(dev_priv->wq, 913 queue_work(dev_priv->wq,
917 &dev_priv->hotplug_work); 914 &dev_priv->hotplug_work);
@@ -3380,6 +3377,8 @@ static void i915_hpd_irq_setup(struct drm_device *dev)
3380 struct intel_encoder *intel_encoder; 3377 struct intel_encoder *intel_encoder;
3381 u32 hotplug_en; 3378 u32 hotplug_en;
3382 3379
3380 assert_spin_locked(&dev_priv->irq_lock);
3381
3383 if (I915_HAS_HOTPLUG(dev)) { 3382 if (I915_HAS_HOTPLUG(dev)) {
3384 hotplug_en = I915_READ(PORT_HOTPLUG_EN); 3383 hotplug_en = I915_READ(PORT_HOTPLUG_EN);
3385 hotplug_en &= ~HOTPLUG_INT_EN_MASK; 3384 hotplug_en &= ~HOTPLUG_INT_EN_MASK;
@@ -3663,6 +3662,7 @@ void intel_hpd_init(struct drm_device *dev)
3663 struct drm_i915_private *dev_priv = dev->dev_private; 3662 struct drm_i915_private *dev_priv = dev->dev_private;
3664 struct drm_mode_config *mode_config = &dev->mode_config; 3663 struct drm_mode_config *mode_config = &dev->mode_config;
3665 struct drm_connector *connector; 3664 struct drm_connector *connector;
3665 unsigned long irqflags;
3666 int i; 3666 int i;
3667 3667
3668 for (i = 1; i < HPD_NUM_PINS; i++) { 3668 for (i = 1; i < HPD_NUM_PINS; i++) {
@@ -3675,6 +3675,11 @@ void intel_hpd_init(struct drm_device *dev)
3675 if (!connector->polled && I915_HAS_HOTPLUG(dev) && intel_connector->encoder->hpd_pin > HPD_NONE) 3675 if (!connector->polled && I915_HAS_HOTPLUG(dev) && intel_connector->encoder->hpd_pin > HPD_NONE)
3676 connector->polled = DRM_CONNECTOR_POLL_HPD; 3676 connector->polled = DRM_CONNECTOR_POLL_HPD;
3677 } 3677 }
3678
3679 /* Interrupt setup is already guaranteed to be single-threaded, this is
3680 * just to make the assert_spin_locked checks happy. */
3681 spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
3678 if (dev_priv->display.hpd_irq_setup) 3682 if (dev_priv->display.hpd_irq_setup)
3679 dev_priv->display.hpd_irq_setup(dev); 3683 dev_priv->display.hpd_irq_setup(dev);
3684 spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
3680} 3685}