All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com, ville.syrjala@linux.intel.com,
	manasi.d.navare@intel.com
Subject: [Intel-gfx] [PATCH v2 17/19] drm/i915/dg2: use 128b/132b transcoder DDI mode
Date: Mon, 23 Aug 2021 19:18:18 +0300	[thread overview]
Message-ID: <3deffa9bbf2a17719f0c0cbe4c9f71a133eb95f9.1629735412.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1629735412.git.jani.nikula@intel.com>

128b/132b has a separate transcoder DDI mode, which also requires the
MST transport select to be set. Note that we'll use DP MST also for
single-stream 128b/132b.

Having the FDI and 128b/132b modes share the register mode value
complicates things a bit.

v2:
- Use HAS_DP20 abstraction for 128b/132b mode (Ville)
- Use intel_dp_is_uhbr() helper

Bspec: 50493
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 27 ++++++++++++++++++------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index d885a4c0fb39..bbc2e052075d 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -505,7 +505,10 @@ intel_ddi_transcoder_func_reg_val_get(struct intel_encoder *encoder,
 		temp |= TRANS_DDI_MODE_SELECT_FDI_OR_128B132B;
 		temp |= (crtc_state->fdi_lanes - 1) << 1;
 	} else if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST)) {
-		temp |= TRANS_DDI_MODE_SELECT_DP_MST;
+		if (intel_dp_is_uhbr(crtc_state))
+			temp |= TRANS_DDI_MODE_SELECT_FDI_OR_128B132B;
+		else
+			temp |= TRANS_DDI_MODE_SELECT_DP_MST;
 		temp |= DDI_PORT_WIDTH(crtc_state->lane_count);
 
 		if (DISPLAY_VER(dev_priv) >= 12) {
@@ -693,7 +696,12 @@ bool intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector)
 		break;
 
 	case TRANS_DDI_MODE_SELECT_FDI_OR_128B132B:
-		ret = type == DRM_MODE_CONNECTOR_VGA;
+		if (HAS_DP20(dev_priv))
+			/* 128b/132b */
+			ret = false;
+		else
+			/* FDI */
+			ret = type == DRM_MODE_CONNECTOR_VGA;
 		break;
 
 	default:
@@ -780,8 +788,9 @@ static void intel_ddi_get_encoder_pipes(struct intel_encoder *encoder,
 		if ((tmp & port_mask) != ddi_select)
 			continue;
 
-		if ((tmp & TRANS_DDI_MODE_SELECT_MASK) ==
-		    TRANS_DDI_MODE_SELECT_DP_MST)
+		if ((tmp & TRANS_DDI_MODE_SELECT_MASK) == TRANS_DDI_MODE_SELECT_DP_MST ||
+		    (HAS_DP20(dev_priv) &&
+		     (tmp & TRANS_DDI_MODE_SELECT_MASK) == TRANS_DDI_MODE_SELECT_FDI_OR_128B132B))
 			mst_pipe_mask |= BIT(p);
 
 		*pipe_mask |= BIT(p);
@@ -3572,9 +3581,6 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder,
 		pipe_config->output_types |= BIT(INTEL_OUTPUT_HDMI);
 		pipe_config->lane_count = 4;
 		break;
-	case TRANS_DDI_MODE_SELECT_FDI_OR_128B132B:
-		pipe_config->output_types |= BIT(INTEL_OUTPUT_ANALOG);
-		break;
 	case TRANS_DDI_MODE_SELECT_DP_SST:
 		if (encoder->type == INTEL_OUTPUT_EDP)
 			pipe_config->output_types |= BIT(INTEL_OUTPUT_EDP);
@@ -3603,6 +3609,13 @@ static void intel_ddi_read_func_ctl(struct intel_encoder *encoder,
 			pipe_config->infoframes.enable |=
 				intel_hdmi_infoframes_enabled(encoder, pipe_config);
 		break;
+	case TRANS_DDI_MODE_SELECT_FDI_OR_128B132B:
+		if (!HAS_DP20(dev_priv)) {
+			/* FDI */
+			pipe_config->output_types |= BIT(INTEL_OUTPUT_ANALOG);
+			break;
+		}
+		fallthrough; /* 128b/132b */
 	case TRANS_DDI_MODE_SELECT_DP_MST:
 		pipe_config->output_types |= BIT(INTEL_OUTPUT_DP_MST);
 		pipe_config->lane_count =
-- 
2.20.1


  parent reply	other threads:[~2021-08-23 16:20 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-23 16:18 [Intel-gfx] [PATCH v2 00/19] drm/i915/dp: dp 2.0 enabling prep work Jani Nikula
2021-08-23 16:18 ` [PATCH v2 01/19] drm/dp: add DP 2.0 UHBR link rate and bw code conversions Jani Nikula
2021-08-23 16:18   ` [Intel-gfx] " Jani Nikula
2021-08-23 16:18 ` [PATCH v2 02/19] drm/dp: use more of the extended receiver cap Jani Nikula
2021-08-23 16:18   ` [Intel-gfx] " Jani Nikula
2021-08-23 16:18 ` [PATCH v2 03/19] drm/dp: add LTTPR DP 2.0 DPCD addresses Jani Nikula
2021-08-23 16:18   ` [Intel-gfx] " Jani Nikula
2021-08-23 16:18 ` [PATCH v2 04/19] drm/dp: add helper for extracting adjust 128b/132b TX FFE preset Jani Nikula
2021-08-23 16:18   ` [Intel-gfx] " Jani Nikula
2021-08-23 16:18 ` [Intel-gfx] [PATCH v2 05/19] drm/i915/dp: use actual link rate values in struct link_config_limits Jani Nikula
2021-08-23 16:18 ` [Intel-gfx] [PATCH v2 06/19] drm/i915/dp: read sink UHBR rates Jani Nikula
2021-08-23 16:18 ` [Intel-gfx] [PATCH v2 07/19] drm/i915/dg2: add TRANS_DP2_CTL register definition Jani Nikula
2021-08-23 16:18 ` [Intel-gfx] [PATCH v2 08/19] drm/i915/dg2: add DG2+ TRANS_DDI_FUNC_CTL DP 2.0 128b/132b mode Jani Nikula
2021-08-23 16:18 ` [Intel-gfx] [PATCH v2 09/19] drm/i915/dg2: add TRANS_DP2_VFREQHIGH and TRANS_DP2_VFREQLOW Jani Nikula
2021-08-23 16:18 ` [Intel-gfx] [PATCH v2 10/19] drm/i915/dg2: add DG2 UHBR source rates Jani Nikula
2021-08-23 16:18 ` [Intel-gfx] [PATCH v2 11/19] drm/i915/dp: add max data rate calculation for UHBR rates Jani Nikula
2021-08-23 16:18 ` [Intel-gfx] [PATCH v2 12/19] drm/i915/dp: add helper for checking for UHBR link rate Jani Nikula
2021-08-23 16:18 ` [Intel-gfx] [PATCH v2 13/19] drm/i915/dp: use 128b/132b TPS2 for UHBR+ link rates Jani Nikula
2021-08-23 16:18 ` [Intel-gfx] [PATCH v2 14/19] drm/i915/dp: select 128b/132b channel encoding for UHBR rates Jani Nikula
2021-08-23 16:18 ` [Intel-gfx] [PATCH v2 15/19] drm/i915/dg2: configure TRANS_DP2_CTL for DP 2.0 Jani Nikula
2021-08-23 16:18 ` [Intel-gfx] [PATCH v2 16/19] drm/i915/dp: add HAS_DP20 macro Jani Nikula
2021-08-23 16:18 ` Jani Nikula [this message]
2021-08-23 16:18 ` [Intel-gfx] [PATCH v2 18/19] drm/i915/dg2: configure TRANS_DP2_VFREQ{HIGH, LOW} for 128b/132b Jani Nikula
2021-08-23 16:18 ` [Intel-gfx] [PATCH v2 19/19] drm/i915/dg2: update link training " Jani Nikula
2021-08-23 16:58 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dp: dp 2.0 enabling prep work (rev2) Patchwork
2021-08-23 17:00 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-08-23 17:29 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-08-23 19:32 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

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=3deffa9bbf2a17719f0c0cbe4c9f71a133eb95f9.1629735412.git.jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=manasi.d.navare@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    /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.