drm/i915/dsi: Use unconditional msleep() instead of intel_dsi_msleep()
authorjsg <jsg@openbsd.org>
Tue, 13 Jun 2023 02:59:36 +0000 (02:59 +0000)
committerjsg <jsg@openbsd.org>
Tue, 13 Jun 2023 02:59:36 +0000 (02:59 +0000)
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
sys/dev/pci/drm/i915/display/intel_dsi_vbt.c
sys/dev/pci/drm/i915/display/intel_dsi_vbt.h
sys/dev/pci/drm/i915/display/vlv_dsi.c

index dd64b93..5767d33 100644 (file)
@@ -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);
index 6d2ba11..31a96ef 100644 (file)
@@ -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);
index dc642c1..468d873 100644 (file)
@@ -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__ */
index da70c53..963ab2e 100644 (file)
@@ -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();