@@ -1955,16 +1955,12 @@ static int get_init_otp_deassert_fragment_len(struct drm_i915_private *i915,
19551955 * these devices we split the init OTP sequence into a deassert sequence and
19561956 * the actual init OTP part.
19571957 */
1958- static void fixup_mipi_sequences (struct drm_i915_private * i915 ,
1959- struct intel_panel * panel )
1958+ static void vlv_fixup_mipi_sequences (struct drm_i915_private * i915 ,
1959+ struct intel_panel * panel )
19601960{
19611961 u8 * init_otp ;
19621962 int len ;
19631963
1964- /* Limit this to VLV for now. */
1965- if (!IS_VALLEYVIEW (i915 ))
1966- return ;
1967-
19681964 /* Limit this to v1 vid-mode sequences */
19691965 if (panel -> vbt .dsi .config -> is_cmd_mode ||
19701966 panel -> vbt .dsi .seq_version != 1 )
@@ -2000,6 +1996,41 @@ static void fixup_mipi_sequences(struct drm_i915_private *i915,
20001996 panel -> vbt .dsi .sequence [MIPI_SEQ_INIT_OTP ] = init_otp + len - 1 ;
20011997}
20021998
1999+ /*
2000+ * Some machines (eg. Lenovo 82TQ) appear to have broken
2001+ * VBT sequences:
2002+ * - INIT_OTP is not present at all
2003+ * - what should be in INIT_OTP is in DISPLAY_ON
2004+ * - what should be in DISPLAY_ON is in BACKLIGHT_ON
2005+ * (along with the actual backlight stuff)
2006+ *
2007+ * To make those work we simply swap DISPLAY_ON and INIT_OTP.
2008+ *
2009+ * TODO: Do we need to limit this to specific machines,
2010+ * or examine the contents of the sequences to
2011+ * avoid false positives?
2012+ */
2013+ static void icl_fixup_mipi_sequences (struct drm_i915_private * i915 ,
2014+ struct intel_panel * panel )
2015+ {
2016+ if (!panel -> vbt .dsi .sequence [MIPI_SEQ_INIT_OTP ] &&
2017+ panel -> vbt .dsi .sequence [MIPI_SEQ_DISPLAY_ON ]) {
2018+ drm_dbg_kms (& i915 -> drm , "Broken VBT: Swapping INIT_OTP and DISPLAY_ON sequences\n" );
2019+
2020+ swap (panel -> vbt .dsi .sequence [MIPI_SEQ_INIT_OTP ],
2021+ panel -> vbt .dsi .sequence [MIPI_SEQ_DISPLAY_ON ]);
2022+ }
2023+ }
2024+
2025+ static void fixup_mipi_sequences (struct drm_i915_private * i915 ,
2026+ struct intel_panel * panel )
2027+ {
2028+ if (DISPLAY_VER (i915 ) >= 11 )
2029+ icl_fixup_mipi_sequences (i915 , panel );
2030+ else if (IS_VALLEYVIEW (i915 ))
2031+ vlv_fixup_mipi_sequences (i915 , panel );
2032+ }
2033+
20032034static void
20042035parse_mipi_sequence (struct drm_i915_private * i915 ,
20052036 struct intel_panel * panel )
@@ -3351,6 +3382,9 @@ bool intel_bios_encoder_supports_dp_dual_mode(const struct intel_bios_encoder_da
33513382{
33523383 const struct child_device_config * child = & devdata -> child ;
33533384
3385+ if (!devdata )
3386+ return false;
3387+
33543388 if (!intel_bios_encoder_supports_dp (devdata ) ||
33553389 !intel_bios_encoder_supports_hdmi (devdata ))
33563390 return false;
0 commit comments