Skip to content

Commit 94ae461

Browse files
committed
drm/i915/dsi: Go back to the previous INIT_OTP/DISPLAY_ON order, mostly
Reinstate commit 88b0659 ("drm/i915/dsi: Do display on sequence later on icl+"), for the most part. Turns out some machines (eg. Chuwi Minibook X) really do need that updated order. It is also the order the Windows driver uses. However we can't just undo the revert since that would again break Lenovo 82TQ. After staring at the VBT sequences for both machines I've concluded that the Lenovo 82TQ sequences look somewhat broken: - INIT_OTP is not present at all - what should be in INIT_OTP is found in DISPLAY_ON - what should be in DISPLAY_ON is found in BACKLIGHT_ON (along with the actual backlight stuff) The Chuwi Minibook X on the other hand has a full complement of sequences in its VBT. So let's try to deal with the broken sequences in the Lenovo 82TQ VBT by simply swapping the (non-existent) INIT_OTP sequence with the DISPLAY_ON sequence. Thus we execute DISPLAY_ON when intending to execute INIT_OTP, and execute nothing at all when intending to execute DISPLAY_ON. That should be 100% equivalent to the revert, for such broken VBTs. Cc: stable@vger.kernel.org Fixes: dc524d0 ("Revert "drm/i915/dsi: Do display on sequence later on icl+"") References: https://gitlab.freedesktop.org/drm/intel/-/issues/10071 Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10334 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240305083659.8396-1-ville.syrjala@linux.intel.com Acked-by: Jani Nikula <jani.nikula@intel.com>
1 parent b7232a7 commit 94ae461

File tree

2 files changed

+39
-7
lines changed

2 files changed

+39
-7
lines changed

drivers/gpu/drm/i915/display/icl_dsi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,6 @@ static void gen11_dsi_powerup_panel(struct intel_encoder *encoder)
11551155
}
11561156

11571157
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_INIT_OTP);
1158-
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DISPLAY_ON);
11591158

11601159
/* ensure all panel commands dispatched before enabling transcoder */
11611160
wait_for_cmds_dispatched_to_panel(encoder);
@@ -1256,6 +1255,8 @@ static void gen11_dsi_enable(struct intel_atomic_state *state,
12561255
/* step6d: enable dsi transcoder */
12571256
gen11_dsi_enable_transcoder(encoder);
12581257

1258+
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DISPLAY_ON);
1259+
12591260
/* step7: enable backlight */
12601261
intel_backlight_enable(crtc_state, conn_state);
12611262
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_BACKLIGHT_ON);

drivers/gpu/drm/i915/display/intel_bios.c

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
20032034
static void
20042035
parse_mipi_sequence(struct drm_i915_private *i915,
20052036
struct intel_panel *panel)

0 commit comments

Comments
 (0)