All of lore.kernel.org
 help / color / mirror / Atom feed
From: ville.syrjala@linux.intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 14/15] drm/i915: Avoid mixing up SST and MST in DDI setup
Date: Wed, 22 Jun 2016 21:57:12 +0300	[thread overview]
Message-ID: <1466621833-5054-15-git-send-email-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <1466621833-5054-1-git-send-email-ville.syrjala@linux.intel.com>

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

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: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_ddi.c | 19 +++----------------
 drivers/gpu/drm/i915/intel_dp.c  |  1 +
 drivers/gpu/drm/i915/intel_drv.h |  1 +
 3 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index fe951e2564a2..253dc23a86e8 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1103,7 +1103,6 @@ void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc)
 {
 	struct intel_crtc *intel_crtc = to_intel_crtc(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_i915_private *dev_priv = dev->dev_private;
 	enum pipe pipe = intel_crtc->pipe;
@@ -1173,22 +1172,10 @@ void intel_ddi_enable_transcoder_func(struct drm_crtc *crtc)
 		temp |= (intel_crtc->config->fdi_lanes - 1) << 1;
 	} else if (intel_crtc_has_type(intel_crtc->config, INTEL_OUTPUT_DP) ||
 		   intel_crtc_has_type(intel_crtc->config, INTEL_OUTPUT_EDP)) {
-		struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
-
-		if (intel_dp->is_mst) {
-			temp |= TRANS_DDI_MODE_SELECT_DP_MST;
-		} else
-			temp |= TRANS_DDI_MODE_SELECT_DP_SST;
-
+		temp |= TRANS_DDI_MODE_SELECT_DP_SST;
 		temp |= DDI_PORT_WIDTH(intel_crtc->config->lane_count);
 	} else if (intel_crtc_has_type(intel_crtc->config, INTEL_OUTPUT_DP_MST)) {
-		struct intel_dp *intel_dp = &enc_to_mst(encoder)->primary->dp;
-
-		if (intel_dp->is_mst) {
-			temp |= TRANS_DDI_MODE_SELECT_DP_MST;
-		} else
-			temp |= TRANS_DDI_MODE_SELECT_DP_SST;
-
+		temp |= TRANS_DDI_MODE_SELECT_DP_MST;
 		temp |= DDI_PORT_WIDTH(intel_crtc->config->lane_count);
 	} else {
 		WARN(1, "Invalid encoder type 0x%x for pipe %c\n",
@@ -2098,7 +2085,7 @@ void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
 
 	val = DP_TP_CTL_ENABLE |
 	      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;
 	else {
 		val |= DP_TP_CTL_MODE_SST;
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index bf55efff647f..167279ec0cff 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1668,6 +1668,7 @@ void intel_dp_set_link_params(struct intel_dp *intel_dp,
 {
 	intel_dp->link_rate = pipe_config->port_clock;
 	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)
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 3f38b2c809ec..3318b9af0d43 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -829,6 +829,7 @@ struct intel_dp {
 	int link_rate;
 	uint8_t lane_count;
 	uint8_t sink_count;
+	bool link_mst;
 	bool has_audio;
 	bool detect_done;
 	enum hdmi_force_audio force_audio;
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-06-22 18:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 18:56 [PATCH v2 00/15] drm/i915: Eliminate DDI encoder->type frobbery (v2) ville.syrjala
2016-06-22 18:56 ` [PATCH 01/15] drm/i915: Don't mark eDP encoders as MST capable ville.syrjala
2016-06-22 18:57 ` [PATCH 02/15] drm/i915: Remove encoder type checks from MST suspend/resume ville.syrjala
2016-06-22 18:57 ` [PATCH v2 03/15] drm/i915: Add output_types bitmask into the crtc state ville.syrjala
2016-06-22 18:57 ` [PATCH v3 04/15] drm/i915: Unify intel_pipe_has_type() and intel_pipe_will_have_type() ville.syrjala
2016-06-22 18:57 ` [PATCH 05/15] drm/i915: Replace manual lvds and sdvo/hdmi counting with intel_crtc_has_type() ville.syrjala
2016-06-22 18:57 ` [PATCH v2 06/15] drm/i915: Kill has_dp_encoder from pipe_config ville.syrjala
2016-06-22 18:57 ` [PATCH v2 07/15] drm/i915: Replace some open coded intel_crtc_has_dp_encoder()s ville.syrjala
2016-06-22 18:57 ` [PATCH v2 08/15] drm/i915: s/INTEL_OUTPUT_DISPLAYPORT/INTEL_OUTPUT_DP/ ville.syrjala
2016-06-22 18:57 ` [PATCH v2 09/15] drm/i915: Kill has_dsi_encoder ville.syrjala
2016-06-22 18:57 ` [PATCH v3 10/15] drm/i915: Simplify hdmi_12bpc_possible() ville.syrjala
2016-06-22 18:57 ` [PATCH 11/15] drm/i915: Check for invalid cloning earlier during modeset ville.syrjala
2016-06-22 18:57 ` [PATCH v2 12/15] drm/i915: Stop frobbing with DDI encoder->type ville.syrjala
2016-08-23 10:16   ` Maarten Lankhorst
2016-06-22 18:57 ` [PATCH 13/15] drm/i915: Kill dp_encoder_is_mst ville.syrjala
2016-06-22 18:57 ` ville.syrjala [this message]
2016-06-22 18:57 ` [PATCH 15/15] drm/i915: Reject mixing MST and SST/HDMI on the same digital port ville.syrjala
2016-06-23  5:42 ` ✗ Ro.CI.BAT: warning for drm/i915: Eliminate DDI encoder->type frobbery (rev2) Patchwork
2016-06-23 13:04   ` Ville Syrjälä
2016-07-07 10:22 ` [PATCH v2 00/15] drm/i915: Eliminate DDI encoder->type frobbery (v2) Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466621833-5054-15-git-send-email-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.