Lines Matching full:hotplug
33 * DOC: Hotplug
35 * Simply put, hotplug occurs when a display is connected to or disconnected
39 * Hotplug in i915 is handled in many different levels of abstraction.
43 * handlers gather the hotplug detect (HPD) information from relevant registers
44 * into a platform independent mask of hotplug pins that have fired.
47 * intel_hotplug.c does hotplug irq storm detection and mitigation, and passes
49 * regular hotplug).
53 * pulses, with failures and non-MST long pulses triggering regular hotplug
56 * The regular hotplug work function i915_hotplug_work_func() calls connector
57 * detect hooks, and, if connector status changes, triggers sending of hotplug
61 * the hotplug uevent, disabling or enabling the crtc as needed.
63 * The hotplug interrupt storm detection and mitigation code keeps track of the
64 * number of interrupts per hotplug pin per a period of time, and if the number
70 * Current implementation expects that hotplug interrupt storm will not be
134 * stored in @dev_priv->hotplug.hpd_storm_threshold which defaults to
140 * &dev_priv->hotplug.hpd_storm_threshold. However, some older systems also
148 * and should only be adjusted for automated hotplug testing.
155 struct i915_hotplug *hpd = &dev_priv->hotplug; in intel_hpd_irq_storm_detect()
163 (!long_hpd && !dev_priv->hotplug.hpd_short_storm_enabled)) in intel_hpd_irq_storm_detect()
209 dev_priv->hotplug.stats[pin].state != HPD_MARK_DISABLED) in intel_hpd_irq_storm_switch_to_polling()
213 "switching from hotplug detection to polling\n", in intel_hpd_irq_storm_switch_to_polling()
216 dev_priv->hotplug.stats[pin].state = HPD_DISABLED; in intel_hpd_irq_storm_switch_to_polling()
223 /* Enable polling and queue hotplug re-enabling. */ in intel_hpd_irq_storm_switch_to_polling()
226 mod_delayed_work(system_wq, &dev_priv->hotplug.reenable_work, in intel_hpd_irq_storm_switch_to_polling()
235 hotplug.reenable_work.work); in intel_hpd_irq_storm_reenable_work()
247 if (dev_priv->hotplug.stats[pin].state != HPD_DISABLED) in intel_hpd_irq_storm_reenable_work()
250 dev_priv->hotplug.stats[pin].state = HPD_ENABLED; in intel_hpd_irq_storm_reenable_work()
311 container_of(work, struct drm_i915_private, hotplug.dig_port_work); in i915_digport_work_func()
317 long_port_mask = dev_priv->hotplug.long_port_mask; in i915_digport_work_func()
318 dev_priv->hotplug.long_port_mask = 0; in i915_digport_work_func()
319 short_port_mask = dev_priv->hotplug.short_port_mask; in i915_digport_work_func()
320 dev_priv->hotplug.short_port_mask = 0; in i915_digport_work_func()
349 dev_priv->hotplug.event_bits |= old_bits; in i915_digport_work_func()
351 queue_delayed_work(system_wq, &dev_priv->hotplug.hotplug_work, 0); in i915_digport_work_func()
356 * Handle hotplug events outside the interrupt handler proper.
362 hotplug.hotplug_work.work); in i915_hotplug_work_func()
373 DRM_DEBUG_KMS("running encoder hotplug functions\n"); in i915_hotplug_work_func()
377 hpd_event_bits = dev_priv->hotplug.event_bits; in i915_hotplug_work_func()
378 dev_priv->hotplug.event_bits = 0; in i915_hotplug_work_func()
379 hpd_retry_bits = dev_priv->hotplug.retry_bits; in i915_hotplug_work_func()
380 dev_priv->hotplug.retry_bits = 0; in i915_hotplug_work_func()
397 DRM_DEBUG_KMS("Connector %s (pin %i) received hotplug event.\n", in i915_hotplug_work_func()
400 switch (intel_encoder->hotplug(intel_encoder, in i915_hotplug_work_func()
424 dev_priv->hotplug.retry_bits |= retry; in i915_hotplug_work_func()
427 mod_delayed_work(system_wq, &dev_priv->hotplug.hotplug_work, in i915_hotplug_work_func()
434 * intel_hpd_irq_handler - main hotplug irq handler
439 * This is the main hotplug irq handler for all platforms. The platform specific
440 * irq handlers call the platform specific hotplug irq handlers, which read and
446 * Here, we do hotplug irq storm detection and mitigation, and pass further
490 dev_priv->hotplug.long_port_mask |= BIT(port); in intel_hpd_irq_handler()
493 dev_priv->hotplug.short_port_mask |= BIT(port); in intel_hpd_irq_handler()
504 if (dev_priv->hotplug.stats[pin].state == HPD_DISABLED) { in intel_hpd_irq_handler()
508 * hotplug bits itself. So only WARN about unexpected in intel_hpd_irq_handler()
516 if (dev_priv->hotplug.stats[pin].state != HPD_ENABLED) in intel_hpd_irq_handler()
527 dev_priv->hotplug.event_bits |= BIT(pin); in intel_hpd_irq_handler()
533 dev_priv->hotplug.event_bits &= ~BIT(pin); in intel_hpd_irq_handler()
541 * happens later in our hotplug work. in intel_hpd_irq_handler()
548 * Our hotplug handler can grab modeset locks (by calling down into the in intel_hpd_irq_handler()
554 queue_work(dev_priv->hotplug.dp_wq, &dev_priv->hotplug.dig_port_work); in intel_hpd_irq_handler()
556 queue_delayed_work(system_wq, &dev_priv->hotplug.hotplug_work, 0); in intel_hpd_irq_handler()
563 * This function enables the hotplug support. It requires that interrupts have
564 * already been enabled with intel_irq_init_hw(). From this point on hotplug and
578 dev_priv->hotplug.stats[i].count = 0; in intel_hpd_init()
579 dev_priv->hotplug.stats[i].state = HPD_ENABLED; in intel_hpd_init()
582 WRITE_ONCE(dev_priv->hotplug.poll_enabled, false); in intel_hpd_init()
583 schedule_work(&dev_priv->hotplug.poll_init_work); in intel_hpd_init()
601 hotplug.poll_init_work); in i915_hpd_poll_init_work()
609 enabled = READ_ONCE(dev_priv->hotplug.poll_enabled); in i915_hpd_poll_init_work()
650 * not they support hotplug detection. Under certain conditions HPD may not be
656 * dev->mode_config.mutex, we do the actual hotplug enabling in a seperate
663 WRITE_ONCE(dev_priv->hotplug.poll_enabled, true); in intel_hpd_poll_init()
671 schedule_work(&dev_priv->hotplug.poll_init_work); in intel_hpd_poll_init()
676 INIT_DELAYED_WORK(&dev_priv->hotplug.hotplug_work, in intel_hpd_init_work()
678 INIT_WORK(&dev_priv->hotplug.dig_port_work, i915_digport_work_func); in intel_hpd_init_work()
679 INIT_WORK(&dev_priv->hotplug.poll_init_work, i915_hpd_poll_init_work); in intel_hpd_init_work()
680 INIT_DELAYED_WORK(&dev_priv->hotplug.reenable_work, in intel_hpd_init_work()
688 dev_priv->hotplug.long_port_mask = 0; in intel_hpd_cancel_work()
689 dev_priv->hotplug.short_port_mask = 0; in intel_hpd_cancel_work()
690 dev_priv->hotplug.event_bits = 0; in intel_hpd_cancel_work()
691 dev_priv->hotplug.retry_bits = 0; in intel_hpd_cancel_work()
695 cancel_work_sync(&dev_priv->hotplug.dig_port_work); in intel_hpd_cancel_work()
696 cancel_delayed_work_sync(&dev_priv->hotplug.hotplug_work); in intel_hpd_cancel_work()
697 cancel_work_sync(&dev_priv->hotplug.poll_init_work); in intel_hpd_cancel_work()
698 cancel_delayed_work_sync(&dev_priv->hotplug.reenable_work); in intel_hpd_cancel_work()
709 if (dev_priv->hotplug.stats[pin].state == HPD_ENABLED) { in intel_hpd_disable()
710 dev_priv->hotplug.stats[pin].state = HPD_DISABLED; in intel_hpd_disable()
724 dev_priv->hotplug.stats[pin].state = HPD_ENABLED; in intel_hpd_enable()