Lines Matching full:hotplug
31 * DOC: Hotplug
33 * Simply put, hotplug occurs when a display is connected to or disconnected
37 * Hotplug in i915 is handled in many different levels of abstraction.
41 * handlers gather the hotplug detect (HPD) information from relevant registers
42 * into a platform independent mask of hotplug pins that have fired.
45 * intel_hotplug.c does hotplug irq storm detection and mitigation, and passes
47 * regular hotplug).
51 * pulses, with failures and non-MST long pulses triggering regular hotplug
54 * The regular hotplug work function i915_hotplug_work_func() calls connector
55 * detect hooks, and, if connector status changes, triggers sending of hotplug
59 * the hotplug uevent, disabling or enabling the crtc as needed.
61 * The hotplug interrupt storm detection and mitigation code keeps track of the
62 * number of interrupts per hotplug pin per a period of time, and if the number
68 * Current implementation expects that hotplug interrupt storm will not be
121 * stored in @dev_priv->hotplug.hpd_storm_threshold which defaults to
127 * &dev_priv->hotplug.hpd_storm_threshold. However, some older systems also
135 * and should only be adjusted for automated hotplug testing.
142 struct i915_hotplug *hpd = &dev_priv->hotplug; in intel_hpd_irq_storm_detect()
150 (!long_hpd && !dev_priv->hotplug.hpd_short_storm_enabled)) in intel_hpd_irq_storm_detect()
193 dev_priv->hotplug.stats[pin].state != HPD_MARK_DISABLED) in intel_hpd_irq_storm_switch_to_polling()
198 "switching from hotplug detection to polling\n", in intel_hpd_irq_storm_switch_to_polling()
201 dev_priv->hotplug.stats[pin].state = HPD_DISABLED; in intel_hpd_irq_storm_switch_to_polling()
208 /* Enable polling and queue hotplug re-enabling. */ in intel_hpd_irq_storm_switch_to_polling()
211 mod_delayed_work(system_wq, &dev_priv->hotplug.reenable_work, in intel_hpd_irq_storm_switch_to_polling()
220 hotplug.reenable_work.work); in intel_hpd_irq_storm_reenable_work()
235 dev_priv->hotplug.stats[pin].state != HPD_DISABLED) in intel_hpd_irq_storm_reenable_work()
247 if (dev_priv->hotplug.stats[pin].state == HPD_DISABLED) in intel_hpd_irq_storm_reenable_work()
248 dev_priv->hotplug.stats[pin].state = HPD_ENABLED; in intel_hpd_irq_storm_reenable_work()
300 container_of(work, struct drm_i915_private, hotplug.dig_port_work); in i915_digport_work_func()
306 long_port_mask = dev_priv->hotplug.long_port_mask; in i915_digport_work_func()
307 dev_priv->hotplug.long_port_mask = 0; in i915_digport_work_func()
308 short_port_mask = dev_priv->hotplug.short_port_mask; in i915_digport_work_func()
309 dev_priv->hotplug.short_port_mask = 0; in i915_digport_work_func()
338 dev_priv->hotplug.event_bits |= old_bits; in i915_digport_work_func()
340 queue_delayed_work(system_wq, &dev_priv->hotplug.hotplug_work, 0); in i915_digport_work_func()
356 i915->hotplug.short_port_mask |= BIT(dig_port->base.port); in intel_hpd_trigger_irq()
359 queue_work(i915->hotplug.dp_wq, &i915->hotplug.dig_port_work); in intel_hpd_trigger_irq()
363 * Handle hotplug events outside the interrupt handler proper.
369 hotplug.hotplug_work.work); in i915_hotplug_work_func()
378 drm_dbg_kms(&dev_priv->drm, "running encoder hotplug functions\n"); in i915_hotplug_work_func()
382 hpd_event_bits = dev_priv->hotplug.event_bits; in i915_hotplug_work_func()
383 dev_priv->hotplug.event_bits = 0; in i915_hotplug_work_func()
384 hpd_retry_bits = dev_priv->hotplug.retry_bits; in i915_hotplug_work_func()
385 dev_priv->hotplug.retry_bits = 0; in i915_hotplug_work_func()
412 "Connector %s (pin %i) received hotplug event. (retry %d)\n", in i915_hotplug_work_func()
416 switch (encoder->hotplug(encoder, connector)) { in i915_hotplug_work_func()
438 dev_priv->hotplug.retry_bits |= retry; in i915_hotplug_work_func()
441 mod_delayed_work(system_wq, &dev_priv->hotplug.hotplug_work, in i915_hotplug_work_func()
448 * intel_hpd_irq_handler - main hotplug irq handler
453 * This is the main hotplug irq handler for all platforms. The platform specific
454 * irq handlers call the platform specific hotplug irq handlers, which read and
460 * Here, we do hotplug irq storm detection and mitigation, and pass further
505 dev_priv->hotplug.long_port_mask |= BIT(port); in intel_hpd_irq_handler()
508 dev_priv->hotplug.short_port_mask |= BIT(port); in intel_hpd_irq_handler()
519 if (dev_priv->hotplug.stats[pin].state == HPD_DISABLED) { in intel_hpd_irq_handler()
523 * hotplug bits itself. So only WARN about unexpected in intel_hpd_irq_handler()
532 if (dev_priv->hotplug.stats[pin].state != HPD_ENABLED) in intel_hpd_irq_handler()
543 dev_priv->hotplug.event_bits |= BIT(pin); in intel_hpd_irq_handler()
549 dev_priv->hotplug.event_bits &= ~BIT(pin); in intel_hpd_irq_handler()
557 * happens later in our hotplug work. in intel_hpd_irq_handler()
564 * Our hotplug handler can grab modeset locks (by calling down into the in intel_hpd_irq_handler()
570 queue_work(dev_priv->hotplug.dp_wq, &dev_priv->hotplug.dig_port_work); in intel_hpd_irq_handler()
572 queue_delayed_work(system_wq, &dev_priv->hotplug.hotplug_work, 0); in intel_hpd_irq_handler()
579 * This function enables the hotplug support. It requires that interrupts have
580 * already been enabled with intel_irq_init_hw(). From this point on hotplug and
594 dev_priv->hotplug.stats[i].count = 0; in intel_hpd_init()
595 dev_priv->hotplug.stats[i].state = HPD_ENABLED; in intel_hpd_init()
598 WRITE_ONCE(dev_priv->hotplug.poll_enabled, false); in intel_hpd_init()
599 schedule_work(&dev_priv->hotplug.poll_init_work); in intel_hpd_init()
617 hotplug.poll_init_work); in i915_hpd_poll_init_work()
625 enabled = READ_ONCE(dev_priv->hotplug.poll_enabled); in i915_hpd_poll_init_work()
661 * not they support hotplug detection. Under certain conditions HPD may not be
667 * dev->mode_config.mutex, we do the actual hotplug enabling in a seperate
674 WRITE_ONCE(dev_priv->hotplug.poll_enabled, true); in intel_hpd_poll_init()
682 schedule_work(&dev_priv->hotplug.poll_init_work); in intel_hpd_poll_init()
687 INIT_DELAYED_WORK(&dev_priv->hotplug.hotplug_work, in intel_hpd_init_work()
689 INIT_WORK(&dev_priv->hotplug.dig_port_work, i915_digport_work_func); in intel_hpd_init_work()
690 INIT_WORK(&dev_priv->hotplug.poll_init_work, i915_hpd_poll_init_work); in intel_hpd_init_work()
691 INIT_DELAYED_WORK(&dev_priv->hotplug.reenable_work, in intel_hpd_init_work()
699 dev_priv->hotplug.long_port_mask = 0; in intel_hpd_cancel_work()
700 dev_priv->hotplug.short_port_mask = 0; in intel_hpd_cancel_work()
701 dev_priv->hotplug.event_bits = 0; in intel_hpd_cancel_work()
702 dev_priv->hotplug.retry_bits = 0; in intel_hpd_cancel_work()
706 cancel_work_sync(&dev_priv->hotplug.dig_port_work); in intel_hpd_cancel_work()
707 cancel_delayed_work_sync(&dev_priv->hotplug.hotplug_work); in intel_hpd_cancel_work()
708 cancel_work_sync(&dev_priv->hotplug.poll_init_work); in intel_hpd_cancel_work()
709 cancel_delayed_work_sync(&dev_priv->hotplug.reenable_work); in intel_hpd_cancel_work()
720 if (dev_priv->hotplug.stats[pin].state == HPD_ENABLED) { in intel_hpd_disable()
721 dev_priv->hotplug.stats[pin].state = HPD_DISABLED; in intel_hpd_disable()
735 dev_priv->hotplug.stats[pin].state = HPD_ENABLED; in intel_hpd_enable()