Commit 64ee2fd2 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Avoid mixing up SST and MST in DDI setup

The MST vs. SST selection should depend purely on the choice of the
connector/encoder. So don't try to determine the correct DDI mode
based on the intel_dp->is_mst, which simply tells us whether the sink
is in MST mode or not. Instead derive the information from the encoder
type. Since the link training code deals in non-fake encoders, we'll
also need to keep a second copy of that information around, which we'll
now designate as 'link_mst'.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1469717448-4297-4-git-send-email-ville.syrjala@linux.intel.comReviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent fe5a66f9
...@@ -1126,7 +1126,6 @@ void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc) ...@@ -1126,7 +1126,6 @@ void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc)
{ {
struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
struct intel_encoder *intel_encoder = intel_ddi_get_crtc_encoder(crtc); struct intel_encoder *intel_encoder = intel_ddi_get_crtc_encoder(crtc);
struct drm_encoder *encoder = &intel_encoder->base;
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
enum pipe pipe = intel_crtc->pipe; enum pipe pipe = intel_crtc->pipe;
...@@ -1192,29 +1191,15 @@ void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc) ...@@ -1192,29 +1191,15 @@ void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc)
temp |= TRANS_DDI_MODE_SELECT_HDMI; temp |= TRANS_DDI_MODE_SELECT_HDMI;
else else
temp |= TRANS_DDI_MODE_SELECT_DVI; temp |= TRANS_DDI_MODE_SELECT_DVI;
} else if (type == INTEL_OUTPUT_ANALOG) { } else if (type == INTEL_OUTPUT_ANALOG) {
temp |= TRANS_DDI_MODE_SELECT_FDI; temp |= TRANS_DDI_MODE_SELECT_FDI;
temp |= (intel_crtc->config->fdi_lanes - 1) << 1; temp |= (intel_crtc->config->fdi_lanes - 1) << 1;
} else if (type == INTEL_OUTPUT_DP || } else if (type == INTEL_OUTPUT_DP ||
type == INTEL_OUTPUT_EDP) { type == INTEL_OUTPUT_EDP) {
struct intel_dp *intel_dp = enc_to_intel_dp(encoder); temp |= TRANS_DDI_MODE_SELECT_DP_SST;
if (intel_dp->is_mst) {
temp |= TRANS_DDI_MODE_SELECT_DP_MST;
} else
temp |= TRANS_DDI_MODE_SELECT_DP_SST;
temp |= DDI_PORT_WIDTH(intel_crtc->config->lane_count); temp |= DDI_PORT_WIDTH(intel_crtc->config->lane_count);
} else if (type == INTEL_OUTPUT_DP_MST) { } else if (type == INTEL_OUTPUT_DP_MST) {
struct intel_dp *intel_dp = &enc_to_mst(encoder)->primary->dp; temp |= TRANS_DDI_MODE_SELECT_DP_MST;
if (intel_dp->is_mst) {
temp |= TRANS_DDI_MODE_SELECT_DP_MST;
} else
temp |= TRANS_DDI_MODE_SELECT_DP_SST;
temp |= DDI_PORT_WIDTH(intel_crtc->config->lane_count); temp |= DDI_PORT_WIDTH(intel_crtc->config->lane_count);
} else { } else {
WARN(1, "Invalid encoder type %d for pipe %c\n", WARN(1, "Invalid encoder type %d for pipe %c\n",
...@@ -2139,7 +2124,7 @@ void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp) ...@@ -2139,7 +2124,7 @@ void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
val = DP_TP_CTL_ENABLE | val = DP_TP_CTL_ENABLE |
DP_TP_CTL_LINK_TRAIN_PAT1 | DP_TP_CTL_SCRAMBLE_DISABLE; DP_TP_CTL_LINK_TRAIN_PAT1 | DP_TP_CTL_SCRAMBLE_DISABLE;
if (intel_dp->is_mst) if (intel_dp->link_mst)
val |= DP_TP_CTL_MODE_MST; val |= DP_TP_CTL_MODE_MST;
else { else {
val |= DP_TP_CTL_MODE_SST; val |= DP_TP_CTL_MODE_SST;
......
...@@ -1651,6 +1651,7 @@ void intel_dp_set_link_params(struct intel_dp *intel_dp, ...@@ -1651,6 +1651,7 @@ void intel_dp_set_link_params(struct intel_dp *intel_dp,
{ {
intel_dp->link_rate = pipe_config->port_clock; intel_dp->link_rate = pipe_config->port_clock;
intel_dp->lane_count = pipe_config->lane_count; intel_dp->lane_count = pipe_config->lane_count;
intel_dp->link_mst = intel_crtc_has_type(pipe_config, INTEL_OUTPUT_DP_MST);
} }
static void intel_dp_prepare(struct intel_encoder *encoder) static void intel_dp_prepare(struct intel_encoder *encoder)
......
...@@ -852,6 +852,7 @@ struct intel_dp { ...@@ -852,6 +852,7 @@ struct intel_dp {
int link_rate; int link_rate;
uint8_t lane_count; uint8_t lane_count;
uint8_t sink_count; uint8_t sink_count;
bool link_mst;
bool has_audio; bool has_audio;
bool detect_done; bool detect_done;
enum hdmi_force_audio force_audio; enum hdmi_force_audio force_audio;
......
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