public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 25/39] drm/i915/tgl: Implement TGL DisplayPort training sequence
Date: Mon, 19 Aug 2019 16:21:45 +0200	[thread overview]
Message-ID: <d1904f0f-8db0-ef14-a642-060c30485419@linux.intel.com> (raw)
In-Reply-To: <20190816080503.28594-26-lucas.demarchi@intel.com>

Op 16-08-2019 om 10:04 schreef Lucas De Marchi:
> From: José Roberto de Souza <jose.souza@intel.com>
>
> On TGL some registers moved from DDI to transcoder and the
> DisplayPort training sequence has a separate BSpec page.
>
> I started adding 'ifs' to the original intel_ddi_pre_enable_dp() but
> it was becoming really hard to follow, so a new and cleaner function
> for TGL was added with comments of all steps. It's similar to ICL, but
> different enough to deserve a new function
>
> The rest of DisplayPort enable and the whole disable sequences
> remained the same.
>
> BSpec: 49190
> Cc: Manasi Navare <manasi.d.navare@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_ddi.c | 134 ++++++++++++++++++++++-
>  drivers/gpu/drm/i915/display/intel_dp.c  |   8 +-
>  2 files changed, 134 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 17d49c77faa0..5d971e9d0459 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -1761,7 +1761,14 @@ void intel_ddi_set_vc_payload_alloc(const struct intel_crtc_state *crtc_state,
>  	I915_WRITE(TRANS_DDI_FUNC_CTL(cpu_transcoder), temp);
>  }
>  
> -void intel_ddi_enable_transcoder_func(const struct intel_crtc_state *crtc_state)
> +/*
> + * Returns the TRANS_DDI_FUNC_CTL value based on CRTC state.
> + *
> + * Only intended to be used by intel_ddi_enable_transcoder_func() and
> + * intel_ddi_config_transcoder_func().
> + */
> +static u32
> +intel_ddi_transcoder_func_reg_val_get(const struct intel_crtc_state *crtc_state)
>  {
>  	struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc);
>  	struct intel_encoder *encoder = intel_ddi_get_crtc_encoder(crtc);
> @@ -1851,6 +1858,33 @@ void intel_ddi_enable_transcoder_func(const struct intel_crtc_state *crtc_state)
>  		temp |= DDI_PORT_WIDTH(crtc_state->lane_count);
>  	}
>  
> +	return temp;
> +}
> +
> +void intel_ddi_enable_transcoder_func(const struct intel_crtc_state *crtc_state)
> +{
> +	struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc);
> +	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> +	enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
> +	u32 temp;
> +
> +	temp = intel_ddi_transcoder_func_reg_val_get(crtc_state);
> +	I915_WRITE(TRANS_DDI_FUNC_CTL(cpu_transcoder), temp);
> +}
> +
> +/*
> + * Same as intel_ddi_enable_transcoder_func() but it do not set the enable bit
> + */
> +static void
> +intel_ddi_config_transcoder_func(const struct intel_crtc_state *crtc_state)
> +{
> +	struct intel_crtc *crtc = to_intel_crtc(crtc_state->base.crtc);
> +	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> +	enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
> +	u32 temp;
> +
> +	temp = intel_ddi_transcoder_func_reg_val_get(crtc_state);
> +	temp &= ~TRANS_DDI_FUNC_ENABLE;
>  	I915_WRITE(TRANS_DDI_FUNC_CTL(cpu_transcoder), temp);
>  }
>  
> @@ -3176,9 +3210,89 @@ static void intel_ddi_disable_fec_state(struct intel_encoder *encoder,
>  	POSTING_READ(ctl);
>  }
>  
> -static void intel_ddi_pre_enable_dp(struct intel_encoder *encoder,
> -				    const struct intel_crtc_state *crtc_state,
> -				    const struct drm_connector_state *conn_state)
> +static void tgl_ddi_pre_enable_dp(struct intel_encoder *encoder,
> +				  const struct intel_crtc_state *crtc_state,
> +				  const struct drm_connector_state *conn_state)
> +{
> +	struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
> +	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> +	enum phy phy = intel_port_to_phy(dev_priv, encoder->port);
> +	struct intel_digital_port *dig_port = enc_to_dig_port(&encoder->base);
> +	bool is_mst = intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST);
> +	int level = intel_ddi_dp_level(intel_dp);
> +
> +	intel_dp_set_link_params(intel_dp, crtc_state->port_clock,
> +				 crtc_state->lane_count, is_mst);
> +
> +	/* 1.a got on intel_atomic_commit_tail() */
> +
> +	/* 2. */
> +	intel_edp_panel_on(intel_dp);
> +
> +	/*
> +	 * 1.b, 3. and 4. is done by before this functions by
> +	 * haswell_crtc_enable()->intel_encoders_pre_pll_enable() and
> +	 * haswell_crtc_enable()->intel_enable_shared_dpll()
> +	 */
> +
> +	/* 5. */
> +	if (!intel_phy_is_tc(dev_priv, phy) ||
> +	    dig_port->tc_mode != TC_PORT_TBT_ALT)
> +		intel_display_power_get(dev_priv,
> +					dig_port->ddi_io_power_domain);
> +
> +	/* 6. */
> +	icl_program_mg_dp_mode(dig_port);
> +
> +	/*
> +	 * 7.a - Steps in this function that should only be executed over MST
> +	 * master as MST encoders will only be executed on MST master as MST
> +	 * encoder have have it's own pre_enable() hook
> +	 */
> +	intel_ddi_enable_pipe_clock(crtc_state);
> +
> +	/* 7.b */
> +	intel_ddi_config_transcoder_func(crtc_state);
> +
> +	/* 7.d */
> +	icl_disable_phy_clock_gating(dig_port);
> +
> +	/* 7.e */
> +	icl_ddi_vswing_sequence(encoder, crtc_state->port_clock, level,
> +				encoder->type);
> +
> +	/* 7.f */
> +	if (intel_phy_is_combo(dev_priv, phy)) {
> +		bool lane_reversal =
> +			dig_port->saved_port_bits & DDI_BUF_PORT_REVERSAL;
> +
> +		intel_combo_phy_power_up_lanes(dev_priv, phy, false,
> +					       crtc_state->lane_count,
> +					       lane_reversal);
> +	}
> +
> +	/* 7.g */
> +	intel_ddi_init_dp_buf_reg(encoder);
> +
> +	if (!is_mst)
> +		intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
> +
> +	/* 7.c, 7.h, 7.i, 7.j */
> +	intel_dp_start_link_train(intel_dp);
> +
> +	/* 7.k */
> +	intel_dp_stop_link_train(intel_dp);
> +
> +	/* 7.l */
> +	intel_dp_sink_set_decompression_state(intel_dp, crtc_state,
> +					      true);
> +	intel_dp_sink_set_fec_ready(intel_dp, crtc_state);
See "DDI FEC" in bspec.

intel_dp_sink_set_fec_ready() needs to be called before link training,
intel_ddi_enable_fec() after.

Presumably this is the same for DSC.

> +	intel_dsc_enable(encoder, crtc_state);
> +}
> +
> +static void hsw_ddi_pre_enable_dp(struct intel_encoder *encoder,
> +				  const struct intel_crtc_state *crtc_state,
> +				  const struct drm_connector_state *conn_state)
>  {
>  	struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base);
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> @@ -3244,6 +3358,18 @@ static void intel_ddi_pre_enable_dp(struct intel_encoder *encoder,
>  	intel_dsc_enable(encoder, crtc_state);
>  }
>  
> +static void intel_ddi_pre_enable_dp(struct intel_encoder *encoder,
> +				    const struct intel_crtc_state *crtc_state,
> +				    const struct drm_connector_state *conn_state)
> +{
> +	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> +
> +	if (INTEL_GEN(dev_priv) >= 12)
> +		tgl_ddi_pre_enable_dp(encoder, crtc_state, conn_state);
> +	else
> +		hsw_ddi_pre_enable_dp(encoder, crtc_state, conn_state);
> +}
> +
>  static void intel_ddi_pre_enable_hdmi(struct intel_encoder *encoder,
>  				      const struct intel_crtc_state *crtc_state,
>  				      const struct drm_connector_state *conn_state)
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index ebfcf183c7f1..1a8e041a5c43 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -4007,13 +4007,13 @@ void intel_dp_set_idle_link_train(struct intel_dp *intel_dp)
>  	I915_WRITE(ctl, val);
>  
>  	/*
> -	 * On PORT_A we can have only eDP in SST mode. There the only reason
> -	 * we need to set idle transmission mode is to work around a HW issue
> -	 * where we enable the pipe while not in idle link-training mode.
> +	 * Until TGL on PORT_A we can have only eDP in SST mode. There the only
> +	 * reason we need to set idle transmission mode is to work around a HW
> +	 * issue where we enable the pipe while not in idle link-training mode.
>  	 * In this case there is requirement to wait for a minimum number of
>  	 * idle patterns to be sent.
>  	 */
> -	if (port == PORT_A)
> +	if (port == PORT_A && INTEL_GEN(dev_priv) < 12)
>  		return;
>  
>  	if (intel_wait_for_register(&dev_priv->uncore, status,


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

  reply	other threads:[~2019-08-19 14:21 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-16  8:04 [PATCH 00/39] Tiger Lake batch 3 Lucas De Marchi
2019-08-16  8:04 ` [PATCH 01/39] drm/i915/tgl: do not use DDIC Lucas De Marchi
2019-08-16  8:04 ` [PATCH 02/39] drm/i915/psr: Make PSR registers relative to transcoders Lucas De Marchi
2019-08-16  8:04 ` [PATCH 03/39] drm/i915: Add transcoder restriction to PSR2 Lucas De Marchi
2019-08-16  8:04 ` [PATCH 04/39] drm/i915: Do not unmask PSR interruption in IRQ postinstall Lucas De Marchi
2019-08-16  8:04 ` [PATCH 05/39] drm/i915/psr: Only handle interruptions of the transcoder in use Lucas De Marchi
2019-08-16  8:04 ` [PATCH 06/39] drm/i915/bdw+: Enable PSR in any eDP port Lucas De Marchi
2019-08-22 16:20   ` Gupta, Anshuman
2019-08-22 16:42     ` Gupta, Anshuman
2019-08-16  8:04 ` [PATCH 07/39] drm/i915: Guard and warn if more than one eDP panel is present Lucas De Marchi
2019-08-16  8:04 ` [PATCH 08/39] drm/i915/tgl: Change PSR2 transcoder restriction Lucas De Marchi
2019-08-16 21:28   ` Lucas De Marchi
2019-08-16 21:59     ` Souza, Jose
2019-08-16  8:04 ` [PATCH 09/39] drm/i915: Do not read PSR2 register in transcoders without PSR2 Lucas De Marchi
2019-08-16  8:04 ` [PATCH 10/39] drm/i915/tgl: PSR link standby is not supported anymore Lucas De Marchi
2019-08-22  9:54   ` Gupta, Anshuman
2019-08-16  8:04 ` [PATCH 11/39] drm/i915/tgl: Access the right register when handling PSR interruptions Lucas De Marchi
2019-08-16  8:04 ` [PATCH 12/39] drm/i915/tgl: Add maximum resolution supported by PSR2 HW Lucas De Marchi
2019-08-22 16:46   ` Gupta, Anshuman
2019-08-16  8:04 ` [PATCH 13/39] drm/i915/mst: Do not hardcoded the crtcs that encoder can connect Lucas De Marchi
2019-08-16  8:04 ` [PATCH 14/39] drm/i915: Add for_each_new_intel_connector_in_state() Lucas De Marchi
2019-08-22 12:55   ` Maarten Lankhorst
2019-08-16  8:04 ` [PATCH 15/39] drm: Add for_each_oldnew_intel_crtc_in_state_reverse() Lucas De Marchi
2019-08-16  8:04 ` [PATCH 16/39] drm/i915: Disable pipes in reverse order Lucas De Marchi
2019-08-16  8:04 ` [PATCH 17/39] drm/i915/tgl: Select master transcoder in DP MST Lucas De Marchi
2019-08-16  8:04 ` [PATCH 18/39] drm/i915/tgl: Introduce initial Tiger Lake workarounds Lucas De Marchi
2019-08-16  8:04 ` [PATCH 19/39] drm/i915/tgl: Implement Wa_1406941453 Lucas De Marchi
2019-08-16  8:04 ` [PATCH 20/39] drm/i915/tgl: Enable VD HCP/MFX sub-pipe power gating Lucas De Marchi
2019-08-16  8:04 ` [PATCH 21/39] drm/i915/tgl: Do not apply WaIncreaseDefaultTLBEntries from GEN12 onwards Lucas De Marchi
2019-08-16  8:04 ` [PATCH 22/39] drm/i915/tgl: implement WaProgramMgsrForCorrectSliceSpecificMmioReads Lucas De Marchi
2019-08-16  8:04 ` [PATCH 23/39] drm/i915/tgl: Register state context definition for Gen12 Lucas De Marchi
2019-08-16  8:04 ` [PATCH 24/39] drm/i915/tgl: move DP_TP_* to transcoder Lucas De Marchi
2019-08-16  8:04 ` [PATCH 25/39] drm/i915/tgl: Implement TGL DisplayPort training sequence Lucas De Marchi
2019-08-19 14:21   ` Maarten Lankhorst [this message]
2019-08-19 21:26     ` Souza, Jose
2019-08-16  8:04 ` [PATCH 26/39] HACK: drm/i915/tgl: Gen12 render context size Lucas De Marchi
2019-08-16  8:04 ` [PATCH 27/39] drm/i915/tgl: add Gen12 default indirect ctx offset Lucas De Marchi
2019-08-16  8:04 ` [PATCH 28/39] drm/i915/tgl: add GEN12_MAX_CONTEXT_HW_ID Lucas De Marchi
2019-08-16  8:04 ` [PATCH 29/39] drm/i915/tgl: Report valid VDBoxes with SFC capability Lucas De Marchi
2019-08-16  8:04 ` [PATCH 30/39] drm/i915/tgl: Move GTCR register to cope with GAM MMIO address remap Lucas De Marchi
2019-08-16  8:04 ` [PATCH 31/39] drm/i915/tgl: Updated Private PAT programming Lucas De Marchi
2019-08-16  8:04 ` [PATCH 32/39] drm/i915/tgl/perf: use the same oa ctx_id format as icl Lucas De Marchi
2019-08-16  8:04 ` [PATCH 33/39] drm/i915/perf: add a parameter to control the size of OA buffer Lucas De Marchi
2019-08-19 18:31   ` Umesh Nerlige Ramappa
2019-08-21  8:37   ` Lionel Landwerlin
2019-08-22 10:43   ` Joonas Lahtinen
2019-08-22 12:13     ` Lionel Landwerlin
2019-08-23  8:30       ` Lucas De Marchi
2019-08-16  8:04 ` [PATCH 34/39] drm/i915/tgl: Add perf support on TGL Lucas De Marchi
2019-08-16  8:04 ` [PATCH 35/39] drm/i915/tgl: Gen-12 display loses Yf tiling and legacy CCS support Lucas De Marchi
2019-08-16  8:05 ` [PATCH 36/39] drm/framebuffer/tgl: Format modifier for Intel Gen-12 render compression Lucas De Marchi
2019-08-16  8:05 ` [PATCH 37/39] drm/i915/tgl: Gen-12 render decompression Lucas De Marchi
2019-08-16  8:05 ` [PATCH 38/39] drm/framebuffer/tgl: Format modifier for Intel Gen-12 media compression Lucas De Marchi
2019-08-16  8:05 ` [PATCH 39/39] drm/i915/tgl: " Lucas De Marchi
2019-08-16  9:37 ` ✗ Fi.CI.CHECKPATCH: warning for Tiger Lake batch 3 Patchwork
2019-08-16  9:51 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-08-16  9:57 ` ✓ Fi.CI.BAT: success " Patchwork
2019-08-16 21:26 ` ✓ 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=d1904f0f-8db0-ef14-a642-060c30485419@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox