Commit 33f083f0 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Split intel_disable_ddi() into DP vs. HDMI variants

Untangle intel_disable_ddi() by splitting it into DP and HDMI specific
variants.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171010121207.570-8-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 680b71c2
...@@ -2424,29 +2424,40 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder, ...@@ -2424,29 +2424,40 @@ static void intel_enable_ddi(struct intel_encoder *intel_encoder,
intel_audio_codec_enable(intel_encoder, pipe_config, conn_state); intel_audio_codec_enable(intel_encoder, pipe_config, conn_state);
} }
static void intel_disable_ddi(struct intel_encoder *intel_encoder, static void intel_disable_ddi_dp(struct intel_encoder *encoder,
const struct intel_crtc_state *old_crtc_state, const struct intel_crtc_state *old_crtc_state,
const struct drm_connector_state *old_conn_state) const struct drm_connector_state *old_conn_state)
{ {
struct drm_encoder *encoder = &intel_encoder->base; struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
int type = intel_encoder->type;
if (old_crtc_state->has_audio) if (old_crtc_state->has_audio)
intel_audio_codec_disable(intel_encoder); intel_audio_codec_disable(encoder);
if (type == INTEL_OUTPUT_HDMI) { intel_edp_drrs_disable(intel_dp, old_crtc_state);
intel_hdmi_handle_sink_scrambling(intel_encoder, intel_psr_disable(intel_dp, old_crtc_state);
old_conn_state->connector, intel_edp_backlight_off(old_conn_state);
false, false); }
}
if (type == INTEL_OUTPUT_EDP) { static void intel_disable_ddi_hdmi(struct intel_encoder *encoder,
struct intel_dp *intel_dp = enc_to_intel_dp(encoder); const struct intel_crtc_state *old_crtc_state,
const struct drm_connector_state *old_conn_state)
{
if (old_crtc_state->has_audio)
intel_audio_codec_disable(encoder);
intel_edp_drrs_disable(intel_dp, old_crtc_state); intel_hdmi_handle_sink_scrambling(encoder,
intel_psr_disable(intel_dp, old_crtc_state); old_conn_state->connector,
intel_edp_backlight_off(old_conn_state); false, false);
} }
static void intel_disable_ddi(struct intel_encoder *encoder,
const struct intel_crtc_state *old_crtc_state,
const struct drm_connector_state *old_conn_state)
{
if (intel_crtc_has_type(old_crtc_state, INTEL_OUTPUT_HDMI))
intel_disable_ddi_hdmi(encoder, old_crtc_state, old_conn_state);
else
intel_disable_ddi_dp(encoder, old_crtc_state, old_conn_state);
} }
static void bxt_ddi_pre_pll_enable(struct intel_encoder *encoder, static void bxt_ddi_pre_pll_enable(struct intel_encoder *encoder,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment