Lines Matching +full:pin +full:- +full:count
54 * pulses, with failures and non-MST long pulses triggering regular hotplug
65 * number of interrupts per hotplug pin per a period of time, and if the number
67 * while before being re-enabled. The intention is to mitigate issues raising
81 * intel_hpd_pin_default - return default pin associated with certain port.
83 * @port: the hpd port to get associated pin
87 * Return pin that is associatade with @port.
92 return HPD_PORT_A + port - PORT_A; in intel_hpd_pin_default()
113 return encoder ? encoder->hpd_pin : HPD_NONE; in intel_connector_hpd_pin()
117 * intel_hpd_irq_storm_detect - gather stats and detect HPD IRQ storm on a pin
119 * @pin: the pin to gather stats on
122 * Gather stats about HPD IRQs from the specified @pin, and detect IRQ
123 * storms. Only the pin specific stats and state are changed, the caller is
127 * stored in @dev_priv->display.hotplug.hpd_storm_threshold which defaults to
128 * @HPD_STORM_DEFAULT_THRESHOLD. Long IRQs count as +10 to this threshold, and
129 * short IRQs count as +1. If this threshold is exceeded, it's considered an
132 * By default, most systems will only count long IRQs towards
133 * &dev_priv->display.hotplug.hpd_storm_threshold. However, some older systems also
143 * Return true if an IRQ storm was detected on @pin.
146 enum hpd_pin pin, bool long_hpd) in intel_hpd_irq_storm_detect() argument
148 struct intel_hotplug *hpd = &dev_priv->display.hotplug; in intel_hpd_irq_storm_detect()
149 unsigned long start = hpd->stats[pin].last_jiffies; in intel_hpd_irq_storm_detect()
152 const int threshold = hpd->hpd_storm_threshold; in intel_hpd_irq_storm_detect()
156 (!long_hpd && !dev_priv->display.hotplug.hpd_short_storm_enabled)) in intel_hpd_irq_storm_detect()
160 hpd->stats[pin].last_jiffies = jiffies; in intel_hpd_irq_storm_detect()
161 hpd->stats[pin].count = 0; in intel_hpd_irq_storm_detect()
164 hpd->stats[pin].count += increment; in intel_hpd_irq_storm_detect()
165 if (hpd->stats[pin].count > threshold) { in intel_hpd_irq_storm_detect()
166 hpd->stats[pin].state = HPD_MARK_DISABLED; in intel_hpd_irq_storm_detect()
167 drm_dbg_kms(&dev_priv->drm, in intel_hpd_irq_storm_detect()
168 "HPD interrupt storm detected on PIN %d\n", pin); in intel_hpd_irq_storm_detect()
171 drm_dbg_kms(&dev_priv->drm, in intel_hpd_irq_storm_detect()
172 "Received HPD interrupt on PIN %d - cnt: %d\n", in intel_hpd_irq_storm_detect()
173 pin, in intel_hpd_irq_storm_detect()
174 hpd->stats[pin].count); in intel_hpd_irq_storm_detect()
182 lockdep_assert_held(&i915->irq_lock); in detection_work_enabled()
184 return i915->display.hotplug.detection_work_enabled; in detection_work_enabled()
190 lockdep_assert_held(&i915->irq_lock); in mod_delayed_detection_work()
195 return mod_delayed_work(i915->unordered_wq, work, delay); in mod_delayed_detection_work()
201 lockdep_assert_held(&i915->irq_lock); in queue_delayed_detection_work()
206 return queue_delayed_work(i915->unordered_wq, work, delay); in queue_delayed_detection_work()
212 lockdep_assert_held(&i915->irq_lock); in queue_detection_work()
217 return queue_work(i915->unordered_wq, work); in queue_detection_work()
227 lockdep_assert_held(&dev_priv->irq_lock); in intel_hpd_irq_storm_switch_to_polling()
229 drm_connector_list_iter_begin(&dev_priv->drm, &conn_iter); in intel_hpd_irq_storm_switch_to_polling()
231 enum hpd_pin pin; in intel_hpd_irq_storm_switch_to_polling() local
233 if (connector->base.polled != DRM_CONNECTOR_POLL_HPD) in intel_hpd_irq_storm_switch_to_polling()
236 pin = intel_connector_hpd_pin(connector); in intel_hpd_irq_storm_switch_to_polling()
237 if (pin == HPD_NONE || in intel_hpd_irq_storm_switch_to_polling()
238 dev_priv->display.hotplug.stats[pin].state != HPD_MARK_DISABLED) in intel_hpd_irq_storm_switch_to_polling()
241 drm_info(&dev_priv->drm, in intel_hpd_irq_storm_switch_to_polling()
244 connector->base.name); in intel_hpd_irq_storm_switch_to_polling()
246 dev_priv->display.hotplug.stats[pin].state = HPD_DISABLED; in intel_hpd_irq_storm_switch_to_polling()
247 connector->base.polled = DRM_CONNECTOR_POLL_CONNECT | in intel_hpd_irq_storm_switch_to_polling()
253 /* Enable polling and queue hotplug re-enabling. */ in intel_hpd_irq_storm_switch_to_polling()
255 drm_kms_helper_poll_reschedule(&dev_priv->drm); in intel_hpd_irq_storm_switch_to_polling()
257 &dev_priv->display.hotplug.reenable_work, in intel_hpd_irq_storm_switch_to_polling()
270 enum hpd_pin pin; in intel_hpd_irq_storm_reenable_work() local
272 wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm); in intel_hpd_irq_storm_reenable_work()
274 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_irq_storm_reenable_work()
276 drm_connector_list_iter_begin(&dev_priv->drm, &conn_iter); in intel_hpd_irq_storm_reenable_work()
278 pin = intel_connector_hpd_pin(connector); in intel_hpd_irq_storm_reenable_work()
279 if (pin == HPD_NONE || in intel_hpd_irq_storm_reenable_work()
280 dev_priv->display.hotplug.stats[pin].state != HPD_DISABLED) in intel_hpd_irq_storm_reenable_work()
283 if (connector->base.polled != connector->polled) in intel_hpd_irq_storm_reenable_work()
284 drm_dbg(&dev_priv->drm, in intel_hpd_irq_storm_reenable_work()
286 connector->base.name); in intel_hpd_irq_storm_reenable_work()
287 connector->base.polled = connector->polled; in intel_hpd_irq_storm_reenable_work()
291 for_each_hpd_pin(pin) { in intel_hpd_irq_storm_reenable_work()
292 if (dev_priv->display.hotplug.stats[pin].state == HPD_DISABLED) in intel_hpd_irq_storm_reenable_work()
293 dev_priv->display.hotplug.stats[pin].state = HPD_ENABLED; in intel_hpd_irq_storm_reenable_work()
298 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_irq_storm_reenable_work()
300 intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref); in intel_hpd_irq_storm_reenable_work()
306 struct drm_device *dev = connector->base.dev; in intel_hotplug_detect_connector()
312 drm_WARN_ON(dev, !mutex_is_locked(&dev->mode_config.mutex)); in intel_hotplug_detect_connector()
313 old_status = connector->base.status; in intel_hotplug_detect_connector()
314 old_epoch_counter = connector->base.epoch_counter; in intel_hotplug_detect_connector()
316 status = drm_helper_probe_detect(&connector->base, NULL, false); in intel_hotplug_detect_connector()
317 if (!connector->base.force) in intel_hotplug_detect_connector()
318 connector->base.status = status; in intel_hotplug_detect_connector()
320 if (old_epoch_counter != connector->base.epoch_counter) in intel_hotplug_detect_connector()
324 drm_dbg_kms(dev, "[CONNECTOR:%d:%s] status updated from %s to %s (epoch counter %llu->%llu)\n", in intel_hotplug_detect_connector()
325 connector->base.base.id, in intel_hotplug_detect_connector()
326 connector->base.name, in intel_hotplug_detect_connector()
328 drm_get_connector_status_name(connector->base.status), in intel_hotplug_detect_connector()
330 connector->base.epoch_counter); in intel_hotplug_detect_connector()
346 enc_to_dig_port(encoder)->hpd_pulse != NULL; in intel_encoder_has_hpd_pulse()
357 spin_lock_irq(&dev_priv->irq_lock); in i915_digport_work_func()
358 long_port_mask = dev_priv->display.hotplug.long_port_mask; in i915_digport_work_func()
359 dev_priv->display.hotplug.long_port_mask = 0; in i915_digport_work_func()
360 short_port_mask = dev_priv->display.hotplug.short_port_mask; in i915_digport_work_func()
361 dev_priv->display.hotplug.short_port_mask = 0; in i915_digport_work_func()
362 spin_unlock_irq(&dev_priv->irq_lock); in i915_digport_work_func()
364 for_each_intel_encoder(&dev_priv->drm, encoder) { in i915_digport_work_func()
366 enum port port = encoder->port; in i915_digport_work_func()
381 ret = dig_port->hpd_pulse(dig_port, long_hpd); in i915_digport_work_func()
384 old_bits |= BIT(encoder->hpd_pin); in i915_digport_work_func()
389 spin_lock_irq(&dev_priv->irq_lock); in i915_digport_work_func()
390 dev_priv->display.hotplug.event_bits |= old_bits; in i915_digport_work_func()
392 &dev_priv->display.hotplug.hotplug_work, 0); in i915_digport_work_func()
393 spin_unlock_irq(&dev_priv->irq_lock); in i915_digport_work_func()
398 * intel_hpd_trigger_irq - trigger an hpd irq event for a port
406 struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); in intel_hpd_trigger_irq()
408 spin_lock_irq(&i915->irq_lock); in intel_hpd_trigger_irq()
409 i915->display.hotplug.short_port_mask |= BIT(dig_port->base.port); in intel_hpd_trigger_irq()
410 spin_unlock_irq(&i915->irq_lock); in intel_hpd_trigger_irq()
412 queue_work(i915->display.hotplug.dp_wq, &i915->display.hotplug.dig_port_work); in intel_hpd_trigger_irq()
431 mutex_lock(&dev_priv->drm.mode_config.mutex); in i915_hotplug_work_func()
432 drm_dbg_kms(&dev_priv->drm, "running encoder hotplug functions\n"); in i915_hotplug_work_func()
434 spin_lock_irq(&dev_priv->irq_lock); in i915_hotplug_work_func()
436 hpd_event_bits = dev_priv->display.hotplug.event_bits; in i915_hotplug_work_func()
437 dev_priv->display.hotplug.event_bits = 0; in i915_hotplug_work_func()
438 hpd_retry_bits = dev_priv->display.hotplug.retry_bits; in i915_hotplug_work_func()
439 dev_priv->display.hotplug.retry_bits = 0; in i915_hotplug_work_func()
444 spin_unlock_irq(&dev_priv->irq_lock); in i915_hotplug_work_func()
447 if (dev_priv->display.hotplug.ignore_long_hpd) { in i915_hotplug_work_func()
448 drm_dbg_kms(&dev_priv->drm, "Ignore HPD flag on - skip encoder hotplug handlers\n"); in i915_hotplug_work_func()
449 mutex_unlock(&dev_priv->drm.mode_config.mutex); in i915_hotplug_work_func()
453 drm_connector_list_iter_begin(&dev_priv->drm, &conn_iter); in i915_hotplug_work_func()
455 enum hpd_pin pin; in i915_hotplug_work_func() local
458 pin = intel_connector_hpd_pin(connector); in i915_hotplug_work_func()
459 if (pin == HPD_NONE) in i915_hotplug_work_func()
462 hpd_bit = BIT(pin); in i915_hotplug_work_func()
468 connector->hotplug_retries = 0; in i915_hotplug_work_func()
470 connector->hotplug_retries++; in i915_hotplug_work_func()
472 drm_dbg_kms(&dev_priv->drm, in i915_hotplug_work_func()
473 "Connector %s (pin %i) received hotplug event. (retry %d)\n", in i915_hotplug_work_func()
474 connector->base.name, pin, in i915_hotplug_work_func()
475 connector->hotplug_retries); in i915_hotplug_work_func()
477 switch (encoder->hotplug(encoder, connector)) { in i915_hotplug_work_func()
484 drm_connector_get(&connector->base); in i915_hotplug_work_func()
485 first_changed_connector = &connector->base; in i915_hotplug_work_func()
495 mutex_unlock(&dev_priv->drm.mode_config.mutex); in i915_hotplug_work_func()
500 drm_kms_helper_hotplug_event(&dev_priv->drm); in i915_hotplug_work_func()
508 spin_lock_irq(&dev_priv->irq_lock); in i915_hotplug_work_func()
509 dev_priv->display.hotplug.retry_bits |= retry; in i915_hotplug_work_func()
512 &dev_priv->display.hotplug.hotplug_work, in i915_hotplug_work_func()
514 spin_unlock_irq(&dev_priv->irq_lock); in i915_hotplug_work_func()
520 * intel_hpd_irq_handler - main hotplug irq handler
529 * (@long_mask). The @long_mask is ignored if the port corresponding to the pin
543 enum hpd_pin pin; in intel_hpd_irq_handler() local
548 spin_lock(&dev_priv->irq_lock); in intel_hpd_irq_handler()
551 * Determine whether ->hpd_pulse() exists for each pin, and in intel_hpd_irq_handler()
553 * as each pin may have up to two encoders (HDMI and DP) and in intel_hpd_irq_handler()
554 * only the one of them (DP) will have ->hpd_pulse(). in intel_hpd_irq_handler()
556 for_each_intel_encoder(&dev_priv->drm, encoder) { in intel_hpd_irq_handler()
557 enum port port = encoder->port; in intel_hpd_irq_handler()
560 pin = encoder->hpd_pin; in intel_hpd_irq_handler()
561 if (!(BIT(pin) & pin_mask)) in intel_hpd_irq_handler()
567 long_hpd = long_mask & BIT(pin); in intel_hpd_irq_handler()
569 drm_dbg(&dev_priv->drm, in intel_hpd_irq_handler()
570 "digital hpd on [ENCODER:%d:%s] - %s\n", in intel_hpd_irq_handler()
571 encoder->base.base.id, encoder->base.name, in intel_hpd_irq_handler()
576 long_hpd_pulse_mask |= BIT(pin); in intel_hpd_irq_handler()
577 dev_priv->display.hotplug.long_port_mask |= BIT(port); in intel_hpd_irq_handler()
579 short_hpd_pulse_mask |= BIT(pin); in intel_hpd_irq_handler()
580 dev_priv->display.hotplug.short_port_mask |= BIT(port); in intel_hpd_irq_handler()
584 /* Now process each pin just once */ in intel_hpd_irq_handler()
585 for_each_hpd_pin(pin) { in intel_hpd_irq_handler()
588 if (!(BIT(pin) & pin_mask)) in intel_hpd_irq_handler()
591 if (dev_priv->display.hotplug.stats[pin].state == HPD_DISABLED) { in intel_hpd_irq_handler()
598 drm_WARN_ONCE(&dev_priv->drm, !HAS_GMCH(dev_priv), in intel_hpd_irq_handler()
599 "Received HPD interrupt on pin %d although disabled\n", in intel_hpd_irq_handler()
600 pin); in intel_hpd_irq_handler()
604 if (dev_priv->display.hotplug.stats[pin].state != HPD_ENABLED) in intel_hpd_irq_handler()
608 * Delegate to ->hpd_pulse() if one of the encoders for this in intel_hpd_irq_handler()
609 * pin has it, otherwise let the hotplug_work deal with this in intel_hpd_irq_handler()
610 * pin directly. in intel_hpd_irq_handler()
612 if (((short_hpd_pulse_mask | long_hpd_pulse_mask) & BIT(pin))) { in intel_hpd_irq_handler()
613 long_hpd = long_hpd_pulse_mask & BIT(pin); in intel_hpd_irq_handler()
615 dev_priv->display.hotplug.event_bits |= BIT(pin); in intel_hpd_irq_handler()
620 if (intel_hpd_irq_storm_detect(dev_priv, pin, long_hpd)) { in intel_hpd_irq_handler()
621 dev_priv->display.hotplug.event_bits &= ~BIT(pin); in intel_hpd_irq_handler()
636 * fb helpers). Hence it must not be run on our own dev-priv->wq work in intel_hpd_irq_handler()
641 queue_work(dev_priv->display.hotplug.dp_wq, &dev_priv->display.hotplug.dig_port_work); in intel_hpd_irq_handler()
644 &dev_priv->display.hotplug.hotplug_work, 0); in intel_hpd_irq_handler()
646 spin_unlock(&dev_priv->irq_lock); in intel_hpd_irq_handler()
650 * intel_hpd_init - initializes and enables hpd support
671 dev_priv->display.hotplug.stats[i].count = 0; in intel_hpd_init()
672 dev_priv->display.hotplug.stats[i].state = HPD_ENABLED; in intel_hpd_init()
676 * Interrupt setup is already guaranteed to be single-threaded, this is in intel_hpd_init()
679 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_init()
681 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_init()
691 mutex_lock(&i915->drm.mode_config.mutex); in i915_hpd_poll_detect_connectors()
693 if (!i915->drm.mode_config.poll_enabled) in i915_hpd_poll_detect_connectors()
696 drm_connector_list_iter_begin(&i915->drm, &conn_iter); in i915_hpd_poll_detect_connectors()
698 if (!(connector->base.polled & DRM_CONNECTOR_POLL_HPD)) in i915_hpd_poll_detect_connectors()
707 drm_connector_get(&connector->base); in i915_hpd_poll_detect_connectors()
714 mutex_unlock(&i915->drm.mode_config.mutex); in i915_hpd_poll_detect_connectors()
720 drm_kms_helper_connector_hotplug_event(&first_changed_connector->base); in i915_hpd_poll_detect_connectors()
722 drm_kms_helper_hotplug_event(&i915->drm); in i915_hpd_poll_detect_connectors()
724 drm_connector_put(&first_changed_connector->base); in i915_hpd_poll_detect_connectors()
737 mutex_lock(&dev_priv->drm.mode_config.mutex); in i915_hpd_poll_init_work()
739 enabled = READ_ONCE(dev_priv->display.hotplug.poll_enabled); in i915_hpd_poll_init_work()
742 * i915_hpd_poll_init_work() -> drm_helper_hpd_irq_event() -> in i915_hpd_poll_init_work()
749 drm_WARN_ON(&dev_priv->drm, in i915_hpd_poll_init_work()
750 READ_ONCE(dev_priv->display.hotplug.poll_enabled)); in i915_hpd_poll_init_work()
751 cancel_work(&dev_priv->display.hotplug.poll_init_work); in i915_hpd_poll_init_work()
754 spin_lock_irq(&dev_priv->irq_lock); in i915_hpd_poll_init_work()
756 drm_connector_list_iter_begin(&dev_priv->drm, &conn_iter); in i915_hpd_poll_init_work()
758 enum hpd_pin pin; in i915_hpd_poll_init_work() local
760 pin = intel_connector_hpd_pin(connector); in i915_hpd_poll_init_work()
761 if (pin == HPD_NONE) in i915_hpd_poll_init_work()
764 if (dev_priv->display.hotplug.stats[pin].state == HPD_DISABLED) in i915_hpd_poll_init_work()
767 connector->base.polled = connector->polled; in i915_hpd_poll_init_work()
769 if (enabled && connector->base.polled == DRM_CONNECTOR_POLL_HPD) in i915_hpd_poll_init_work()
770 connector->base.polled = DRM_CONNECTOR_POLL_CONNECT | in i915_hpd_poll_init_work()
775 spin_unlock_irq(&dev_priv->irq_lock); in i915_hpd_poll_init_work()
778 drm_kms_helper_poll_reschedule(&dev_priv->drm); in i915_hpd_poll_init_work()
780 mutex_unlock(&dev_priv->drm.mode_config.mutex); in i915_hpd_poll_init_work()
796 * intel_hpd_poll_enable - enable polling for connectors with hpd
806 * dev->mode_config.mutex, we do the actual hotplug enabling in a seperate
817 WRITE_ONCE(dev_priv->display.hotplug.poll_enabled, true); in intel_hpd_poll_enable()
820 * We might already be holding dev->mode_config.mutex, so do this in a in intel_hpd_poll_enable()
825 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_poll_enable()
827 &dev_priv->display.hotplug.poll_init_work); in intel_hpd_poll_enable()
828 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_poll_enable()
832 * intel_hpd_poll_disable - disable polling for connectors with hpd
842 * dev->mode_config.mutex, we do the actual hotplug enabling in a seperate
845 * Also used during driver init to initialize connector->polled
855 WRITE_ONCE(dev_priv->display.hotplug.poll_enabled, false); in intel_hpd_poll_disable()
857 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_poll_disable()
859 &dev_priv->display.hotplug.poll_init_work); in intel_hpd_poll_disable()
860 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_poll_disable()
865 INIT_DELAYED_WORK(&i915->display.hotplug.hotplug_work, in intel_hpd_init_early()
867 INIT_WORK(&i915->display.hotplug.dig_port_work, i915_digport_work_func); in intel_hpd_init_early()
868 INIT_WORK(&i915->display.hotplug.poll_init_work, i915_hpd_poll_init_work); in intel_hpd_init_early()
869 INIT_DELAYED_WORK(&i915->display.hotplug.reenable_work, in intel_hpd_init_early()
872 i915->display.hotplug.hpd_storm_threshold = HPD_STORM_DEFAULT_THRESHOLD; in intel_hpd_init_early()
879 i915->display.hotplug.hpd_short_storm_enabled = !HAS_DP_MST(i915); in intel_hpd_init_early()
886 if (cancel_delayed_work_sync(&i915->display.hotplug.hotplug_work)) in cancel_all_detection_work()
888 if (cancel_work_sync(&i915->display.hotplug.poll_init_work)) in cancel_all_detection_work()
890 if (cancel_delayed_work_sync(&i915->display.hotplug.reenable_work)) in cancel_all_detection_work()
901 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_cancel_work()
903 dev_priv->display.hotplug.long_port_mask = 0; in intel_hpd_cancel_work()
904 dev_priv->display.hotplug.short_port_mask = 0; in intel_hpd_cancel_work()
905 dev_priv->display.hotplug.event_bits = 0; in intel_hpd_cancel_work()
906 dev_priv->display.hotplug.retry_bits = 0; in intel_hpd_cancel_work()
908 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_cancel_work()
910 cancel_work_sync(&dev_priv->display.hotplug.dig_port_work); in intel_hpd_cancel_work()
917 drm_dbg_kms(&dev_priv->drm, "Hotplug detection work still active\n"); in intel_hpd_cancel_work()
920 bool intel_hpd_disable(struct drm_i915_private *dev_priv, enum hpd_pin pin) in intel_hpd_disable() argument
924 if (pin == HPD_NONE) in intel_hpd_disable()
927 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_disable()
928 if (dev_priv->display.hotplug.stats[pin].state == HPD_ENABLED) { in intel_hpd_disable()
929 dev_priv->display.hotplug.stats[pin].state = HPD_DISABLED; in intel_hpd_disable()
932 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_disable()
937 void intel_hpd_enable(struct drm_i915_private *dev_priv, enum hpd_pin pin) in intel_hpd_enable() argument
939 if (pin == HPD_NONE) in intel_hpd_enable()
942 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_enable()
943 dev_priv->display.hotplug.stats[pin].state = HPD_ENABLED; in intel_hpd_enable()
944 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_enable()
950 enum hpd_pin pin; in queue_work_for_missed_irqs() local
952 lockdep_assert_held(&i915->irq_lock); in queue_work_for_missed_irqs()
954 if (i915->display.hotplug.event_bits || in queue_work_for_missed_irqs()
955 i915->display.hotplug.retry_bits) in queue_work_for_missed_irqs()
958 for_each_hpd_pin(pin) { in queue_work_for_missed_irqs()
959 switch (i915->display.hotplug.stats[pin].state) { in queue_work_for_missed_irqs()
966 MISSING_CASE(i915->display.hotplug.stats[pin].state); in queue_work_for_missed_irqs()
971 queue_delayed_detection_work(i915, &i915->display.hotplug.hotplug_work, 0); in queue_work_for_missed_irqs()
976 spin_lock_irq(&i915->irq_lock); in intel_hpd_enable_detection_work()
977 i915->display.hotplug.detection_work_enabled = true; in intel_hpd_enable_detection_work()
979 spin_unlock_irq(&i915->irq_lock); in intel_hpd_enable_detection_work()
984 spin_lock_irq(&i915->irq_lock); in intel_hpd_disable_detection_work()
985 i915->display.hotplug.detection_work_enabled = false; in intel_hpd_disable_detection_work()
986 spin_unlock_irq(&i915->irq_lock); in intel_hpd_disable_detection_work()
996 spin_lock_irqsave(&i915->irq_lock, flags); in intel_hpd_schedule_detection()
997 ret = queue_delayed_detection_work(i915, &i915->display.hotplug.hotplug_work, 0); in intel_hpd_schedule_detection()
998 spin_unlock_irqrestore(&i915->irq_lock, flags); in intel_hpd_schedule_detection()
1005 struct drm_i915_private *dev_priv = m->private; in i915_hpd_storm_ctl_show()
1006 struct intel_hotplug *hotplug = &dev_priv->display.hotplug; in i915_hpd_storm_ctl_show()
1012 flush_work(&dev_priv->display.hotplug.dig_port_work); in i915_hpd_storm_ctl_show()
1013 flush_delayed_work(&dev_priv->display.hotplug.hotplug_work); in i915_hpd_storm_ctl_show()
1015 seq_printf(m, "Threshold: %d\n", hotplug->hpd_storm_threshold); in i915_hpd_storm_ctl_show()
1017 str_yes_no(delayed_work_pending(&hotplug->reenable_work))); in i915_hpd_storm_ctl_show()
1026 struct seq_file *m = file->private_data; in i915_hpd_storm_ctl_write()
1027 struct drm_i915_private *dev_priv = m->private; in i915_hpd_storm_ctl_write()
1028 struct intel_hotplug *hotplug = &dev_priv->display.hotplug; in i915_hpd_storm_ctl_write()
1035 return -EINVAL; in i915_hpd_storm_ctl_write()
1038 return -EFAULT; in i915_hpd_storm_ctl_write()
1050 return -EINVAL; in i915_hpd_storm_ctl_write()
1053 drm_dbg_kms(&dev_priv->drm, in i915_hpd_storm_ctl_write()
1057 drm_dbg_kms(&dev_priv->drm, "Disabling HPD storm detection\n"); in i915_hpd_storm_ctl_write()
1059 spin_lock_irq(&dev_priv->irq_lock); in i915_hpd_storm_ctl_write()
1060 hotplug->hpd_storm_threshold = new_threshold; in i915_hpd_storm_ctl_write()
1063 hotplug->stats[i].count = 0; in i915_hpd_storm_ctl_write()
1064 spin_unlock_irq(&dev_priv->irq_lock); in i915_hpd_storm_ctl_write()
1066 /* Re-enable hpd immediately if we were in an irq storm */ in i915_hpd_storm_ctl_write()
1067 flush_delayed_work(&dev_priv->display.hotplug.reenable_work); in i915_hpd_storm_ctl_write()
1074 return single_open(file, i915_hpd_storm_ctl_show, inode->i_private); in i915_hpd_storm_ctl_open()
1088 struct drm_i915_private *dev_priv = m->private; in i915_hpd_short_storm_ctl_show()
1091 str_yes_no(dev_priv->display.hotplug.hpd_short_storm_enabled)); in i915_hpd_short_storm_ctl_show()
1100 inode->i_private); in i915_hpd_short_storm_ctl_open()
1107 struct seq_file *m = file->private_data; in i915_hpd_short_storm_ctl_write()
1108 struct drm_i915_private *dev_priv = m->private; in i915_hpd_short_storm_ctl_write()
1109 struct intel_hotplug *hotplug = &dev_priv->display.hotplug; in i915_hpd_short_storm_ctl_write()
1116 return -EINVAL; in i915_hpd_short_storm_ctl_write()
1119 return -EFAULT; in i915_hpd_short_storm_ctl_write()
1132 return -EINVAL; in i915_hpd_short_storm_ctl_write()
1134 drm_dbg_kms(&dev_priv->drm, "%sabling HPD short storm detection\n", in i915_hpd_short_storm_ctl_write()
1137 spin_lock_irq(&dev_priv->irq_lock); in i915_hpd_short_storm_ctl_write()
1138 hotplug->hpd_short_storm_enabled = new_state; in i915_hpd_short_storm_ctl_write()
1141 hotplug->stats[i].count = 0; in i915_hpd_short_storm_ctl_write()
1142 spin_unlock_irq(&dev_priv->irq_lock); in i915_hpd_short_storm_ctl_write()
1144 /* Re-enable hpd immediately if we were in an irq storm */ in i915_hpd_short_storm_ctl_write()
1145 flush_delayed_work(&dev_priv->display.hotplug.reenable_work); in i915_hpd_short_storm_ctl_write()
1161 struct drm_minor *minor = i915->drm.primary; in intel_hpd_debugfs_register()
1163 debugfs_create_file("i915_hpd_storm_ctl", 0644, minor->debugfs_root, in intel_hpd_debugfs_register()
1165 debugfs_create_file("i915_hpd_short_storm_ctl", 0644, minor->debugfs_root, in intel_hpd_debugfs_register()
1167 debugfs_create_bool("i915_ignore_long_hpd", 0644, minor->debugfs_root, in intel_hpd_debugfs_register()
1168 &i915->display.hotplug.ignore_long_hpd); in intel_hpd_debugfs_register()