diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-06-27 11:52:14 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-07-01 05:14:58 -0400 |
commit | 91d131d21e4916f84e5957cc25bea6dd355dfe77 (patch) | |
tree | 2238af6ccab610e0bca4d1a70987950d59b5e9bb /drivers | |
parent | 5876fa0d9e9097d980a72152f4967a52b1adaaac (diff) |
drm/i915: fold the no-irq check into intel_hpd_irq_handler
The usual pattern for our sub-function irq_handlers is that they check
for the no-irq case themselves. This results in more streamlined code
in the upper irq handlers.
v2: Rebase on top of the i965g/gm sdvo hpd fix.
Cc: Egbert Eich <eich@suse.de>
Reviewed-by: Egbert Eich <eich@suse.de>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 531df31075d2..b29b76fe1123 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -881,6 +881,9 @@ static inline void intel_hpd_irq_handler(struct drm_device *dev, | |||
881 | int i; | 881 | int i; |
882 | bool storm_detected = false; | 882 | bool storm_detected = false; |
883 | 883 | ||
884 | if (!hotplug_trigger) | ||
885 | return; | ||
886 | |||
884 | spin_lock_irqsave(&dev_priv->irq_lock, irqflags); | 887 | spin_lock_irqsave(&dev_priv->irq_lock, irqflags); |
885 | 888 | ||
886 | for (i = 1; i < HPD_NUM_PINS; i++) { | 889 | for (i = 1; i < HPD_NUM_PINS; i++) { |
@@ -1018,9 +1021,9 @@ static irqreturn_t valleyview_irq_handler(int irq, void *arg) | |||
1018 | 1021 | ||
1019 | DRM_DEBUG_DRIVER("hotplug event received, stat 0x%08x\n", | 1022 | DRM_DEBUG_DRIVER("hotplug event received, stat 0x%08x\n", |
1020 | hotplug_status); | 1023 | hotplug_status); |
1021 | if (hotplug_trigger) { | 1024 | |
1022 | intel_hpd_irq_handler(dev, hotplug_trigger, hpd_status_i915); | 1025 | intel_hpd_irq_handler(dev, hotplug_trigger, hpd_status_i915); |
1023 | } | 1026 | |
1024 | I915_WRITE(PORT_HOTPLUG_STAT, hotplug_status); | 1027 | I915_WRITE(PORT_HOTPLUG_STAT, hotplug_status); |
1025 | I915_READ(PORT_HOTPLUG_STAT); | 1028 | I915_READ(PORT_HOTPLUG_STAT); |
1026 | } | 1029 | } |
@@ -1046,9 +1049,8 @@ static void ibx_irq_handler(struct drm_device *dev, u32 pch_iir) | |||
1046 | int pipe; | 1049 | int pipe; |
1047 | u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK; | 1050 | u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK; |
1048 | 1051 | ||
1049 | if (hotplug_trigger) { | 1052 | intel_hpd_irq_handler(dev, hotplug_trigger, hpd_ibx); |
1050 | intel_hpd_irq_handler(dev, hotplug_trigger, hpd_ibx); | 1053 | |
1051 | } | ||
1052 | if (pch_iir & SDE_AUDIO_POWER_MASK) { | 1054 | if (pch_iir & SDE_AUDIO_POWER_MASK) { |
1053 | int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK) >> | 1055 | int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK) >> |
1054 | SDE_AUDIO_POWER_SHIFT); | 1056 | SDE_AUDIO_POWER_SHIFT); |
@@ -1149,9 +1151,8 @@ static void cpt_irq_handler(struct drm_device *dev, u32 pch_iir) | |||
1149 | int pipe; | 1151 | int pipe; |
1150 | u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK_CPT; | 1152 | u32 hotplug_trigger = pch_iir & SDE_HOTPLUG_MASK_CPT; |
1151 | 1153 | ||
1152 | if (hotplug_trigger) { | 1154 | intel_hpd_irq_handler(dev, hotplug_trigger, hpd_cpt); |
1153 | intel_hpd_irq_handler(dev, hotplug_trigger, hpd_cpt); | 1155 | |
1154 | } | ||
1155 | if (pch_iir & SDE_AUDIO_POWER_MASK_CPT) { | 1156 | if (pch_iir & SDE_AUDIO_POWER_MASK_CPT) { |
1156 | int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK_CPT) >> | 1157 | int port = ffs((pch_iir & SDE_AUDIO_POWER_MASK_CPT) >> |
1157 | SDE_AUDIO_POWER_SHIFT_CPT); | 1158 | SDE_AUDIO_POWER_SHIFT_CPT); |
@@ -3225,9 +3226,9 @@ static irqreturn_t i915_irq_handler(int irq, void *arg) | |||
3225 | 3226 | ||
3226 | DRM_DEBUG_DRIVER("hotplug event received, stat 0x%08x\n", | 3227 | DRM_DEBUG_DRIVER("hotplug event received, stat 0x%08x\n", |
3227 | hotplug_status); | 3228 | hotplug_status); |
3228 | if (hotplug_trigger) { | 3229 | |
3229 | intel_hpd_irq_handler(dev, hotplug_trigger, hpd_status_i915); | 3230 | intel_hpd_irq_handler(dev, hotplug_trigger, hpd_status_i915); |
3230 | } | 3231 | |
3231 | I915_WRITE(PORT_HOTPLUG_STAT, hotplug_status); | 3232 | I915_WRITE(PORT_HOTPLUG_STAT, hotplug_status); |
3232 | POSTING_READ(PORT_HOTPLUG_STAT); | 3233 | POSTING_READ(PORT_HOTPLUG_STAT); |
3233 | } | 3234 | } |
@@ -3463,10 +3464,10 @@ static irqreturn_t i965_irq_handler(int irq, void *arg) | |||
3463 | 3464 | ||
3464 | DRM_DEBUG_DRIVER("hotplug event received, stat 0x%08x\n", | 3465 | DRM_DEBUG_DRIVER("hotplug event received, stat 0x%08x\n", |
3465 | hotplug_status); | 3466 | hotplug_status); |
3466 | if (hotplug_trigger) { | 3467 | |
3467 | intel_hpd_irq_handler(dev, hotplug_trigger, | 3468 | intel_hpd_irq_handler(dev, hotplug_trigger, |
3468 | IS_G4X(dev) ? hpd_status_gen4 : hpd_status_i915); | 3469 | IS_G4X(dev) ? hpd_status_gen4 : hpd_status_i915); |
3469 | } | 3470 | |
3470 | I915_WRITE(PORT_HOTPLUG_STAT, hotplug_status); | 3471 | I915_WRITE(PORT_HOTPLUG_STAT, hotplug_status); |
3471 | I915_READ(PORT_HOTPLUG_STAT); | 3472 | I915_READ(PORT_HOTPLUG_STAT); |
3472 | } | 3473 | } |