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
39 * Simply put, hotplug occurs when a display is connected to or disconnected
41 * Display Port short pulses and MST devices involved, complicating matters.
48 * into a platform independent mask of hotplug pins that have fired.
52 * further processing to appropriate bottom halves (Display Port specific and
55 * The Display Port work function i915_digport_work_func() calls into
57 * pulses, with failures and non-MST long pulses triggering regular hotplug
64 * Finally, the userspace is responsible for triggering a modeset upon receiving
68 * number of interrupts per hotplug pin per a period of time, and if the number
69 * of interrupts exceeds a certain threshold, the interrupt is disabled for a
70 * while before being re-enabled. The intention is to mitigate issues raising
72 * the system to a halt.
75 * seen when display port sink is connected, hence on platforms whose DP
78 * this is specific to DP sinks handled by this routine and any other display
84 * 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()
740 mutex_lock(&dev_priv->drm.mode_config.mutex); in i915_hpd_poll_init_work()
742 enabled = READ_ONCE(dev_priv->display.hotplug.poll_enabled); in i915_hpd_poll_init_work()
744 * Prevent taking a power reference from this sequence of in i915_hpd_poll_init_work()
745 * i915_hpd_poll_init_work() -> drm_helper_hpd_irq_event() -> in i915_hpd_poll_init_work()
752 drm_WARN_ON(&dev_priv->drm, in i915_hpd_poll_init_work()
753 READ_ONCE(dev_priv->display.hotplug.poll_enabled)); in i915_hpd_poll_init_work()
754 cancel_work(&dev_priv->display.hotplug.poll_init_work); in i915_hpd_poll_init_work()
757 spin_lock_irq(&dev_priv->irq_lock); in i915_hpd_poll_init_work()
759 drm_connector_list_iter_begin(&dev_priv->drm, &conn_iter); in i915_hpd_poll_init_work()
767 if (dev_priv->display.hotplug.stats[pin].state == HPD_DISABLED) in i915_hpd_poll_init_work()
770 connector->base.polled = connector->polled; in i915_hpd_poll_init_work()
772 if (enabled && connector->base.polled == DRM_CONNECTOR_POLL_HPD) in i915_hpd_poll_init_work()
773 connector->base.polled = DRM_CONNECTOR_POLL_CONNECT | in i915_hpd_poll_init_work()
778 spin_unlock_irq(&dev_priv->irq_lock); in i915_hpd_poll_init_work()
781 drm_kms_helper_poll_reschedule(&dev_priv->drm); in i915_hpd_poll_init_work()
783 mutex_unlock(&dev_priv->drm.mode_config.mutex); in i915_hpd_poll_init_work()
799 * intel_hpd_poll_enable - enable polling for connectors with hpd
809 * dev->mode_config.mutex, we do the actual hotplug enabling in a seperate
816 struct intel_display *display = &dev_priv->display; in intel_hpd_poll_enable() local
819 !intel_display_device_enabled(display)) in intel_hpd_poll_enable()
822 WRITE_ONCE(dev_priv->display.hotplug.poll_enabled, true); in intel_hpd_poll_enable()
825 * We might already be holding dev->mode_config.mutex, so do this in a in intel_hpd_poll_enable()
830 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_poll_enable()
832 &dev_priv->display.hotplug.poll_init_work); in intel_hpd_poll_enable()
833 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_poll_enable()
837 * intel_hpd_poll_disable - disable polling for connectors with hpd
847 * dev->mode_config.mutex, we do the actual hotplug enabling in a seperate
850 * Also used during driver init to initialize connector->polled
860 WRITE_ONCE(dev_priv->display.hotplug.poll_enabled, false); in intel_hpd_poll_disable()
862 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_poll_disable()
864 &dev_priv->display.hotplug.poll_init_work); in intel_hpd_poll_disable()
865 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_poll_disable()
870 INIT_DELAYED_WORK(&i915->display.hotplug.hotplug_work, in intel_hpd_init_early()
872 INIT_WORK(&i915->display.hotplug.dig_port_work, i915_digport_work_func); in intel_hpd_init_early()
873 INIT_WORK(&i915->display.hotplug.poll_init_work, i915_hpd_poll_init_work); in intel_hpd_init_early()
874 INIT_DELAYED_WORK(&i915->display.hotplug.reenable_work, in intel_hpd_init_early()
877 i915->display.hotplug.hpd_storm_threshold = HPD_STORM_DEFAULT_THRESHOLD; in intel_hpd_init_early()
879 * detection, as short HPD storms will occur as a natural part of in intel_hpd_init_early()
884 i915->display.hotplug.hpd_short_storm_enabled = !HAS_DP_MST(i915); in intel_hpd_init_early()
891 if (cancel_delayed_work_sync(&i915->display.hotplug.hotplug_work)) in cancel_all_detection_work()
893 if (cancel_work_sync(&i915->display.hotplug.poll_init_work)) in cancel_all_detection_work()
895 if (cancel_delayed_work_sync(&i915->display.hotplug.reenable_work)) in cancel_all_detection_work()
906 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_cancel_work()
908 dev_priv->display.hotplug.long_port_mask = 0; in intel_hpd_cancel_work()
909 dev_priv->display.hotplug.short_port_mask = 0; in intel_hpd_cancel_work()
910 dev_priv->display.hotplug.event_bits = 0; in intel_hpd_cancel_work()
911 dev_priv->display.hotplug.retry_bits = 0; in intel_hpd_cancel_work()
913 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_cancel_work()
915 cancel_work_sync(&dev_priv->display.hotplug.dig_port_work); in intel_hpd_cancel_work()
922 drm_dbg_kms(&dev_priv->drm, "Hotplug detection work still active\n"); in intel_hpd_cancel_work()
932 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_disable()
933 if (dev_priv->display.hotplug.stats[pin].state == HPD_ENABLED) { in intel_hpd_disable()
934 dev_priv->display.hotplug.stats[pin].state = HPD_DISABLED; in intel_hpd_disable()
937 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_disable()
947 spin_lock_irq(&dev_priv->irq_lock); in intel_hpd_enable()
948 dev_priv->display.hotplug.stats[pin].state = HPD_ENABLED; in intel_hpd_enable()
949 spin_unlock_irq(&dev_priv->irq_lock); in intel_hpd_enable()
957 lockdep_assert_held(&i915->irq_lock); in queue_work_for_missed_irqs()
959 if (i915->display.hotplug.event_bits || in queue_work_for_missed_irqs()
960 i915->display.hotplug.retry_bits) in queue_work_for_missed_irqs()
964 switch (i915->display.hotplug.stats[pin].state) { in queue_work_for_missed_irqs()
971 MISSING_CASE(i915->display.hotplug.stats[pin].state); in queue_work_for_missed_irqs()
976 queue_delayed_detection_work(i915, &i915->display.hotplug.hotplug_work, 0); in queue_work_for_missed_irqs()
981 spin_lock_irq(&i915->irq_lock); in intel_hpd_enable_detection_work()
982 i915->display.hotplug.detection_work_enabled = true; in intel_hpd_enable_detection_work()
984 spin_unlock_irq(&i915->irq_lock); in intel_hpd_enable_detection_work()
989 spin_lock_irq(&i915->irq_lock); in intel_hpd_disable_detection_work()
990 i915->display.hotplug.detection_work_enabled = false; in intel_hpd_disable_detection_work()
991 spin_unlock_irq(&i915->irq_lock); in intel_hpd_disable_detection_work()
1001 spin_lock_irqsave(&i915->irq_lock, flags); in intel_hpd_schedule_detection()
1002 ret = queue_delayed_detection_work(i915, &i915->display.hotplug.hotplug_work, 0); in intel_hpd_schedule_detection()
1003 spin_unlock_irqrestore(&i915->irq_lock, flags); in intel_hpd_schedule_detection()
1010 struct drm_i915_private *dev_priv = m->private; in i915_hpd_storm_ctl_show()
1011 struct intel_hotplug *hotplug = &dev_priv->display.hotplug; in i915_hpd_storm_ctl_show()
1017 flush_work(&dev_priv->display.hotplug.dig_port_work); in i915_hpd_storm_ctl_show()
1018 flush_delayed_work(&dev_priv->display.hotplug.hotplug_work); in i915_hpd_storm_ctl_show()
1020 seq_printf(m, "Threshold: %d\n", hotplug->hpd_storm_threshold); in i915_hpd_storm_ctl_show()
1022 str_yes_no(delayed_work_pending(&hotplug->reenable_work))); in i915_hpd_storm_ctl_show()
1031 struct seq_file *m = file->private_data; in i915_hpd_storm_ctl_write()
1032 struct drm_i915_private *dev_priv = m->private; in i915_hpd_storm_ctl_write()
1033 struct intel_hotplug *hotplug = &dev_priv->display.hotplug; in i915_hpd_storm_ctl_write()
1040 return -EINVAL; in i915_hpd_storm_ctl_write()
1043 return -EFAULT; in i915_hpd_storm_ctl_write()
1055 return -EINVAL; in i915_hpd_storm_ctl_write()
1058 drm_dbg_kms(&dev_priv->drm, in i915_hpd_storm_ctl_write()
1062 drm_dbg_kms(&dev_priv->drm, "Disabling HPD storm detection\n"); in i915_hpd_storm_ctl_write()
1064 spin_lock_irq(&dev_priv->irq_lock); in i915_hpd_storm_ctl_write()
1065 hotplug->hpd_storm_threshold = new_threshold; in i915_hpd_storm_ctl_write()
1066 /* Reset the HPD storm stats so we don't accidentally trigger a storm */ in i915_hpd_storm_ctl_write()
1068 hotplug->stats[i].count = 0; in i915_hpd_storm_ctl_write()
1069 spin_unlock_irq(&dev_priv->irq_lock); in i915_hpd_storm_ctl_write()
1071 /* Re-enable hpd immediately if we were in an irq storm */ in i915_hpd_storm_ctl_write()
1072 flush_delayed_work(&dev_priv->display.hotplug.reenable_work); in i915_hpd_storm_ctl_write()
1079 return single_open(file, i915_hpd_storm_ctl_show, inode->i_private); in i915_hpd_storm_ctl_open()
1093 struct drm_i915_private *dev_priv = m->private; in i915_hpd_short_storm_ctl_show()
1096 str_yes_no(dev_priv->display.hotplug.hpd_short_storm_enabled)); in i915_hpd_short_storm_ctl_show()
1105 inode->i_private); in i915_hpd_short_storm_ctl_open()
1112 struct seq_file *m = file->private_data; in i915_hpd_short_storm_ctl_write()
1113 struct drm_i915_private *dev_priv = m->private; in i915_hpd_short_storm_ctl_write()
1114 struct intel_hotplug *hotplug = &dev_priv->display.hotplug; in i915_hpd_short_storm_ctl_write()
1121 return -EINVAL; in i915_hpd_short_storm_ctl_write()
1124 return -EFAULT; in i915_hpd_short_storm_ctl_write()
1137 return -EINVAL; in i915_hpd_short_storm_ctl_write()
1139 drm_dbg_kms(&dev_priv->drm, "%sabling HPD short storm detection\n", in i915_hpd_short_storm_ctl_write()
1142 spin_lock_irq(&dev_priv->irq_lock); in i915_hpd_short_storm_ctl_write()
1143 hotplug->hpd_short_storm_enabled = new_state; in i915_hpd_short_storm_ctl_write()
1144 /* Reset the HPD storm stats so we don't accidentally trigger a storm */ in i915_hpd_short_storm_ctl_write()
1146 hotplug->stats[i].count = 0; in i915_hpd_short_storm_ctl_write()
1147 spin_unlock_irq(&dev_priv->irq_lock); in i915_hpd_short_storm_ctl_write()
1149 /* Re-enable hpd immediately if we were in an irq storm */ in i915_hpd_short_storm_ctl_write()
1150 flush_delayed_work(&dev_priv->display.hotplug.reenable_work); in i915_hpd_short_storm_ctl_write()
1166 struct drm_minor *minor = i915->drm.primary; in intel_hpd_debugfs_register()
1168 debugfs_create_file("i915_hpd_storm_ctl", 0644, minor->debugfs_root, in intel_hpd_debugfs_register()
1170 debugfs_create_file("i915_hpd_short_storm_ctl", 0644, minor->debugfs_root, in intel_hpd_debugfs_register()
1172 debugfs_create_bool("i915_ignore_long_hpd", 0644, minor->debugfs_root, in intel_hpd_debugfs_register()
1173 &i915->display.hotplug.ignore_long_hpd); in intel_hpd_debugfs_register()