drm/i915/ddi: Push pipe clock enabling to encoders
authorImre Deak <imre.deak@intel.com>
Wed, 13 Jun 2018 17:27:46 +0000 (20:27 +0300)
committerImre Deak <imre.deak@intel.com>
Thu, 14 Jun 2018 16:50:07 +0000 (19:50 +0300)
On ICL the pipe clock needs to be enabled before setting the HDMI
infoframe, but these steps are in the reverse order atm. Move the pipe
clock enabling to the encoders, so reordering of the two steps can be
done in a clean way.

No functional change.

v2:
- Rebased on drm-tip.

Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180613172746.18525-1-imre.deak@intel.com
drivers/gpu/drm/i915/intel_crt.c
drivers/gpu/drm/i915/intel_ddi.c
drivers/gpu/drm/i915/intel_display.c

index 95aa29cf2d9c3a7e1d0e03645adf879eddd2b768..87c72c39f409cb871c47781eb9fafae5ddb47696 100644 (file)
@@ -232,6 +232,8 @@ static void hsw_post_disable_crt(struct intel_encoder *encoder,
 {
        struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 
+       intel_ddi_disable_pipe_clock(old_crtc_state);
+
        pch_post_disable_crt(encoder, old_crtc_state, old_conn_state);
 
        lpt_disable_pch_transcoder(dev_priv);
@@ -268,6 +270,8 @@ static void hsw_pre_enable_crt(struct intel_encoder *encoder,
        intel_set_cpu_fifo_underrun_reporting(dev_priv, pipe, false);
 
        dev_priv->display.fdi_link_train(crtc, crtc_state);
+
+       intel_ddi_enable_pipe_clock(crtc_state);
 }
 
 static void hsw_enable_crt(struct intel_encoder *encoder,
index ca73387bd5964f8b9faf82dc2f83307355b9b991..df0e64a9721a596d91cb38f0b9d04330d818147b 100644 (file)
@@ -2639,6 +2639,8 @@ static void intel_ddi_pre_enable_dp(struct intel_encoder *encoder,
        intel_dp_start_link_train(intel_dp);
        if (port != PORT_A || INTEL_GEN(dev_priv) >= 9)
                intel_dp_stop_link_train(intel_dp);
+
+       intel_ddi_enable_pipe_clock(crtc_state);
 }
 
 static void intel_ddi_pre_enable_hdmi(struct intel_encoder *encoder,
@@ -2672,6 +2674,8 @@ static void intel_ddi_pre_enable_hdmi(struct intel_encoder *encoder,
        intel_dig_port->set_infoframes(&encoder->base,
                                       crtc_state->has_infoframe,
                                       crtc_state, conn_state);
+
+       intel_ddi_enable_pipe_clock(crtc_state);
 }
 
 static void intel_ddi_pre_enable(struct intel_encoder *encoder,
@@ -2738,6 +2742,8 @@ static void intel_ddi_post_disable_dp(struct intel_encoder *encoder,
        bool is_mst = intel_crtc_has_type(old_crtc_state,
                                          INTEL_OUTPUT_DP_MST);
 
+       intel_ddi_disable_pipe_clock(old_crtc_state);
+
        /*
         * Power down sink before disabling the port, otherwise we end
         * up getting interrupts from the sink on detecting link loss.
@@ -2763,6 +2769,8 @@ static void intel_ddi_post_disable_hdmi(struct intel_encoder *encoder,
        struct intel_digital_port *dig_port = enc_to_dig_port(&encoder->base);
        struct intel_hdmi *intel_hdmi = &dig_port->hdmi;
 
+       intel_ddi_disable_pipe_clock(old_crtc_state);
+
        intel_disable_ddi_buf(encoder);
 
        dig_port->set_infoframes(&encoder->base, false,
index 59dd97a939ceecf5d7ab868535d3a140862b4cfe..05abd23b526fc8f025c050d0072309497d7678e4 100644 (file)
@@ -5647,9 +5647,6 @@ static void haswell_crtc_enable(struct intel_crtc_state *pipe_config,
 
        intel_encoders_pre_enable(crtc, pipe_config, old_state);
 
-       if (!transcoder_is_dsi(cpu_transcoder))
-               intel_ddi_enable_pipe_clock(pipe_config);
-
        if (intel_crtc_has_dp_encoder(intel_crtc->config))
                intel_dp_set_m_n(intel_crtc, M1_N1);
 
@@ -5836,9 +5833,6 @@ static void haswell_crtc_disable(struct intel_crtc_state *old_crtc_state,
        else
                ironlake_pfit_disable(intel_crtc, false);
 
-       if (!transcoder_is_dsi(cpu_transcoder))
-               intel_ddi_disable_pipe_clock(old_crtc_state);
-
        intel_encoders_post_disable(crtc, old_crtc_state, old_state);
 
        if (INTEL_GEN(dev_priv) >= 11)