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()
226 hotplug.reenable_work.work); in intel_hpd_irq_storm_reenable_work()
241 dev_priv->hotplug.stats[pin].state != HPD_DISABLED) in intel_hpd_irq_storm_reenable_work()
253 if (dev_priv->hotplug.stats[pin].state == HPD_DISABLED) in intel_hpd_irq_storm_reenable_work()
254 dev_priv->hotplug.stats[pin].state = HPD_ENABLED; in intel_hpd_irq_storm_reenable_work()
305 container_of(work, struct drm_i915_private, hotplug.dig_port_work); in i915_digport_work_func()
311 long_port_mask = dev_priv->hotplug.long_port_mask; in i915_digport_work_func()
312 dev_priv->hotplug.long_port_mask = 0; in i915_digport_work_func()
313 short_port_mask = dev_priv->hotplug.short_port_mask; in i915_digport_work_func()
314 dev_priv->hotplug.short_port_mask = 0; in i915_digport_work_func()
343 dev_priv->hotplug.event_bits |= old_bits; in i915_digport_work_func()
345 queue_delayed_work(system_wq, &dev_priv->hotplug.hotplug_work, 0); in i915_digport_work_func()
361 i915->hotplug.short_port_mask |= BIT(dig_port->base.port); in intel_hpd_trigger_irq()
364 queue_work(i915->hotplug.dp_wq, &i915->hotplug.dig_port_work); in intel_hpd_trigger_irq()
368 * Handle hotplug events outside the interrupt handler proper.
374 hotplug.hotplug_work.work); in i915_hotplug_work_func()
383 drm_dbg_kms(&dev_priv->drm, "running encoder hotplug functions\n"); in i915_hotplug_work_func()
387 hpd_event_bits = dev_priv->hotplug.event_bits; in i915_hotplug_work_func()
388 dev_priv->hotplug.event_bits = 0; in i915_hotplug_work_func()
389 hpd_retry_bits = dev_priv->hotplug.retry_bits; in i915_hotplug_work_func()
390 dev_priv->hotplug.retry_bits = 0; in i915_hotplug_work_func()
417 "Connector %s (pin %i) received hotplug event. (retry %d)\n", in i915_hotplug_work_func()
421 switch (encoder->hotplug(encoder, connector)) { in i915_hotplug_work_func()
443 dev_priv->hotplug.retry_bits |= retry; in i915_hotplug_work_func()
446 mod_delayed_work(system_wq, &dev_priv->hotplug.hotplug_work, in i915_hotplug_work_func()
453 * intel_hpd_irq_handler - main hotplug irq handler
458 * This is the main hotplug irq handler for all platforms. The platform specific
459 * irq handlers call the platform specific hotplug irq handlers, which read and
465 * Here, we do hotplug irq storm detection and mitigation, and pass further
510 dev_priv->hotplug.long_port_mask |= BIT(port); in intel_hpd_irq_handler()
513 dev_priv->hotplug.short_port_mask |= BIT(port); in intel_hpd_irq_handler()
524 if (dev_priv->hotplug.stats[pin].state == HPD_DISABLED) { in intel_hpd_irq_handler()
528 * hotplug bits itself. So only WARN about unexpected in intel_hpd_irq_handler()
537 if (dev_priv->hotplug.stats[pin].state != HPD_ENABLED) in intel_hpd_irq_handler()
548 dev_priv->hotplug.event_bits |= BIT(pin); in intel_hpd_irq_handler()
554 dev_priv->hotplug.event_bits &= ~BIT(pin); in intel_hpd_irq_handler()
562 * happens later in our hotplug work. in intel_hpd_irq_handler()
569 * Our hotplug handler can grab modeset locks (by calling down into the in intel_hpd_irq_handler()
575 queue_work(dev_priv->hotplug.dp_wq, &dev_priv->hotplug.dig_port_work); in intel_hpd_irq_handler()
577 queue_delayed_work(system_wq, &dev_priv->hotplug.hotplug_work, 0); in intel_hpd_irq_handler()
584 * This function enables the hotplug support. It requires that interrupts have
585 * already been enabled with intel_irq_init_hw(). From this point on hotplug and
602 dev_priv->hotplug.stats[i].count = 0; in intel_hpd_init()
603 dev_priv->hotplug.stats[i].state = HPD_ENABLED; in intel_hpd_init()
619 hotplug.poll_init_work); in i915_hpd_poll_init_work()
627 enabled = READ_ONCE(dev_priv->hotplug.poll_enabled); in i915_hpd_poll_init_work()
669 * dev->mode_config.mutex, we do the actual hotplug enabling in a seperate
679 WRITE_ONCE(dev_priv->hotplug.poll_enabled, true); in intel_hpd_poll_enable()
687 schedule_work(&dev_priv->hotplug.poll_init_work); in intel_hpd_poll_enable()
701 * dev->mode_config.mutex, we do the actual hotplug enabling in a seperate
714 WRITE_ONCE(dev_priv->hotplug.poll_enabled, false); in intel_hpd_poll_disable()
715 schedule_work(&dev_priv->hotplug.poll_init_work); in intel_hpd_poll_disable()
720 INIT_DELAYED_WORK(&dev_priv->hotplug.hotplug_work, in intel_hpd_init_work()
722 INIT_WORK(&dev_priv->hotplug.dig_port_work, i915_digport_work_func); in intel_hpd_init_work()
723 INIT_WORK(&dev_priv->hotplug.poll_init_work, i915_hpd_poll_init_work); in intel_hpd_init_work()
724 INIT_DELAYED_WORK(&dev_priv->hotplug.reenable_work, in intel_hpd_init_work()
735 dev_priv->hotplug.long_port_mask = 0; in intel_hpd_cancel_work()
736 dev_priv->hotplug.short_port_mask = 0; in intel_hpd_cancel_work()
737 dev_priv->hotplug.event_bits = 0; in intel_hpd_cancel_work()
738 dev_priv->hotplug.retry_bits = 0; in intel_hpd_cancel_work()
742 cancel_work_sync(&dev_priv->hotplug.dig_port_work); in intel_hpd_cancel_work()
743 cancel_delayed_work_sync(&dev_priv->hotplug.hotplug_work); in intel_hpd_cancel_work()
744 cancel_work_sync(&dev_priv->hotplug.poll_init_work); in intel_hpd_cancel_work()
745 cancel_delayed_work_sync(&dev_priv->hotplug.reenable_work); in intel_hpd_cancel_work()
756 if (dev_priv->hotplug.stats[pin].state == HPD_ENABLED) { in intel_hpd_disable()
757 dev_priv->hotplug.stats[pin].state = HPD_DISABLED; in intel_hpd_disable()
771 dev_priv->hotplug.stats[pin].state = HPD_ENABLED; in intel_hpd_enable()