Lines Matching refs:display

137 static void intel_hpd_init_pins(struct intel_display *display)  in intel_hpd_init_pins()  argument
139 struct intel_hotplug *hpd = &display->hotplug; in intel_hpd_init_pins()
141 if (HAS_GMCH(display)) { in intel_hpd_init_pins()
142 if (display->platform.g4x || display->platform.valleyview || in intel_hpd_init_pins()
143 display->platform.cherryview) in intel_hpd_init_pins()
150 if (DISPLAY_VER(display) >= 14) in intel_hpd_init_pins()
152 else if (DISPLAY_VER(display) >= 11) in intel_hpd_init_pins()
154 else if (display->platform.geminilake || display->platform.broxton) in intel_hpd_init_pins()
156 else if (DISPLAY_VER(display) == 9) in intel_hpd_init_pins()
158 else if (DISPLAY_VER(display) >= 8) in intel_hpd_init_pins()
160 else if (DISPLAY_VER(display) >= 7) in intel_hpd_init_pins()
165 if ((INTEL_PCH_TYPE(display) < PCH_DG1) && in intel_hpd_init_pins()
166 (!HAS_PCH_SPLIT(display) || HAS_PCH_NOP(display))) in intel_hpd_init_pins()
169 if (INTEL_PCH_TYPE(display) >= PCH_MTL) in intel_hpd_init_pins()
171 else if (INTEL_PCH_TYPE(display) >= PCH_DG1) in intel_hpd_init_pins()
173 else if (INTEL_PCH_TYPE(display) >= PCH_ICP) in intel_hpd_init_pins()
175 else if (HAS_PCH_CNP(display) || HAS_PCH_SPT(display)) in intel_hpd_init_pins()
177 else if (HAS_PCH_LPT(display) || HAS_PCH_CPT(display)) in intel_hpd_init_pins()
179 else if (HAS_PCH_IBX(display)) in intel_hpd_init_pins()
182 MISSING_CASE(INTEL_PCH_TYPE(display)); in intel_hpd_init_pins()
186 void i915_hotplug_interrupt_update_locked(struct intel_display *display, in i915_hotplug_interrupt_update_locked() argument
189 lockdep_assert_held(&display->irq.lock); in i915_hotplug_interrupt_update_locked()
190 drm_WARN_ON(display->drm, bits & ~mask); in i915_hotplug_interrupt_update_locked()
192 intel_de_rmw(display, PORT_HOTPLUG_EN(display), mask, bits); in i915_hotplug_interrupt_update_locked()
207 void i915_hotplug_interrupt_update(struct intel_display *display, in i915_hotplug_interrupt_update() argument
211 spin_lock_irq(&display->irq.lock); in i915_hotplug_interrupt_update()
212 i915_hotplug_interrupt_update_locked(display, mask, bits); in i915_hotplug_interrupt_update()
213 spin_unlock_irq(&display->irq.lock); in i915_hotplug_interrupt_update()
344 static void intel_get_hpd_pins(struct intel_display *display, in intel_get_hpd_pins() argument
364 drm_dbg_kms(display->drm, in intel_get_hpd_pins()
369 static u32 intel_hpd_enabled_irqs(struct intel_display *display, in intel_hpd_enabled_irqs() argument
375 for_each_intel_encoder(display->drm, encoder) in intel_hpd_enabled_irqs()
376 if (display->hotplug.stats[encoder->hpd_pin].state == HPD_ENABLED) in intel_hpd_enabled_irqs()
382 static u32 intel_hpd_hotplug_irqs(struct intel_display *display, in intel_hpd_hotplug_irqs() argument
388 for_each_intel_encoder(display->drm, encoder) in intel_hpd_hotplug_irqs()
394 static u32 intel_hpd_hotplug_mask(struct intel_display *display, in intel_hpd_hotplug_mask() argument
406 static u32 intel_hpd_hotplug_enables(struct intel_display *display, in intel_hpd_hotplug_enables() argument
412 for_each_intel_encoder(display->drm, encoder) in intel_hpd_hotplug_enables()
418 u32 i9xx_hpd_irq_ack(struct intel_display *display) in i9xx_hpd_irq_ack() argument
423 if (display->platform.g4x || in i9xx_hpd_irq_ack()
424 display->platform.valleyview || display->platform.cherryview) in i9xx_hpd_irq_ack()
440 u32 tmp = intel_de_read(display, in i9xx_hpd_irq_ack()
441 PORT_HOTPLUG_STAT(display)) & hotplug_status_mask; in i9xx_hpd_irq_ack()
447 intel_de_write(display, PORT_HOTPLUG_STAT(display), in i9xx_hpd_irq_ack()
451 drm_WARN_ONCE(display->drm, 1, in i9xx_hpd_irq_ack()
453 intel_de_read(display, PORT_HOTPLUG_STAT(display))); in i9xx_hpd_irq_ack()
458 void i9xx_hpd_irq_handler(struct intel_display *display, u32 hotplug_status) in i9xx_hpd_irq_handler() argument
463 if (display->platform.g4x || in i9xx_hpd_irq_handler()
464 display->platform.valleyview || display->platform.cherryview) in i9xx_hpd_irq_handler()
470 intel_get_hpd_pins(display, &pin_mask, &long_mask, in i9xx_hpd_irq_handler()
472 display->hotplug.hpd, in i9xx_hpd_irq_handler()
475 intel_hpd_irq_handler(display, pin_mask, long_mask); in i9xx_hpd_irq_handler()
478 if ((display->platform.g4x || in i9xx_hpd_irq_handler()
479 display->platform.valleyview || display->platform.cherryview) && in i9xx_hpd_irq_handler()
481 intel_dp_aux_irq_handler(display); in i9xx_hpd_irq_handler()
484 void ibx_hpd_irq_handler(struct intel_display *display, u32 hotplug_trigger) in ibx_hpd_irq_handler() argument
494 dig_hotplug_reg = intel_de_read(display, PCH_PORT_HOTPLUG); in ibx_hpd_irq_handler()
503 intel_de_write(display, PCH_PORT_HOTPLUG, dig_hotplug_reg); in ibx_hpd_irq_handler()
507 intel_get_hpd_pins(display, &pin_mask, &long_mask, in ibx_hpd_irq_handler()
509 display->hotplug.pch_hpd, in ibx_hpd_irq_handler()
512 intel_hpd_irq_handler(display, pin_mask, long_mask); in ibx_hpd_irq_handler()
515 void xelpdp_pica_irq_handler(struct intel_display *display, u32 iir) in xelpdp_pica_irq_handler() argument
522 if (DISPLAY_VER(display) >= 20) in xelpdp_pica_irq_handler()
528 if (!(display->hotplug.hpd[pin] & hotplug_trigger)) in xelpdp_pica_irq_handler()
533 val = intel_de_read(display, XELPDP_PORT_HOTPLUG_CTL(pin)); in xelpdp_pica_irq_handler()
534 intel_de_write(display, XELPDP_PORT_HOTPLUG_CTL(pin), val); in xelpdp_pica_irq_handler()
541 drm_dbg_kms(display->drm, in xelpdp_pica_irq_handler()
545 intel_hpd_irq_handler(display, pin_mask, long_mask); in xelpdp_pica_irq_handler()
549 intel_dp_aux_irq_handler(display); in xelpdp_pica_irq_handler()
552 drm_err(display->drm, in xelpdp_pica_irq_handler()
556 void icp_irq_handler(struct intel_display *display, u32 pch_iir) in icp_irq_handler() argument
566 spin_lock(&display->irq.lock); in icp_irq_handler()
567 dig_hotplug_reg = intel_de_rmw(display, SHOTPLUG_CTL_DDI, 0, 0); in icp_irq_handler()
568 spin_unlock(&display->irq.lock); in icp_irq_handler()
570 intel_get_hpd_pins(display, &pin_mask, &long_mask, in icp_irq_handler()
572 display->hotplug.pch_hpd, in icp_irq_handler()
579 dig_hotplug_reg = intel_de_rmw(display, SHOTPLUG_CTL_TC, 0, 0); in icp_irq_handler()
581 intel_get_hpd_pins(display, &pin_mask, &long_mask, in icp_irq_handler()
583 display->hotplug.pch_hpd, in icp_irq_handler()
588 intel_hpd_irq_handler(display, pin_mask, long_mask); in icp_irq_handler()
591 intel_gmbus_irq_handler(display); in icp_irq_handler()
594 void spt_irq_handler(struct intel_display *display, u32 pch_iir) in spt_irq_handler() argument
604 dig_hotplug_reg = intel_de_rmw(display, PCH_PORT_HOTPLUG, 0, 0); in spt_irq_handler()
606 intel_get_hpd_pins(display, &pin_mask, &long_mask, in spt_irq_handler()
608 display->hotplug.pch_hpd, in spt_irq_handler()
615 dig_hotplug_reg = intel_de_rmw(display, PCH_PORT_HOTPLUG2, 0, 0); in spt_irq_handler()
617 intel_get_hpd_pins(display, &pin_mask, &long_mask, in spt_irq_handler()
619 display->hotplug.pch_hpd, in spt_irq_handler()
624 intel_hpd_irq_handler(display, pin_mask, long_mask); in spt_irq_handler()
627 intel_gmbus_irq_handler(display); in spt_irq_handler()
630 void ilk_hpd_irq_handler(struct intel_display *display, u32 hotplug_trigger) in ilk_hpd_irq_handler() argument
634 dig_hotplug_reg = intel_de_rmw(display, DIGITAL_PORT_HOTPLUG_CNTRL, 0, 0); in ilk_hpd_irq_handler()
636 intel_get_hpd_pins(display, &pin_mask, &long_mask, in ilk_hpd_irq_handler()
638 display->hotplug.hpd, in ilk_hpd_irq_handler()
641 intel_hpd_irq_handler(display, pin_mask, long_mask); in ilk_hpd_irq_handler()
644 void bxt_hpd_irq_handler(struct intel_display *display, u32 hotplug_trigger) in bxt_hpd_irq_handler() argument
648 dig_hotplug_reg = intel_de_rmw(display, PCH_PORT_HOTPLUG, 0, 0); in bxt_hpd_irq_handler()
650 intel_get_hpd_pins(display, &pin_mask, &long_mask, in bxt_hpd_irq_handler()
652 display->hotplug.hpd, in bxt_hpd_irq_handler()
655 intel_hpd_irq_handler(display, pin_mask, long_mask); in bxt_hpd_irq_handler()
658 void gen11_hpd_irq_handler(struct intel_display *display, u32 iir) in gen11_hpd_irq_handler() argument
667 dig_hotplug_reg = intel_de_rmw(display, GEN11_TC_HOTPLUG_CTL, 0, 0); in gen11_hpd_irq_handler()
669 intel_get_hpd_pins(display, &pin_mask, &long_mask, in gen11_hpd_irq_handler()
671 display->hotplug.hpd, in gen11_hpd_irq_handler()
678 dig_hotplug_reg = intel_de_rmw(display, GEN11_TBT_HOTPLUG_CTL, 0, 0); in gen11_hpd_irq_handler()
680 intel_get_hpd_pins(display, &pin_mask, &long_mask, in gen11_hpd_irq_handler()
682 display->hotplug.hpd, in gen11_hpd_irq_handler()
687 intel_hpd_irq_handler(display, pin_mask, long_mask); in gen11_hpd_irq_handler()
689 drm_err(display->drm, in gen11_hpd_irq_handler()
711 struct intel_display *display = to_intel_display(encoder); in ibx_hotplug_enables() local
719 return HAS_PCH_LPT_LP(display) ? in ibx_hotplug_enables()
735 static void ibx_hpd_detection_setup(struct intel_display *display) in ibx_hpd_detection_setup() argument
742 intel_de_rmw(display, PCH_PORT_HOTPLUG, in ibx_hpd_detection_setup()
743 intel_hpd_hotplug_mask(display, ibx_hotplug_mask), in ibx_hpd_detection_setup()
744 intel_hpd_hotplug_enables(display, ibx_hotplug_enables)); in ibx_hpd_detection_setup()
749 struct intel_display *display = to_intel_display(encoder); in ibx_hpd_enable_detection() local
751 intel_de_rmw(display, PCH_PORT_HOTPLUG, in ibx_hpd_enable_detection()
756 static void ibx_hpd_irq_setup(struct intel_display *display) in ibx_hpd_irq_setup() argument
760 enabled_irqs = intel_hpd_enabled_irqs(display, display->hotplug.pch_hpd); in ibx_hpd_irq_setup()
761 hotplug_irqs = intel_hpd_hotplug_irqs(display, display->hotplug.pch_hpd); in ibx_hpd_irq_setup()
763 ibx_display_interrupt_update(display, hotplug_irqs, enabled_irqs); in ibx_hpd_irq_setup()
765 ibx_hpd_detection_setup(display); in ibx_hpd_irq_setup()
806 static void icp_ddi_hpd_detection_setup(struct intel_display *display) in icp_ddi_hpd_detection_setup() argument
808 intel_de_rmw(display, SHOTPLUG_CTL_DDI, in icp_ddi_hpd_detection_setup()
809 intel_hpd_hotplug_mask(display, icp_ddi_hotplug_mask), in icp_ddi_hpd_detection_setup()
810 intel_hpd_hotplug_enables(display, icp_ddi_hotplug_enables)); in icp_ddi_hpd_detection_setup()
815 struct intel_display *display = to_intel_display(encoder); in icp_ddi_hpd_enable_detection() local
817 intel_de_rmw(display, SHOTPLUG_CTL_DDI, in icp_ddi_hpd_enable_detection()
822 static void icp_tc_hpd_detection_setup(struct intel_display *display) in icp_tc_hpd_detection_setup() argument
824 intel_de_rmw(display, SHOTPLUG_CTL_TC, in icp_tc_hpd_detection_setup()
825 intel_hpd_hotplug_mask(display, icp_tc_hotplug_mask), in icp_tc_hpd_detection_setup()
826 intel_hpd_hotplug_enables(display, icp_tc_hotplug_enables)); in icp_tc_hpd_detection_setup()
831 struct intel_display *display = to_intel_display(encoder); in icp_tc_hpd_enable_detection() local
833 intel_de_rmw(display, SHOTPLUG_CTL_TC, in icp_tc_hpd_enable_detection()
844 static void icp_hpd_irq_setup(struct intel_display *display) in icp_hpd_irq_setup() argument
848 enabled_irqs = intel_hpd_enabled_irqs(display, display->hotplug.pch_hpd); in icp_hpd_irq_setup()
849 hotplug_irqs = intel_hpd_hotplug_irqs(display, display->hotplug.pch_hpd); in icp_hpd_irq_setup()
855 intel_de_write(display, SHPD_FILTER_CNT, SHPD_FILTER_CNT_250); in icp_hpd_irq_setup()
857 ibx_display_interrupt_update(display, hotplug_irqs, enabled_irqs); in icp_hpd_irq_setup()
859 icp_ddi_hpd_detection_setup(display); in icp_hpd_irq_setup()
860 icp_tc_hpd_detection_setup(display); in icp_hpd_irq_setup()
883 static void dg1_hpd_invert(struct intel_display *display) in dg1_hpd_invert() argument
889 intel_de_rmw(display, SOUTH_CHICKEN1, 0, val); in dg1_hpd_invert()
894 struct intel_display *display = to_intel_display(encoder); in dg1_hpd_enable_detection() local
896 dg1_hpd_invert(display); in dg1_hpd_enable_detection()
900 static void dg1_hpd_irq_setup(struct intel_display *display) in dg1_hpd_irq_setup() argument
902 dg1_hpd_invert(display); in dg1_hpd_irq_setup()
903 icp_hpd_irq_setup(display); in dg1_hpd_irq_setup()
906 static void gen11_tc_hpd_detection_setup(struct intel_display *display) in gen11_tc_hpd_detection_setup() argument
908 intel_de_rmw(display, GEN11_TC_HOTPLUG_CTL, in gen11_tc_hpd_detection_setup()
909 intel_hpd_hotplug_mask(display, gen11_hotplug_mask), in gen11_tc_hpd_detection_setup()
910 intel_hpd_hotplug_enables(display, gen11_hotplug_enables)); in gen11_tc_hpd_detection_setup()
915 struct intel_display *display = to_intel_display(encoder); in gen11_tc_hpd_enable_detection() local
917 intel_de_rmw(display, GEN11_TC_HOTPLUG_CTL, in gen11_tc_hpd_enable_detection()
922 static void gen11_tbt_hpd_detection_setup(struct intel_display *display) in gen11_tbt_hpd_detection_setup() argument
924 intel_de_rmw(display, GEN11_TBT_HOTPLUG_CTL, in gen11_tbt_hpd_detection_setup()
925 intel_hpd_hotplug_mask(display, gen11_hotplug_mask), in gen11_tbt_hpd_detection_setup()
926 intel_hpd_hotplug_enables(display, gen11_hotplug_enables)); in gen11_tbt_hpd_detection_setup()
931 struct intel_display *display = to_intel_display(encoder); in gen11_tbt_hpd_enable_detection() local
933 intel_de_rmw(display, GEN11_TBT_HOTPLUG_CTL, in gen11_tbt_hpd_enable_detection()
940 struct intel_display *display = to_intel_display(encoder); in gen11_hpd_enable_detection() local
945 if (INTEL_PCH_TYPE(display) >= PCH_ICP) in gen11_hpd_enable_detection()
949 static void gen11_hpd_irq_setup(struct intel_display *display) in gen11_hpd_irq_setup() argument
953 enabled_irqs = intel_hpd_enabled_irqs(display, display->hotplug.hpd); in gen11_hpd_irq_setup()
954 hotplug_irqs = intel_hpd_hotplug_irqs(display, display->hotplug.hpd); in gen11_hpd_irq_setup()
956 intel_de_rmw(display, GEN11_DE_HPD_IMR, hotplug_irqs, in gen11_hpd_irq_setup()
958 intel_de_posting_read(display, GEN11_DE_HPD_IMR); in gen11_hpd_irq_setup()
960 gen11_tc_hpd_detection_setup(display); in gen11_hpd_irq_setup()
961 gen11_tbt_hpd_detection_setup(display); in gen11_hpd_irq_setup()
963 if (INTEL_PCH_TYPE(display) >= PCH_ICP) in gen11_hpd_irq_setup()
964 icp_hpd_irq_setup(display); in gen11_hpd_irq_setup()
1001 static void mtp_ddi_hpd_detection_setup(struct intel_display *display) in mtp_ddi_hpd_detection_setup() argument
1003 intel_de_rmw(display, SHOTPLUG_CTL_DDI, in mtp_ddi_hpd_detection_setup()
1004 intel_hpd_hotplug_mask(display, mtp_ddi_hotplug_mask), in mtp_ddi_hpd_detection_setup()
1005 intel_hpd_hotplug_enables(display, mtp_ddi_hotplug_enables)); in mtp_ddi_hpd_detection_setup()
1010 struct intel_display *display = to_intel_display(encoder); in mtp_ddi_hpd_enable_detection() local
1012 intel_de_rmw(display, SHOTPLUG_CTL_DDI, in mtp_ddi_hpd_enable_detection()
1017 static void mtp_tc_hpd_detection_setup(struct intel_display *display) in mtp_tc_hpd_detection_setup() argument
1019 intel_de_rmw(display, SHOTPLUG_CTL_TC, in mtp_tc_hpd_detection_setup()
1020 intel_hpd_hotplug_mask(display, mtp_tc_hotplug_mask), in mtp_tc_hpd_detection_setup()
1021 intel_hpd_hotplug_enables(display, mtp_tc_hotplug_enables)); in mtp_tc_hpd_detection_setup()
1026 struct intel_display *display = to_intel_display(encoder); in mtp_tc_hpd_enable_detection() local
1028 intel_de_rmw(display, SHOTPLUG_CTL_DDI, in mtp_tc_hpd_enable_detection()
1033 static void mtp_hpd_invert(struct intel_display *display) in mtp_hpd_invert() argument
1044 intel_de_rmw(display, SOUTH_CHICKEN1, 0, val); in mtp_hpd_invert()
1049 struct intel_display *display = to_intel_display(encoder); in mtp_hpd_enable_detection() local
1051 mtp_hpd_invert(display); in mtp_hpd_enable_detection()
1056 static void mtp_hpd_irq_setup(struct intel_display *display) in mtp_hpd_irq_setup() argument
1060 enabled_irqs = intel_hpd_enabled_irqs(display, display->hotplug.pch_hpd); in mtp_hpd_irq_setup()
1061 hotplug_irqs = intel_hpd_hotplug_irqs(display, display->hotplug.pch_hpd); in mtp_hpd_irq_setup()
1067 intel_de_write(display, SHPD_FILTER_CNT, SHPD_FILTER_CNT_250); in mtp_hpd_irq_setup()
1069 mtp_hpd_invert(display); in mtp_hpd_irq_setup()
1070 ibx_display_interrupt_update(display, hotplug_irqs, enabled_irqs); in mtp_hpd_irq_setup()
1072 mtp_ddi_hpd_detection_setup(display); in mtp_hpd_irq_setup()
1073 mtp_tc_hpd_detection_setup(display); in mtp_hpd_irq_setup()
1076 static void xe2lpd_sde_hpd_irq_setup(struct intel_display *display) in xe2lpd_sde_hpd_irq_setup() argument
1080 enabled_irqs = intel_hpd_enabled_irqs(display, display->hotplug.pch_hpd); in xe2lpd_sde_hpd_irq_setup()
1081 hotplug_irqs = intel_hpd_hotplug_irqs(display, display->hotplug.pch_hpd); in xe2lpd_sde_hpd_irq_setup()
1083 ibx_display_interrupt_update(display, hotplug_irqs, enabled_irqs); in xe2lpd_sde_hpd_irq_setup()
1085 mtp_ddi_hpd_detection_setup(display); in xe2lpd_sde_hpd_irq_setup()
1086 mtp_tc_hpd_detection_setup(display); in xe2lpd_sde_hpd_irq_setup()
1094 static void _xelpdp_pica_hpd_detection_setup(struct intel_display *display, in _xelpdp_pica_hpd_detection_setup() argument
1103 intel_de_rmw(display, XELPDP_PORT_HOTPLUG_CTL(hpd_pin), in _xelpdp_pica_hpd_detection_setup()
1109 struct intel_display *display = to_intel_display(encoder); in xelpdp_pica_hpd_enable_detection() local
1111 _xelpdp_pica_hpd_detection_setup(display, encoder->hpd_pin, true); in xelpdp_pica_hpd_enable_detection()
1114 static void xelpdp_pica_hpd_detection_setup(struct intel_display *display) in xelpdp_pica_hpd_detection_setup() argument
1122 for_each_intel_encoder(display->drm, encoder) in xelpdp_pica_hpd_detection_setup()
1126 _xelpdp_pica_hpd_detection_setup(display, pin, available_pins & BIT(pin)); in xelpdp_pica_hpd_detection_setup()
1135 static void xelpdp_hpd_irq_setup(struct intel_display *display) in xelpdp_hpd_irq_setup() argument
1139 enabled_irqs = intel_hpd_enabled_irqs(display, display->hotplug.hpd); in xelpdp_hpd_irq_setup()
1140 hotplug_irqs = intel_hpd_hotplug_irqs(display, display->hotplug.hpd); in xelpdp_hpd_irq_setup()
1142 intel_de_rmw(display, PICAINTERRUPT_IMR, hotplug_irqs, in xelpdp_hpd_irq_setup()
1144 intel_de_posting_read(display, PICAINTERRUPT_IMR); in xelpdp_hpd_irq_setup()
1146 xelpdp_pica_hpd_detection_setup(display); in xelpdp_hpd_irq_setup()
1148 if (INTEL_PCH_TYPE(display) >= PCH_LNL) in xelpdp_hpd_irq_setup()
1149 xe2lpd_sde_hpd_irq_setup(display); in xelpdp_hpd_irq_setup()
1150 else if (INTEL_PCH_TYPE(display) >= PCH_MTL) in xelpdp_hpd_irq_setup()
1151 mtp_hpd_irq_setup(display); in xelpdp_hpd_irq_setup()
1190 static void spt_hpd_detection_setup(struct intel_display *display) in spt_hpd_detection_setup() argument
1193 if (HAS_PCH_CNP(display)) { in spt_hpd_detection_setup()
1194 intel_de_rmw(display, SOUTH_CHICKEN1, CHASSIS_CLK_REQ_DURATION_MASK, in spt_hpd_detection_setup()
1199 intel_de_rmw(display, PCH_PORT_HOTPLUG, in spt_hpd_detection_setup()
1200 intel_hpd_hotplug_mask(display, spt_hotplug_mask), in spt_hpd_detection_setup()
1201 intel_hpd_hotplug_enables(display, spt_hotplug_enables)); in spt_hpd_detection_setup()
1203 intel_de_rmw(display, PCH_PORT_HOTPLUG2, in spt_hpd_detection_setup()
1204 intel_hpd_hotplug_mask(display, spt_hotplug2_mask), in spt_hpd_detection_setup()
1205 intel_hpd_hotplug_enables(display, spt_hotplug2_enables)); in spt_hpd_detection_setup()
1210 struct intel_display *display = to_intel_display(encoder); in spt_hpd_enable_detection() local
1213 if (HAS_PCH_CNP(display)) { in spt_hpd_enable_detection()
1214 intel_de_rmw(display, SOUTH_CHICKEN1, in spt_hpd_enable_detection()
1219 intel_de_rmw(display, PCH_PORT_HOTPLUG, in spt_hpd_enable_detection()
1223 intel_de_rmw(display, PCH_PORT_HOTPLUG2, in spt_hpd_enable_detection()
1228 static void spt_hpd_irq_setup(struct intel_display *display) in spt_hpd_irq_setup() argument
1232 if (INTEL_PCH_TYPE(display) >= PCH_CNP) in spt_hpd_irq_setup()
1233 intel_de_write(display, SHPD_FILTER_CNT, SHPD_FILTER_CNT_500_ADJ); in spt_hpd_irq_setup()
1235 enabled_irqs = intel_hpd_enabled_irqs(display, display->hotplug.pch_hpd); in spt_hpd_irq_setup()
1236 hotplug_irqs = intel_hpd_hotplug_irqs(display, display->hotplug.pch_hpd); in spt_hpd_irq_setup()
1238 ibx_display_interrupt_update(display, hotplug_irqs, enabled_irqs); in spt_hpd_irq_setup()
1240 spt_hpd_detection_setup(display); in spt_hpd_irq_setup()
1265 static void ilk_hpd_detection_setup(struct intel_display *display) in ilk_hpd_detection_setup() argument
1272 intel_de_rmw(display, DIGITAL_PORT_HOTPLUG_CNTRL, in ilk_hpd_detection_setup()
1273 intel_hpd_hotplug_mask(display, ilk_hotplug_mask), in ilk_hpd_detection_setup()
1274 intel_hpd_hotplug_enables(display, ilk_hotplug_enables)); in ilk_hpd_detection_setup()
1279 struct intel_display *display = to_intel_display(encoder); in ilk_hpd_enable_detection() local
1281 intel_de_rmw(display, DIGITAL_PORT_HOTPLUG_CNTRL, in ilk_hpd_enable_detection()
1288 static void ilk_hpd_irq_setup(struct intel_display *display) in ilk_hpd_irq_setup() argument
1292 enabled_irqs = intel_hpd_enabled_irqs(display, display->hotplug.hpd); in ilk_hpd_irq_setup()
1293 hotplug_irqs = intel_hpd_hotplug_irqs(display, display->hotplug.hpd); in ilk_hpd_irq_setup()
1295 if (DISPLAY_VER(display) >= 8) in ilk_hpd_irq_setup()
1296 bdw_update_port_irq(display, hotplug_irqs, enabled_irqs); in ilk_hpd_irq_setup()
1298 ilk_update_display_irq(display, hotplug_irqs, enabled_irqs); in ilk_hpd_irq_setup()
1300 ilk_hpd_detection_setup(display); in ilk_hpd_irq_setup()
1302 ibx_hpd_irq_setup(display); in ilk_hpd_irq_setup()
1344 static void bxt_hpd_detection_setup(struct intel_display *display) in bxt_hpd_detection_setup() argument
1346 intel_de_rmw(display, PCH_PORT_HOTPLUG, in bxt_hpd_detection_setup()
1347 intel_hpd_hotplug_mask(display, bxt_hotplug_mask), in bxt_hpd_detection_setup()
1348 intel_hpd_hotplug_enables(display, bxt_hotplug_enables)); in bxt_hpd_detection_setup()
1353 struct intel_display *display = to_intel_display(encoder); in bxt_hpd_enable_detection() local
1355 intel_de_rmw(display, PCH_PORT_HOTPLUG, in bxt_hpd_enable_detection()
1360 static void bxt_hpd_irq_setup(struct intel_display *display) in bxt_hpd_irq_setup() argument
1364 enabled_irqs = intel_hpd_enabled_irqs(display, display->hotplug.hpd); in bxt_hpd_irq_setup()
1365 hotplug_irqs = intel_hpd_hotplug_irqs(display, display->hotplug.hpd); in bxt_hpd_irq_setup()
1367 bdw_update_port_irq(display, hotplug_irqs, enabled_irqs); in bxt_hpd_irq_setup()
1369 bxt_hpd_detection_setup(display); in bxt_hpd_irq_setup()
1372 static void g45_hpd_peg_band_gap_wa(struct intel_display *display) in g45_hpd_peg_band_gap_wa() argument
1379 intel_de_rmw(display, PEG_BAND_GAP_DATA, 0xf, 0xd); in g45_hpd_peg_band_gap_wa()
1384 struct intel_display *display = to_intel_display(encoder); in i915_hpd_enable_detection() local
1387 if (display->platform.g45) in i915_hpd_enable_detection()
1388 g45_hpd_peg_band_gap_wa(display); in i915_hpd_enable_detection()
1391 i915_hotplug_interrupt_update(display, hotplug_en, hotplug_en); in i915_hpd_enable_detection()
1394 static void i915_hpd_irq_setup(struct intel_display *display) in i915_hpd_irq_setup() argument
1398 lockdep_assert_held(&display->irq.lock); in i915_hpd_irq_setup()
1404 hotplug_en = intel_hpd_enabled_irqs(display, hpd_mask_i915); in i915_hpd_irq_setup()
1409 if (display->platform.g4x) in i915_hpd_irq_setup()
1413 if (display->platform.g45) in i915_hpd_irq_setup()
1414 g45_hpd_peg_band_gap_wa(display); in i915_hpd_irq_setup()
1417 i915_hotplug_interrupt_update_locked(display, in i915_hpd_irq_setup()
1426 void (*hpd_irq_setup)(struct intel_display *display);
1449 struct intel_display *display = to_intel_display(encoder); in intel_hpd_enable_detection() local
1451 if (display->funcs.hotplug) in intel_hpd_enable_detection()
1452 display->funcs.hotplug->hpd_enable_detection(encoder); in intel_hpd_enable_detection()
1455 void intel_hpd_irq_setup(struct intel_display *display) in intel_hpd_irq_setup() argument
1457 if ((display->platform.valleyview || display->platform.cherryview) && in intel_hpd_irq_setup()
1458 !display->irq.vlv_display_irqs_enabled) in intel_hpd_irq_setup()
1461 if (display->funcs.hotplug) in intel_hpd_irq_setup()
1462 display->funcs.hotplug->hpd_irq_setup(display); in intel_hpd_irq_setup()
1465 void intel_hotplug_irq_init(struct intel_display *display) in intel_hotplug_irq_init() argument
1467 intel_hpd_init_pins(display); in intel_hotplug_irq_init()
1469 intel_hpd_init_early(display); in intel_hotplug_irq_init()
1471 if (HAS_GMCH(display)) { in intel_hotplug_irq_init()
1472 if (HAS_HOTPLUG(display)) in intel_hotplug_irq_init()
1473 display->funcs.hotplug = &i915_hpd_funcs; in intel_hotplug_irq_init()
1475 if (HAS_PCH_DG2(display)) in intel_hotplug_irq_init()
1476 display->funcs.hotplug = &icp_hpd_funcs; in intel_hotplug_irq_init()
1477 else if (HAS_PCH_DG1(display)) in intel_hotplug_irq_init()
1478 display->funcs.hotplug = &dg1_hpd_funcs; in intel_hotplug_irq_init()
1479 else if (DISPLAY_VER(display) >= 14) in intel_hotplug_irq_init()
1480 display->funcs.hotplug = &xelpdp_hpd_funcs; in intel_hotplug_irq_init()
1481 else if (DISPLAY_VER(display) >= 11) in intel_hotplug_irq_init()
1482 display->funcs.hotplug = &gen11_hpd_funcs; in intel_hotplug_irq_init()
1483 else if (display->platform.geminilake || display->platform.broxton) in intel_hotplug_irq_init()
1484 display->funcs.hotplug = &bxt_hpd_funcs; in intel_hotplug_irq_init()
1485 else if (INTEL_PCH_TYPE(display) >= PCH_ICP) in intel_hotplug_irq_init()
1486 display->funcs.hotplug = &icp_hpd_funcs; in intel_hotplug_irq_init()
1487 else if (INTEL_PCH_TYPE(display) >= PCH_SPT) in intel_hotplug_irq_init()
1488 display->funcs.hotplug = &spt_hpd_funcs; in intel_hotplug_irq_init()
1490 display->funcs.hotplug = &ilk_hpd_funcs; in intel_hotplug_irq_init()