Skip to content

Commit c8c2969

Browse files
jwrdegoedejlahtine-intel
authored andcommitted
drm/i915/dsi: Use unconditional msleep() instead of intel_dsi_msleep()
The intel_dsi_msleep() helper skips sleeping if the MIPI-sequences have a version of 3 or newer and the panel is in vid-mode. This is based on the big comment around line 730 which starts with "Panel enable/disable sequences from the VBT spec.", where the "v3 video mode seq" column does not have any wait t# entries. Checking the Windows driver shows that it does always honor the VBT delays independent of the version of the VBT sequences. Commit 6fdb335 ("drm/i915/dsi: Use unconditional msleep for the panel_on_delay when there is no reset-deassert MIPI-sequence") switched to a direct msleep() instead of intel_dsi_msleep() when there is no MIPI_SEQ_DEASSERT_RESET sequence, to fix the panel on an Acer Aspire Switch 10 E SW3-016 not turning on. And now testing on a Nextbook Ares 8A shows that panel_on_delay must always be honored otherwise the panel will not turn on. Instead of only always using regular msleep() for panel_on_delay do as Windows does and always use regular msleep() everywhere were intel_dsi_msleep() is used and drop the intel_dsi_msleep() helper. Changes in v2: - Replace all intel_dsi_msleep() calls instead of just the intel_dsi_msleep(panel_on_delay) call Cc: stable@vger.kernel.org Fixes: 6fdb335 ("drm/i915/dsi: Use unconditional msleep for the panel_on_delay when there is no reset-deassert MIPI-sequence") Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230425194441.68086-1-hdegoede@redhat.com (cherry picked from commit fa83c12) Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
1 parent 6ece90e commit c8c2969

4 files changed

Lines changed: 6 additions & 30 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ static void gen11_dsi_powerup_panel(struct intel_encoder *encoder)
11401140

11411141
/* panel power on related mipi dsi vbt sequences */
11421142
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_POWER_ON);
1143-
intel_dsi_msleep(intel_dsi, intel_dsi->panel_on_delay);
1143+
msleep(intel_dsi->panel_on_delay);
11441144
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DEASSERT_RESET);
11451145
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_INIT_OTP);
11461146
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DISPLAY_ON);

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -763,17 +763,6 @@ void intel_dsi_vbt_exec_sequence(struct intel_dsi *intel_dsi,
763763
gpiod_set_value_cansleep(intel_dsi->gpio_backlight, 0);
764764
}
765765

766-
void intel_dsi_msleep(struct intel_dsi *intel_dsi, int msec)
767-
{
768-
struct intel_connector *connector = intel_dsi->attached_connector;
769-
770-
/* For v3 VBTs in vid-mode the delays are part of the VBT sequences */
771-
if (is_vid_mode(intel_dsi) && connector->panel.vbt.dsi.seq_version >= 3)
772-
return;
773-
774-
msleep(msec);
775-
}
776-
777766
void intel_dsi_log_params(struct intel_dsi *intel_dsi)
778767
{
779768
struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev);

drivers/gpu/drm/i915/display/intel_dsi_vbt.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ void intel_dsi_vbt_gpio_init(struct intel_dsi *intel_dsi, bool panel_is_on);
1616
void intel_dsi_vbt_gpio_cleanup(struct intel_dsi *intel_dsi);
1717
void intel_dsi_vbt_exec_sequence(struct intel_dsi *intel_dsi,
1818
enum mipi_seq seq_id);
19-
void intel_dsi_msleep(struct intel_dsi *intel_dsi, int msec);
2019
void intel_dsi_log_params(struct intel_dsi *intel_dsi);
2120

2221
#endif /* __INTEL_DSI_VBT_H__ */

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

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,6 @@ static void intel_dsi_pre_enable(struct intel_atomic_state *state,
737737
{
738738
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
739739
struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
740-
struct intel_connector *connector = to_intel_connector(conn_state->connector);
741740
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
742741
enum pipe pipe = crtc->pipe;
743742
enum port port;
@@ -779,21 +778,10 @@ static void intel_dsi_pre_enable(struct intel_atomic_state *state,
779778
if (!IS_GEMINILAKE(dev_priv))
780779
intel_dsi_prepare(encoder, pipe_config);
781780

781+
/* Give the panel time to power-on and then deassert its reset */
782782
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_POWER_ON);
783-
784-
/*
785-
* Give the panel time to power-on and then deassert its reset.
786-
* Depending on the VBT MIPI sequences version the deassert-seq
787-
* may contain the necessary delay, intel_dsi_msleep() will skip
788-
* the delay in that case. If there is no deassert-seq, then an
789-
* unconditional msleep is used to give the panel time to power-on.
790-
*/
791-
if (connector->panel.vbt.dsi.sequence[MIPI_SEQ_DEASSERT_RESET]) {
792-
intel_dsi_msleep(intel_dsi, intel_dsi->panel_on_delay);
793-
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DEASSERT_RESET);
794-
} else {
795-
msleep(intel_dsi->panel_on_delay);
796-
}
783+
msleep(intel_dsi->panel_on_delay);
784+
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DEASSERT_RESET);
797785

798786
if (IS_GEMINILAKE(dev_priv)) {
799787
glk_cold_boot = glk_dsi_enable_io(encoder);
@@ -827,7 +815,7 @@ static void intel_dsi_pre_enable(struct intel_atomic_state *state,
827815
msleep(20); /* XXX */
828816
for_each_dsi_port(port, intel_dsi->ports)
829817
dpi_send_cmd(intel_dsi, TURN_ON, false, port);
830-
intel_dsi_msleep(intel_dsi, 100);
818+
msleep(100);
831819

832820
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DISPLAY_ON);
833821

@@ -949,7 +937,7 @@ static void intel_dsi_post_disable(struct intel_atomic_state *state,
949937
/* Assert reset */
950938
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_ASSERT_RESET);
951939

952-
intel_dsi_msleep(intel_dsi, intel_dsi->panel_off_delay);
940+
msleep(intel_dsi->panel_off_delay);
953941
intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_POWER_OFF);
954942

955943
intel_dsi->panel_power_off_time = ktime_get_boottime();

0 commit comments

Comments
 (0)