Lines Matching +full:a +full:- +full:display
4 * Permission is hereby granted, free of charge, to any person obtaining a
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
41 * Simply put, hotplug occurs when a display is connected to or disconnected
43 * Display Port short pulses and MST devices involved, complicating matters.
50 * into a platform independent mask of hotplug pins that have fired.
54 * further processing to appropriate bottom halves (Display Port specific and
57 * The Display Port work function i915_digport_work_func() calls into
59 * pulses, with failures and non-MST long pulses triggering regular hotplug
66 * Finally, the userspace is responsible for triggering a modeset upon receiving
70 * number of interrupts per hotplug pin per a period of time, and if the number
71 * of interrupts exceeds a certain threshold, the interrupt is disabled for a
72 * while before being re-enabled. The intention is to mitigate issues raising
74 * the system to a halt.
77 * seen when display port sink is connected, hence on platforms whose DP
80 * this is specific to DP sinks handled by this routine and any other display
86 * intel_hpd_pin_default - return default pin associated with certain port.
95 return HPD_PORT_A + port - PORT_A; in intel_hpd_pin_default()
116 return encoder ? encoder->hpd_pin : HPD_NONE; in intel_connector_hpd_pin()
120 * intel_hpd_irq_storm_detect - gather stats and detect HPD IRQ storm on a pin
130 * stored in @dev_priv->display.hotplug.hpd_storm_threshold which defaults to
136 * &dev_priv->display.hotplug.hpd_storm_threshold. However, some older systems also
151 struct intel_hotplug *hpd = &dev_priv->display.hotplug; in intel_hpd_irq_storm_detect()
152 unsigned long start = hpd->stats[pin].last_jiffies; in intel_hpd_irq_storm_detect()
155 const int threshold = hpd->hpd_storm_threshold; in intel_hpd_irq_storm_detect()
159 (!long_hpd && !dev_priv->display.hotplug.hpd_short_storm_enabled)) in intel_hpd_irq_storm_detect()
163 hpd->stats[pin].last_jiffies = jiffies; in intel_hpd_irq_storm_detect()
164 hpd->stats[pin].count = 0; in intel_hpd_irq_storm_detect()
167 hpd->stats[pin].count += increment; in intel_hpd_irq_storm_detect()
168 if (hpd->stats[pin].count > threshold) { in intel_hpd_irq_storm_detect()
169 hpd->stats[pin].state = HPD_MARK_DISABLED; in intel_hpd_irq_storm_detect()
170 drm_dbg_kms(&dev_priv->drm, in intel_hpd_irq_storm_detect()
174 drm_dbg_kms(&dev_priv->drm, in intel_hpd_irq_storm_detect()
175 "Received HPD interrupt on PIN %d - cnt: %d\n", in intel_hpd_irq_storm_detect()
177 hpd->stats[pin].count); in intel_hpd_irq_storm_detect()
185 lockdep_assert_held(&i915->irq_lock); in detection_work_enabled()
187 return i915->display.hotplug.detection_work_enabled; in detection_work_enabled()
193 lockdep_assert_held(&i915->irq_lock); in mod_delayed_detection_work()
198 return mod_delayed_work(i915->unordered_wq, work, delay); in mod_delayed_detection_work()
204 lockdep_assert_held(&i915->irq_lock); in queue_delayed_detection_work()
209 return queue_delayed_work(i915->unordered_wq, work, delay); in queue_delayed_detection_work()
215 lockdep_assert_held(&i915->irq_lock); in queue_detection_work()
220 return queue_work(i915->unordered_wq, work); in queue_detection_work()
230 lockdep_assert_held(&dev_priv->irq_lock); in intel_hpd_irq_storm_switch_to_polling()
232 drm_connector_list_iter_begin(&dev_priv->drm, &conn_iter); in intel_hpd_irq_storm_switch_to_polling()
236 if (connector->base.polled != DRM_CONNECTOR_POLL_HPD) in intel_hpd_irq_storm_switch_to_polling()
241 dev_priv->display.hotplug.stats[pin].state != HPD_MARK_DISABLED) in intel_hpd_irq_storm_switch_to_polling()
244 drm_info(&dev_priv->drm, in intel_hpd_irq_storm_switch_to_polling()
247 connector->base.name); in intel_hpd_irq_storm_switch_to_polling()
249 dev_priv->display.hotplug.stats[pin].state = HPD_DISABLED; in intel_hpd_irq_storm_switch_to_polling()
250 connector->base.polled = DRM_CONNECTOR_POLL_CONNECT | in intel_hpd_irq_storm_switch_to_polling()
256 /* Enable polling and queue hotplug re-enabling. */ in intel_hpd_irq_storm_switch_to_polling()
258 drm_kms_helper_poll_reschedule(&dev_priv->drm); in intel_hpd_irq_storm_switch_to_polling()
260 &dev_priv->display.hotplug.reenable_work, in intel_hpd_irq_storm_switch_to_polling()
269 display.hotplug.reenable_work.work); in intel_hpd_irq_storm_reenable_work()
275 wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm); in intel_hpd_irq_storm_reenable_work()
277 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_irq_storm_reenable_work()
279 drm_connector_list_iter_begin(&dev_priv->drm, &conn_iter); in intel_hpd_irq_storm_reenable_work()
283 dev_priv->display.hotplug.stats[pin].state != HPD_DISABLED) in intel_hpd_irq_storm_reenable_work()
286 if (connector->base.polled != connector->polled) in intel_hpd_irq_storm_reenable_work()
287 drm_dbg(&dev_priv->drm, in intel_hpd_irq_storm_reenable_work()
289 connector->base.name); in intel_hpd_irq_storm_reenable_work()
290 connector->base.polled = connector->polled; in intel_hpd_irq_storm_reenable_work()
295 if (dev_priv->display.hotplug.stats[pin].state == HPD_DISABLED) in intel_hpd_irq_storm_reenable_work()
296 dev_priv->display.hotplug.stats[pin].state = HPD_ENABLED; in intel_hpd_irq_storm_reenable_work()
301 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_irq_storm_reenable_work()
303 intel_runtime_pm_put(&dev_priv->runtime_pm, wakeref); in intel_hpd_irq_storm_reenable_work()
309 struct drm_device *dev = connector->base.dev; in intel_hotplug_detect_connector()
315 drm_WARN_ON(dev, !mutex_is_locked(&dev->mode_config.mutex)); in intel_hotplug_detect_connector()
316 old_status = connector->base.status; in intel_hotplug_detect_connector()
317 old_epoch_counter = connector->base.epoch_counter; in intel_hotplug_detect_connector()
319 status = drm_helper_probe_detect(&connector->base, NULL, false); in intel_hotplug_detect_connector()
320 if (!connector->base.force) in intel_hotplug_detect_connector()
321 connector->base.status = status; in intel_hotplug_detect_connector()
323 if (old_epoch_counter != connector->base.epoch_counter) in intel_hotplug_detect_connector()
327 drm_dbg_kms(dev, "[CONNECTOR:%d:%s] status updated from %s to %s (epoch counter %llu->%llu)\n", in intel_hotplug_detect_connector()
328 connector->base.base.id, in intel_hotplug_detect_connector()
329 connector->base.name, in intel_hotplug_detect_connector()
331 drm_get_connector_status_name(connector->base.status), in intel_hotplug_detect_connector()
333 connector->base.epoch_counter); in intel_hotplug_detect_connector()
349 enc_to_dig_port(encoder)->hpd_pulse != NULL; in intel_encoder_has_hpd_pulse()
355 container_of(work, struct drm_i915_private, display.hotplug.dig_port_work); in i915_digport_work_func()
360 spin_lock_irq(&dev_priv->irq_lock); in i915_digport_work_func()
361 long_port_mask = dev_priv->display.hotplug.long_port_mask; in i915_digport_work_func()
362 dev_priv->display.hotplug.long_port_mask = 0; in i915_digport_work_func()
363 short_port_mask = dev_priv->display.hotplug.short_port_mask; in i915_digport_work_func()
364 dev_priv->display.hotplug.short_port_mask = 0; in i915_digport_work_func()
365 spin_unlock_irq(&dev_priv->irq_lock); in i915_digport_work_func()
367 for_each_intel_encoder(&dev_priv->drm, encoder) { in i915_digport_work_func()
369 enum port port = encoder->port; in i915_digport_work_func()
384 ret = dig_port->hpd_pulse(dig_port, long_hpd); in i915_digport_work_func()
387 old_bits |= BIT(encoder->hpd_pin); in i915_digport_work_func()
392 spin_lock_irq(&dev_priv->irq_lock); in i915_digport_work_func()
393 dev_priv->display.hotplug.event_bits |= old_bits; in i915_digport_work_func()
395 &dev_priv->display.hotplug.hotplug_work, 0); in i915_digport_work_func()
396 spin_unlock_irq(&dev_priv->irq_lock); in i915_digport_work_func()
401 * intel_hpd_trigger_irq - trigger an hpd irq event for a port
404 * Trigger an HPD interrupt event for the given port, emulating a short pulse
409 struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev); in intel_hpd_trigger_irq()
411 spin_lock_irq(&i915->irq_lock); in intel_hpd_trigger_irq()
412 i915->display.hotplug.short_port_mask |= BIT(dig_port->base.port); in intel_hpd_trigger_irq()
413 spin_unlock_irq(&i915->irq_lock); in intel_hpd_trigger_irq()
415 queue_work(i915->display.hotplug.dp_wq, &i915->display.hotplug.dig_port_work); in intel_hpd_trigger_irq()
425 display.hotplug.hotplug_work.work); in i915_hotplug_work_func()
434 mutex_lock(&dev_priv->drm.mode_config.mutex); in i915_hotplug_work_func()
435 drm_dbg_kms(&dev_priv->drm, "running encoder hotplug functions\n"); in i915_hotplug_work_func()
437 spin_lock_irq(&dev_priv->irq_lock); in i915_hotplug_work_func()
439 hpd_event_bits = dev_priv->display.hotplug.event_bits; in i915_hotplug_work_func()
440 dev_priv->display.hotplug.event_bits = 0; in i915_hotplug_work_func()
441 hpd_retry_bits = dev_priv->display.hotplug.retry_bits; in i915_hotplug_work_func()
442 dev_priv->display.hotplug.retry_bits = 0; in i915_hotplug_work_func()
447 spin_unlock_irq(&dev_priv->irq_lock); in i915_hotplug_work_func()
450 if (dev_priv->display.hotplug.ignore_long_hpd) { in i915_hotplug_work_func()
451 drm_dbg_kms(&dev_priv->drm, "Ignore HPD flag on - skip encoder hotplug handlers\n"); in i915_hotplug_work_func()
452 mutex_unlock(&dev_priv->drm.mode_config.mutex); in i915_hotplug_work_func()
456 drm_connector_list_iter_begin(&dev_priv->drm, &conn_iter); in i915_hotplug_work_func()
471 connector->hotplug_retries = 0; in i915_hotplug_work_func()
473 connector->hotplug_retries++; in i915_hotplug_work_func()
475 drm_dbg_kms(&dev_priv->drm, in i915_hotplug_work_func()
477 connector->base.name, pin, in i915_hotplug_work_func()
478 connector->hotplug_retries); in i915_hotplug_work_func()
480 switch (encoder->hotplug(encoder, connector)) { in i915_hotplug_work_func()
487 drm_connector_get(&connector->base); in i915_hotplug_work_func()
488 first_changed_connector = &connector->base; in i915_hotplug_work_func()
498 mutex_unlock(&dev_priv->drm.mode_config.mutex); in i915_hotplug_work_func()
503 drm_kms_helper_hotplug_event(&dev_priv->drm); in i915_hotplug_work_func()
511 spin_lock_irq(&dev_priv->irq_lock); in i915_hotplug_work_func()
512 dev_priv->display.hotplug.retry_bits |= retry; in i915_hotplug_work_func()
515 &dev_priv->display.hotplug.hotplug_work, in i915_hotplug_work_func()
517 spin_unlock_irq(&dev_priv->irq_lock); in i915_hotplug_work_func()
523 * intel_hpd_irq_handler - main hotplug irq handler
525 * @pin_mask: a mask of hpd pins that have triggered the irq
526 * @long_mask: a mask of hpd pins that may be long hpd pulses
533 * is not a digital port.
551 spin_lock(&dev_priv->irq_lock); in intel_hpd_irq_handler()
554 * Determine whether ->hpd_pulse() exists for each pin, and in intel_hpd_irq_handler()
555 * whether we have a short or a long pulse. This is needed in intel_hpd_irq_handler()
557 * only the one of them (DP) will have ->hpd_pulse(). in intel_hpd_irq_handler()
559 for_each_intel_encoder(&dev_priv->drm, encoder) { in intel_hpd_irq_handler()
560 enum port port = encoder->port; in intel_hpd_irq_handler()
563 pin = encoder->hpd_pin; in intel_hpd_irq_handler()
572 drm_dbg(&dev_priv->drm, in intel_hpd_irq_handler()
573 "digital hpd on [ENCODER:%d:%s] - %s\n", in intel_hpd_irq_handler()
574 encoder->base.base.id, encoder->base.name, in intel_hpd_irq_handler()
580 dev_priv->display.hotplug.long_port_mask |= BIT(port); in intel_hpd_irq_handler()
583 dev_priv->display.hotplug.short_port_mask |= BIT(port); in intel_hpd_irq_handler()
594 if (dev_priv->display.hotplug.stats[pin].state == HPD_DISABLED) { in intel_hpd_irq_handler()
601 drm_WARN_ONCE(&dev_priv->drm, !HAS_GMCH(dev_priv), in intel_hpd_irq_handler()
607 if (dev_priv->display.hotplug.stats[pin].state != HPD_ENABLED) in intel_hpd_irq_handler()
611 * Delegate to ->hpd_pulse() if one of the encoders for this in intel_hpd_irq_handler()
618 dev_priv->display.hotplug.event_bits |= BIT(pin); in intel_hpd_irq_handler()
624 dev_priv->display.hotplug.event_bits &= ~BIT(pin); in intel_hpd_irq_handler()
639 * fb helpers). Hence it must not be run on our own dev-priv->wq work in intel_hpd_irq_handler()
644 queue_work(dev_priv->display.hotplug.dp_wq, &dev_priv->display.hotplug.dig_port_work); in intel_hpd_irq_handler()
647 &dev_priv->display.hotplug.hotplug_work, 0); in intel_hpd_irq_handler()
649 spin_unlock(&dev_priv->irq_lock); in intel_hpd_irq_handler()
653 * intel_hpd_init - initializes and enables hpd support
661 * This is a separate step from interrupt enabling to simplify the locking rules
674 dev_priv->display.hotplug.stats[i].count = 0; in intel_hpd_init()
675 dev_priv->display.hotplug.stats[i].state = HPD_ENABLED; in intel_hpd_init()
679 * Interrupt setup is already guaranteed to be single-threaded, this is in intel_hpd_init()
682 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_init()
684 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_init()
694 mutex_lock(&i915->drm.mode_config.mutex); in i915_hpd_poll_detect_connectors()
696 if (!i915->drm.mode_config.poll_enabled) in i915_hpd_poll_detect_connectors()
699 drm_connector_list_iter_begin(&i915->drm, &conn_iter); in i915_hpd_poll_detect_connectors()
701 if (!(connector->base.polled & DRM_CONNECTOR_POLL_HPD)) in i915_hpd_poll_detect_connectors()
710 drm_connector_get(&connector->base); in i915_hpd_poll_detect_connectors()
717 mutex_unlock(&i915->drm.mode_config.mutex); in i915_hpd_poll_detect_connectors()
723 drm_kms_helper_connector_hotplug_event(&first_changed_connector->base); in i915_hpd_poll_detect_connectors()
725 drm_kms_helper_hotplug_event(&i915->drm); in i915_hpd_poll_detect_connectors()
727 drm_connector_put(&first_changed_connector->base); in i915_hpd_poll_detect_connectors()
734 display.hotplug.poll_init_work); in i915_hpd_poll_init_work()
735 struct intel_display *display = &dev_priv->display; in i915_hpd_poll_init_work() local
741 mutex_lock(&dev_priv->drm.mode_config.mutex); in i915_hpd_poll_init_work()
743 enabled = READ_ONCE(dev_priv->display.hotplug.poll_enabled); in i915_hpd_poll_init_work()
745 * Prevent taking a power reference from this sequence of in i915_hpd_poll_init_work()
746 * i915_hpd_poll_init_work() -> drm_helper_hpd_irq_event() -> in i915_hpd_poll_init_work()
751 wakeref = intel_display_power_get(display, in i915_hpd_poll_init_work()
753 drm_WARN_ON(&dev_priv->drm, in i915_hpd_poll_init_work()
754 READ_ONCE(dev_priv->display.hotplug.poll_enabled)); in i915_hpd_poll_init_work()
755 cancel_work(&dev_priv->display.hotplug.poll_init_work); in i915_hpd_poll_init_work()
758 spin_lock_irq(&dev_priv->irq_lock); in i915_hpd_poll_init_work()
760 drm_connector_list_iter_begin(&dev_priv->drm, &conn_iter); in i915_hpd_poll_init_work()
768 if (dev_priv->display.hotplug.stats[pin].state == HPD_DISABLED) in i915_hpd_poll_init_work()
771 connector->base.polled = connector->polled; in i915_hpd_poll_init_work()
773 if (enabled && connector->base.polled == DRM_CONNECTOR_POLL_HPD) in i915_hpd_poll_init_work()
774 connector->base.polled = DRM_CONNECTOR_POLL_CONNECT | in i915_hpd_poll_init_work()
779 spin_unlock_irq(&dev_priv->irq_lock); in i915_hpd_poll_init_work()
782 drm_kms_helper_poll_reschedule(&dev_priv->drm); in i915_hpd_poll_init_work()
784 mutex_unlock(&dev_priv->drm.mode_config.mutex); in i915_hpd_poll_init_work()
793 intel_display_power_put(display, in i915_hpd_poll_init_work()
800 * intel_hpd_poll_enable - enable polling for connectors with hpd
810 * dev->mode_config.mutex, we do the actual hotplug enabling in a separate
817 struct intel_display *display = &dev_priv->display; in intel_hpd_poll_enable() local
820 !intel_display_device_enabled(display)) in intel_hpd_poll_enable()
823 WRITE_ONCE(dev_priv->display.hotplug.poll_enabled, true); in intel_hpd_poll_enable()
826 * We might already be holding dev->mode_config.mutex, so do this in a in intel_hpd_poll_enable()
831 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_poll_enable()
833 &dev_priv->display.hotplug.poll_init_work); in intel_hpd_poll_enable()
834 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_poll_enable()
838 * intel_hpd_poll_disable - disable polling for connectors with hpd
848 * dev->mode_config.mutex, we do the actual hotplug enabling in a separate
851 * Also used during driver init to initialize connector->polled
861 WRITE_ONCE(dev_priv->display.hotplug.poll_enabled, false); in intel_hpd_poll_disable()
863 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_poll_disable()
865 &dev_priv->display.hotplug.poll_init_work); in intel_hpd_poll_disable()
866 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_poll_disable()
875 drm_connector_list_iter_begin(&i915->drm, &conn_iter); in intel_hpd_poll_fini()
885 INIT_DELAYED_WORK(&i915->display.hotplug.hotplug_work, in intel_hpd_init_early()
887 INIT_WORK(&i915->display.hotplug.dig_port_work, i915_digport_work_func); in intel_hpd_init_early()
888 INIT_WORK(&i915->display.hotplug.poll_init_work, i915_hpd_poll_init_work); in intel_hpd_init_early()
889 INIT_DELAYED_WORK(&i915->display.hotplug.reenable_work, in intel_hpd_init_early()
892 i915->display.hotplug.hpd_storm_threshold = HPD_STORM_DEFAULT_THRESHOLD; in intel_hpd_init_early()
894 * detection, as short HPD storms will occur as a natural part of in intel_hpd_init_early()
899 i915->display.hotplug.hpd_short_storm_enabled = !HAS_DP_MST(i915); in intel_hpd_init_early()
906 if (cancel_delayed_work_sync(&i915->display.hotplug.hotplug_work)) in cancel_all_detection_work()
908 if (cancel_work_sync(&i915->display.hotplug.poll_init_work)) in cancel_all_detection_work()
910 if (cancel_delayed_work_sync(&i915->display.hotplug.reenable_work)) in cancel_all_detection_work()
921 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_cancel_work()
923 dev_priv->display.hotplug.long_port_mask = 0; in intel_hpd_cancel_work()
924 dev_priv->display.hotplug.short_port_mask = 0; in intel_hpd_cancel_work()
925 dev_priv->display.hotplug.event_bits = 0; in intel_hpd_cancel_work()
926 dev_priv->display.hotplug.retry_bits = 0; in intel_hpd_cancel_work()
928 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_cancel_work()
930 cancel_work_sync(&dev_priv->display.hotplug.dig_port_work); in intel_hpd_cancel_work()
937 drm_dbg_kms(&dev_priv->drm, "Hotplug detection work still active\n"); in intel_hpd_cancel_work()
947 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_disable()
948 if (dev_priv->display.hotplug.stats[pin].state == HPD_ENABLED) { in intel_hpd_disable()
949 dev_priv->display.hotplug.stats[pin].state = HPD_DISABLED; in intel_hpd_disable()
952 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_disable()
962 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_enable()
963 dev_priv->display.hotplug.stats[pin].state = HPD_ENABLED; in intel_hpd_enable()
964 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_enable()
972 lockdep_assert_held(&i915->irq_lock); in queue_work_for_missed_irqs()
974 if (i915->display.hotplug.event_bits || in queue_work_for_missed_irqs()
975 i915->display.hotplug.retry_bits) in queue_work_for_missed_irqs()
979 switch (i915->display.hotplug.stats[pin].state) { in queue_work_for_missed_irqs()
986 MISSING_CASE(i915->display.hotplug.stats[pin].state); in queue_work_for_missed_irqs()
991 queue_delayed_detection_work(i915, &i915->display.hotplug.hotplug_work, 0); in queue_work_for_missed_irqs()
996 spin_lock_irq(&i915->irq_lock); in intel_hpd_enable_detection_work()
997 i915->display.hotplug.detection_work_enabled = true; in intel_hpd_enable_detection_work()
999 spin_unlock_irq(&i915->irq_lock); in intel_hpd_enable_detection_work()
1004 spin_lock_irq(&i915->irq_lock); in intel_hpd_disable_detection_work()
1005 i915->display.hotplug.detection_work_enabled = false; in intel_hpd_disable_detection_work()
1006 spin_unlock_irq(&i915->irq_lock); in intel_hpd_disable_detection_work()
1016 spin_lock_irqsave(&i915->irq_lock, flags); in intel_hpd_schedule_detection()
1017 ret = queue_delayed_detection_work(i915, &i915->display.hotplug.hotplug_work, 0); in intel_hpd_schedule_detection()
1018 spin_unlock_irqrestore(&i915->irq_lock, flags); in intel_hpd_schedule_detection()
1025 struct drm_i915_private *dev_priv = m->private; in i915_hpd_storm_ctl_show()
1026 struct intel_hotplug *hotplug = &dev_priv->display.hotplug; in i915_hpd_storm_ctl_show()
1032 flush_work(&dev_priv->display.hotplug.dig_port_work); in i915_hpd_storm_ctl_show()
1033 flush_delayed_work(&dev_priv->display.hotplug.hotplug_work); in i915_hpd_storm_ctl_show()
1035 seq_printf(m, "Threshold: %d\n", hotplug->hpd_storm_threshold); in i915_hpd_storm_ctl_show()
1037 str_yes_no(delayed_work_pending(&hotplug->reenable_work))); in i915_hpd_storm_ctl_show()
1046 struct seq_file *m = file->private_data; in i915_hpd_storm_ctl_write()
1047 struct drm_i915_private *dev_priv = m->private; in i915_hpd_storm_ctl_write()
1048 struct intel_hotplug *hotplug = &dev_priv->display.hotplug; in i915_hpd_storm_ctl_write()
1055 return -EINVAL; in i915_hpd_storm_ctl_write()
1058 return -EFAULT; in i915_hpd_storm_ctl_write()
1070 return -EINVAL; in i915_hpd_storm_ctl_write()
1073 drm_dbg_kms(&dev_priv->drm, in i915_hpd_storm_ctl_write()
1077 drm_dbg_kms(&dev_priv->drm, "Disabling HPD storm detection\n"); in i915_hpd_storm_ctl_write()
1079 spin_lock_irq(&dev_priv->irq_lock); in i915_hpd_storm_ctl_write()
1080 hotplug->hpd_storm_threshold = new_threshold; in i915_hpd_storm_ctl_write()
1081 /* Reset the HPD storm stats so we don't accidentally trigger a storm */ in i915_hpd_storm_ctl_write()
1083 hotplug->stats[i].count = 0; in i915_hpd_storm_ctl_write()
1084 spin_unlock_irq(&dev_priv->irq_lock); in i915_hpd_storm_ctl_write()
1086 /* Re-enable hpd immediately if we were in an irq storm */ in i915_hpd_storm_ctl_write()
1087 flush_delayed_work(&dev_priv->display.hotplug.reenable_work); in i915_hpd_storm_ctl_write()
1094 return single_open(file, i915_hpd_storm_ctl_show, inode->i_private); in i915_hpd_storm_ctl_open()
1108 struct drm_i915_private *dev_priv = m->private; in i915_hpd_short_storm_ctl_show()
1111 str_yes_no(dev_priv->display.hotplug.hpd_short_storm_enabled)); in i915_hpd_short_storm_ctl_show()
1120 inode->i_private); in i915_hpd_short_storm_ctl_open()
1127 struct seq_file *m = file->private_data; in i915_hpd_short_storm_ctl_write()
1128 struct drm_i915_private *dev_priv = m->private; in i915_hpd_short_storm_ctl_write()
1129 struct intel_hotplug *hotplug = &dev_priv->display.hotplug; in i915_hpd_short_storm_ctl_write()
1136 return -EINVAL; in i915_hpd_short_storm_ctl_write()
1139 return -EFAULT; in i915_hpd_short_storm_ctl_write()
1152 return -EINVAL; in i915_hpd_short_storm_ctl_write()
1154 drm_dbg_kms(&dev_priv->drm, "%sabling HPD short storm detection\n", in i915_hpd_short_storm_ctl_write()
1157 spin_lock_irq(&dev_priv->irq_lock); in i915_hpd_short_storm_ctl_write()
1158 hotplug->hpd_short_storm_enabled = new_state; in i915_hpd_short_storm_ctl_write()
1159 /* Reset the HPD storm stats so we don't accidentally trigger a storm */ in i915_hpd_short_storm_ctl_write()
1161 hotplug->stats[i].count = 0; in i915_hpd_short_storm_ctl_write()
1162 spin_unlock_irq(&dev_priv->irq_lock); in i915_hpd_short_storm_ctl_write()
1164 /* Re-enable hpd immediately if we were in an irq storm */ in i915_hpd_short_storm_ctl_write()
1165 flush_delayed_work(&dev_priv->display.hotplug.reenable_work); in i915_hpd_short_storm_ctl_write()
1181 struct drm_minor *minor = i915->drm.primary; in intel_hpd_debugfs_register()
1183 debugfs_create_file("i915_hpd_storm_ctl", 0644, minor->debugfs_root, in intel_hpd_debugfs_register()
1185 debugfs_create_file("i915_hpd_short_storm_ctl", 0644, minor->debugfs_root, in intel_hpd_debugfs_register()
1187 debugfs_create_bool("i915_ignore_long_hpd", 0644, minor->debugfs_root, in intel_hpd_debugfs_register()
1188 &i915->display.hotplug.ignore_long_hpd); in intel_hpd_debugfs_register()