From d94512298dc78d2fb2874f138c8edc2d19edd686 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Tue, 13 Jun 2023 02:59:37 +0000 Subject: drm/i915/dsi: Use unconditional msleep() instead of intel_dsi_msleep() From Hans de Goede aa0f98c5d1962b4dedec00067fc1b28a6d4f7d65 in linux-6.1.y/6.1.29 c8c2969bfcba5fcba3a5b078315c1b586d927d9f in mainline linux --- sys/dev/pci/drm/i915/display/icl_dsi.c | 2 +- sys/dev/pci/drm/i915/display/intel_dsi_vbt.c | 11 ----------- sys/dev/pci/drm/i915/display/intel_dsi_vbt.h | 1 - sys/dev/pci/drm/i915/display/vlv_dsi.c | 22 +++++----------------- 4 files changed, 6 insertions(+), 30 deletions(-) diff --git a/sys/dev/pci/drm/i915/display/icl_dsi.c b/sys/dev/pci/drm/i915/display/icl_dsi.c index dd64b93c78e..5767d339832 100644 --- a/sys/dev/pci/drm/i915/display/icl_dsi.c +++ b/sys/dev/pci/drm/i915/display/icl_dsi.c @@ -1210,7 +1210,7 @@ static void gen11_dsi_powerup_panel(struct intel_encoder *encoder) /* panel power on related mipi dsi vbt sequences */ intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_POWER_ON); - intel_dsi_msleep(intel_dsi, intel_dsi->panel_on_delay); + drm_msleep(intel_dsi->panel_on_delay); intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DEASSERT_RESET); intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_INIT_OTP); intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DISPLAY_ON); diff --git a/sys/dev/pci/drm/i915/display/intel_dsi_vbt.c b/sys/dev/pci/drm/i915/display/intel_dsi_vbt.c index 6d2ba11ce1b..31a96eff8b4 100644 --- a/sys/dev/pci/drm/i915/display/intel_dsi_vbt.c +++ b/sys/dev/pci/drm/i915/display/intel_dsi_vbt.c @@ -776,17 +776,6 @@ void intel_dsi_vbt_exec_sequence(struct intel_dsi *intel_dsi, #endif } -void intel_dsi_msleep(struct intel_dsi *intel_dsi, int msec) -{ - struct intel_connector *connector = intel_dsi->attached_connector; - - /* For v3 VBTs in vid-mode the delays are part of the VBT sequences */ - if (is_vid_mode(intel_dsi) && connector->panel.vbt.dsi.seq_version >= 3) - return; - - drm_msleep(msec); -} - void intel_dsi_log_params(struct intel_dsi *intel_dsi) { struct drm_i915_private *i915 = to_i915(intel_dsi->base.base.dev); diff --git a/sys/dev/pci/drm/i915/display/intel_dsi_vbt.h b/sys/dev/pci/drm/i915/display/intel_dsi_vbt.h index dc642c1fe7e..468d873fab1 100644 --- a/sys/dev/pci/drm/i915/display/intel_dsi_vbt.h +++ b/sys/dev/pci/drm/i915/display/intel_dsi_vbt.h @@ -16,7 +16,6 @@ void intel_dsi_vbt_gpio_init(struct intel_dsi *intel_dsi, bool panel_is_on); void intel_dsi_vbt_gpio_cleanup(struct intel_dsi *intel_dsi); void intel_dsi_vbt_exec_sequence(struct intel_dsi *intel_dsi, enum mipi_seq seq_id); -void intel_dsi_msleep(struct intel_dsi *intel_dsi, int msec); void intel_dsi_log_params(struct intel_dsi *intel_dsi); #endif /* __INTEL_DSI_VBT_H__ */ diff --git a/sys/dev/pci/drm/i915/display/vlv_dsi.c b/sys/dev/pci/drm/i915/display/vlv_dsi.c index da70c537e9e..963ab2e8fdc 100644 --- a/sys/dev/pci/drm/i915/display/vlv_dsi.c +++ b/sys/dev/pci/drm/i915/display/vlv_dsi.c @@ -782,7 +782,6 @@ static void intel_dsi_pre_enable(struct intel_atomic_state *state, { struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc); - struct intel_connector *connector = to_intel_connector(conn_state->connector); struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); enum pipe pipe = crtc->pipe; enum port port; @@ -830,21 +829,10 @@ static void intel_dsi_pre_enable(struct intel_atomic_state *state, if (!IS_GEMINILAKE(dev_priv)) intel_dsi_prepare(encoder, pipe_config); + /* Give the panel time to power-on and then deassert its reset */ intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_POWER_ON); - - /* - * Give the panel time to power-on and then deassert its reset. - * Depending on the VBT MIPI sequences version the deassert-seq - * may contain the necessary delay, intel_dsi_msleep() will skip - * the delay in that case. If there is no deassert-seq, then an - * unconditional msleep is used to give the panel time to power-on. - */ - if (connector->panel.vbt.dsi.sequence[MIPI_SEQ_DEASSERT_RESET]) { - intel_dsi_msleep(intel_dsi, intel_dsi->panel_on_delay); - intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DEASSERT_RESET); - } else { - drm_msleep(intel_dsi->panel_on_delay); - } + drm_msleep(intel_dsi->panel_on_delay); + intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DEASSERT_RESET); if (IS_GEMINILAKE(dev_priv)) { glk_cold_boot = glk_dsi_enable_io(encoder); @@ -878,7 +866,7 @@ static void intel_dsi_pre_enable(struct intel_atomic_state *state, drm_msleep(20); /* XXX */ for_each_dsi_port(port, intel_dsi->ports) dpi_send_cmd(intel_dsi, TURN_ON, false, port); - intel_dsi_msleep(intel_dsi, 100); + drm_msleep(100); intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_DISPLAY_ON); @@ -1006,7 +994,7 @@ static void intel_dsi_post_disable(struct intel_atomic_state *state, /* Assert reset */ intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_ASSERT_RESET); - intel_dsi_msleep(intel_dsi, intel_dsi->panel_off_delay); + drm_msleep(intel_dsi->panel_off_delay); intel_dsi_vbt_exec_sequence(intel_dsi, MIPI_SEQ_POWER_OFF); intel_dsi->panel_power_off_time = ktime_get_boottime(); -- cgit v1.2.3