From: Ville Syrjälä <ville.syrj...@linux.intel.com>

Plug in the encoder->shutdown() hook for icl+ DSI so that
we are guaranteed to respect the power cycle delay during
reboots and whatnot.

Signed-off-by: Ville Syrjälä <ville.syrj...@linux.intel.com>
---
 drivers/gpu/drm/i915/display/icl_dsi.c   | 1 +
 drivers/gpu/drm/i915/display/intel_dsi.c | 7 +++++++
 drivers/gpu/drm/i915/display/intel_dsi.h | 1 +
 drivers/gpu/drm/i915/display/vlv_dsi.c   | 7 -------
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c 
b/drivers/gpu/drm/i915/display/icl_dsi.c
index 88130cd19d3f..600199d51d69 100644
--- a/drivers/gpu/drm/i915/display/icl_dsi.c
+++ b/drivers/gpu/drm/i915/display/icl_dsi.c
@@ -1978,6 +1978,7 @@ void icl_dsi_init(struct drm_i915_private *dev_priv)
        encoder->get_power_domains = gen11_dsi_get_power_domains;
        encoder->disable_clock = gen11_dsi_gate_clocks;
        encoder->is_clock_enabled = gen11_dsi_is_clock_enabled;
+       encoder->shutdown = intel_dsi_shutdown;
 
        /* register DSI connector with DRM subsystem */
        drm_connector_init(&dev_priv->drm, connector, 
&gen11_dsi_connector_funcs,
diff --git a/drivers/gpu/drm/i915/display/intel_dsi.c 
b/drivers/gpu/drm/i915/display/intel_dsi.c
index e8a596a7c28a..d3cf6a652221 100644
--- a/drivers/gpu/drm/i915/display/intel_dsi.c
+++ b/drivers/gpu/drm/i915/display/intel_dsi.c
@@ -22,6 +22,13 @@ void intel_dsi_wait_panel_power_cycle(struct intel_dsi 
*intel_dsi)
                msleep(intel_dsi->panel_pwr_cycle_delay - 
panel_power_off_duration);
 }
 
+void intel_dsi_shutdown(struct intel_encoder *encoder)
+{
+       struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
+
+       intel_dsi_wait_panel_power_cycle(intel_dsi);
+}
+
 int intel_dsi_bitrate(const struct intel_dsi *intel_dsi)
 {
        int bpp = mipi_dsi_pixel_format_to_bpp(intel_dsi->pixel_format);
diff --git a/drivers/gpu/drm/i915/display/intel_dsi.h 
b/drivers/gpu/drm/i915/display/intel_dsi.h
index b690e0fcd906..083390e5e442 100644
--- a/drivers/gpu/drm/i915/display/intel_dsi.h
+++ b/drivers/gpu/drm/i915/display/intel_dsi.h
@@ -174,5 +174,6 @@ struct intel_dsi_host *intel_dsi_host_init(struct intel_dsi 
*intel_dsi,
                                           const struct mipi_dsi_host_ops 
*funcs,
                                           enum port port);
 void intel_dsi_wait_panel_power_cycle(struct intel_dsi *intel_dsi);
+void intel_dsi_shutdown(struct intel_encoder *encoder);
 
 #endif /* _INTEL_DSI_H */
diff --git a/drivers/gpu/drm/i915/display/vlv_dsi.c 
b/drivers/gpu/drm/i915/display/vlv_dsi.c
index e7993480199e..6ddf4d9c5e00 100644
--- a/drivers/gpu/drm/i915/display/vlv_dsi.c
+++ b/drivers/gpu/drm/i915/display/vlv_dsi.c
@@ -941,13 +941,6 @@ static void intel_dsi_post_disable(struct 
intel_atomic_state *state,
        intel_dsi->panel_power_off_time = ktime_get_boottime();
 }
 
-static void intel_dsi_shutdown(struct intel_encoder *encoder)
-{
-       struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
-
-       intel_dsi_wait_panel_power_cycle(intel_dsi);
-}
-
 static bool intel_dsi_get_hw_state(struct intel_encoder *encoder,
                                   enum pipe *pipe)
 {
-- 
2.39.2

Reply via email to