Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Manasi Navare <manasi.d.navare@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 02/13] drm/i915: Move TRANS_DDI_FUNC_CTL2 programming where it belongs
Date: Thu, 19 Mar 2020 15:20:56 +0200	[thread overview]
Message-ID: <20200319132056.GH13686@intel.com> (raw)
In-Reply-To: <20200318223438.GB6675@intel.com>

On Wed, Mar 18, 2020 at 03:34:38PM -0700, Manasi Navare wrote:
> On Fri, Mar 13, 2020 at 06:48:20PM +0200, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > This port sync enable/disable stuff is misplaced. It's just another step
> > of the normal TRANS_DDI_FUNC_CTL enable. Move it to its natural place.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_ddi.c     | 71 +++++++++++---------
> >  drivers/gpu/drm/i915/display/intel_display.c | 34 ----------
> >  2 files changed, 39 insertions(+), 66 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> > index 73d0f4648c06..8d486282eea3 100644
> > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> > @@ -1558,12 +1558,34 @@ void intel_ddi_enable_transcoder_func(const struct intel_crtc_state *crtc_state)
> >  	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> >  	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> >  	enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
> > -	u32 temp;
> > +	u32 ctl;
> >  
> > -	temp = intel_ddi_transcoder_func_reg_val_get(crtc_state);
> > +	if (INTEL_GEN(dev_priv) >= 11) {
> > +		enum transcoder master_transcoder = crtc_state->master_transcoder;
> > +		u32 ctl2 = 0;
> > +
> > +		if (master_transcoder != INVALID_TRANSCODER) {
> > +			u8 master_select;
> > +
> > +			if (master_transcoder == TRANSCODER_EDP)
> > +				master_select = 0;
> > +			else
> > +				master_select = master_transcoder + 1;
> > +
> > +			ctl2 |= PORT_SYNC_MODE_ENABLE |
> > +				(PORT_SYNC_MODE_MASTER_SELECT(master_select) &
> > +				 PORT_SYNC_MODE_MASTER_SELECT_MASK) <<
> > +				PORT_SYNC_MODE_MASTER_SELECT_SHIFT;
> > +		}
> > +
> > +		intel_de_write(dev_priv,
> > +			       TRANS_DDI_FUNC_CTL2(crtc_state->cpu_transcoder), ctl2);
> > +	}
> > +
> > +	ctl = intel_ddi_transcoder_func_reg_val_get(crtc_state);
> >  	if (intel_crtc_has_type(crtc_state, INTEL_OUTPUT_DP_MST))
> > -		temp |= TRANS_DDI_DP_VC_PAYLOAD_ALLOC;
> > -	intel_de_write(dev_priv, TRANS_DDI_FUNC_CTL(cpu_transcoder), temp);
> > +		ctl |= TRANS_DDI_DP_VC_PAYLOAD_ALLOC;
> > +	intel_de_write(dev_priv, TRANS_DDI_FUNC_CTL(cpu_transcoder), ctl);
> >  }
> >  
> >  /*
> > @@ -1576,11 +1598,11 @@ intel_ddi_config_transcoder_func(const struct intel_crtc_state *crtc_state)
> >  	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> >  	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> >  	enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
> > -	u32 temp;
> > +	u32 ctl;
> >  
> > -	temp = intel_ddi_transcoder_func_reg_val_get(crtc_state);
> > -	temp &= ~TRANS_DDI_FUNC_ENABLE;
> > -	intel_de_write(dev_priv, TRANS_DDI_FUNC_CTL(cpu_transcoder), temp);
> > +	ctl = intel_ddi_transcoder_func_reg_val_get(crtc_state);
> > +	ctl &= ~TRANS_DDI_FUNC_ENABLE;
> > +	intel_de_write(dev_priv, TRANS_DDI_FUNC_CTL(cpu_transcoder), ctl);
> >  }
> >  
> >  void intel_ddi_disable_transcoder_func(const struct intel_crtc_state *crtc_state)
> > @@ -1588,20 +1610,23 @@ void intel_ddi_disable_transcoder_func(const struct intel_crtc_state *crtc_state
> >  	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> >  	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> >  	enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
> > -	u32 val;
> > +	u32 ctl;
> >  
> > -	val = intel_de_read(dev_priv, TRANS_DDI_FUNC_CTL(cpu_transcoder));
> > -	val &= ~TRANS_DDI_FUNC_ENABLE;
> > +	if (INTEL_GEN(dev_priv) >= 11)
> > +		intel_de_write(dev_priv, TRANS_DDI_FUNC_CTL2(cpu_transcoder), 0);
> 
> This should be set to 0 only for the slave where we enable the port sync mode so
> set it to 0 only if if (old_crtc_state->master_transcoder != INVALID_TRANSCODER)
> 
> This will just ensure that we dont accidently set it to 0 for non slave transcoders

No, we should just write the value we want for every transcoder. If
there are bits in there that should be set then we should set them
explicitly. But I didn't think there's anything we want to set.

> 
> Manasi
> 
> > +
> > +	ctl = intel_de_read(dev_priv, TRANS_DDI_FUNC_CTL(cpu_transcoder));
> > +	ctl &= ~TRANS_DDI_FUNC_ENABLE;
> >  
> >  	if (INTEL_GEN(dev_priv) >= 12) {
> >  		if (!intel_dp_mst_is_master_trans(crtc_state)) {
> > -			val &= ~(TGL_TRANS_DDI_PORT_MASK |
> > +			ctl &= ~(TGL_TRANS_DDI_PORT_MASK |
> >  				 TRANS_DDI_MODE_SELECT_MASK);
> >  		}
> >  	} else {
> > -		val &= ~(TRANS_DDI_PORT_MASK | TRANS_DDI_MODE_SELECT_MASK);
> > +		ctl &= ~(TRANS_DDI_PORT_MASK | TRANS_DDI_MODE_SELECT_MASK);
> >  	}
> > -	intel_de_write(dev_priv, TRANS_DDI_FUNC_CTL(cpu_transcoder), val);
> > +	intel_de_write(dev_priv, TRANS_DDI_FUNC_CTL(cpu_transcoder), ctl);
> >  
> >  	if (dev_priv->quirks & QUIRK_INCREASE_DDI_DISABLED_TIME &&
> >  	    intel_crtc_has_type(crtc_state, INTEL_OUTPUT_HDMI)) {
> > @@ -3405,21 +3430,6 @@ static void intel_ddi_post_disable_hdmi(struct intel_encoder *encoder,
> >  	intel_dp_dual_mode_set_tmds_output(intel_hdmi, false);
> >  }
> >  
> > -static void icl_disable_transcoder_port_sync(const struct intel_crtc_state *old_crtc_state)
> > -{
> > -	struct intel_crtc *crtc = to_intel_crtc(old_crtc_state->uapi.crtc);
> > -	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> > -
> > -	if (old_crtc_state->master_transcoder == INVALID_TRANSCODER)
> > -		return;
> > -
> > -	DRM_DEBUG_KMS("Disabling Transcoder Port Sync on Slave Transcoder %s\n",
> > -		      transcoder_name(old_crtc_state->cpu_transcoder));
> > -
> > -	intel_de_write(dev_priv,
> > -		       TRANS_DDI_FUNC_CTL2(old_crtc_state->cpu_transcoder), 0);
> > -}
> > -
> >  static void intel_ddi_post_disable(struct intel_encoder *encoder,
> >  				   const struct intel_crtc_state *old_crtc_state,
> >  				   const struct drm_connector_state *old_conn_state)
> > @@ -3434,9 +3444,6 @@ static void intel_ddi_post_disable(struct intel_encoder *encoder,
> >  
> >  		intel_disable_pipe(old_crtc_state);
> >  
> > -		if (INTEL_GEN(dev_priv) >= 11)
> > -			icl_disable_transcoder_port_sync(old_crtc_state);
> > -
> >  		intel_ddi_disable_transcoder_func(old_crtc_state);
> >  
> >  		intel_dsc_disable(old_crtc_state);
> > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> > index 8f23c4d51c33..c49b4e6eb3d4 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display.c
> > @@ -4998,37 +4998,6 @@ static void icl_set_pipe_chicken(struct intel_crtc *crtc)
> >  	intel_de_write(dev_priv, PIPE_CHICKEN(pipe), tmp);
> >  }
> >  
> > -static void icl_enable_trans_port_sync(const struct intel_crtc_state *crtc_state)
> > -{
> > -	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> > -	struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
> > -	u32 trans_ddi_func_ctl2_val;
> > -	u8 master_select;
> > -
> > -	/*
> > -	 * Configure the master select and enable Transcoder Port Sync for
> > -	 * Slave CRTCs transcoder.
> > -	 */
> > -	if (crtc_state->master_transcoder == INVALID_TRANSCODER)
> > -		return;
> > -
> > -	if (crtc_state->master_transcoder == TRANSCODER_EDP)
> > -		master_select = 0;
> > -	else
> > -		master_select = crtc_state->master_transcoder + 1;
> > -
> > -	/* Set the master select bits for Tranascoder Port Sync */
> > -	trans_ddi_func_ctl2_val = (PORT_SYNC_MODE_MASTER_SELECT(master_select) &
> > -				   PORT_SYNC_MODE_MASTER_SELECT_MASK) <<
> > -		PORT_SYNC_MODE_MASTER_SELECT_SHIFT;
> > -	/* Enable Transcoder Port Sync */
> > -	trans_ddi_func_ctl2_val |= PORT_SYNC_MODE_ENABLE;
> > -
> > -	intel_de_write(dev_priv,
> > -		       TRANS_DDI_FUNC_CTL2(crtc_state->cpu_transcoder),
> > -		       trans_ddi_func_ctl2_val);
> > -}
> > -
> >  static void intel_fdi_normal_train(struct intel_crtc *crtc)
> >  {
> >  	struct drm_device *dev = crtc->base.dev;
> > @@ -7037,9 +7006,6 @@ static void hsw_crtc_enable(struct intel_atomic_state *state,
> >  	if (!transcoder_is_dsi(cpu_transcoder))
> >  		intel_set_pipe_timings(new_crtc_state);
> >  
> > -	if (INTEL_GEN(dev_priv) >= 11)
> > -		icl_enable_trans_port_sync(new_crtc_state);
> > -
> >  	intel_set_pipe_src_size(new_crtc_state);
> >  
> >  	if (cpu_transcoder != TRANSCODER_EDP &&
> > -- 
> > 2.24.1
> > 

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

  reply	other threads:[~2020-03-19 13:21 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-13 16:48 [Intel-gfx] [PATCH 00/13] drm/i915: Port sync for skl+ Ville Syrjala
2020-03-13 16:48 ` [Intel-gfx] [PATCH 01/13] drm/i915/mst: Use .compute_config_late() to compute master transcoder Ville Syrjala
2020-03-20 23:37   ` Souza, Jose
2020-03-20 23:54     ` Souza, Jose
2020-03-13 16:48 ` [Intel-gfx] [PATCH 02/13] drm/i915: Move TRANS_DDI_FUNC_CTL2 programming where it belongs Ville Syrjala
2020-03-18 22:34   ` Manasi Navare
2020-03-19 13:20     ` Ville Syrjälä [this message]
2020-03-20 18:36       ` Manasi Navare
2020-03-13 16:48 ` [Intel-gfx] [PATCH 03/13] drm/i915: Drop usless master_transcoder assignments Ville Syrjala
2020-03-18 22:37   ` Manasi Navare
2020-03-19 13:22     ` Ville Syrjälä
2020-03-20 23:12       ` Manasi Navare
2020-03-13 16:48 ` [Intel-gfx] [PATCH 04/13] drm/i915: Move icl_get_trans_port_sync_config() into the DDI code Ville Syrjala
2020-03-18 22:44   ` Manasi Navare
2020-03-13 16:48 ` [Intel-gfx] [PATCH 05/13] drm/i915: Use REG_FIELD_PREP() & co. for TRANS_DDI_FUNC_CTL2 Ville Syrjala
2020-03-18 22:53   ` Manasi Navare
2020-03-13 16:48 ` [Intel-gfx] [PATCH 06/13] drm/i915: Include port sync state in the state dump Ville Syrjala
2020-03-18 23:00   ` Manasi Navare
2020-03-27 17:15     ` Ville Syrjälä
2020-03-13 16:48 ` [Intel-gfx] [PATCH 07/13] drm/i915: Store cpu_transcoder_mask in device info Ville Syrjala
2020-03-18 17:02   ` [Intel-gfx] [PATCH v2 " Ville Syrjala
2020-04-02  0:59     ` Souza, Jose
2020-03-13 16:48 ` [Intel-gfx] [PATCH 08/13] drm/i915: Implement port sync for SKL+ Ville Syrjala
2020-03-18 23:32   ` Manasi Navare
2020-03-13 16:48 ` [Intel-gfx] [PATCH 09/13] drm/i915: Eliminate port sync copy pasta Ville Syrjala
2020-04-02  1:25   ` Souza, Jose
2020-03-13 16:48 ` [Intel-gfx] [PATCH 10/13] drm/i915: Fix port sync code to work with >2 pipes Ville Syrjala
2020-04-03  0:32   ` Souza, Jose
2020-04-03 17:25     ` Ville Syrjälä
2020-03-13 16:48 ` [Intel-gfx] [PATCH 11/13] drm/i915: Do pipe updates after enables for everyone Ville Syrjala
2020-04-03  0:44   ` Souza, Jose
2020-03-13 16:48 ` [Intel-gfx] [PATCH 12/13] drm/i915: Pass atomic state to encoder hooks Ville Syrjala
2020-04-02  1:18   ` Souza, Jose
2020-03-13 16:48 ` [Intel-gfx] [PATCH 13/13] drm/i915: Move the port sync DP_TP_CTL stuff to the encoder hook Ville Syrjala
2020-04-03  0:59   ` Souza, Jose
2020-03-16 14:43 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: Port sync for skl+ Patchwork
2020-03-18 18:45 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Port sync for skl+ (rev2) Patchwork
2020-03-18 18:57 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2020-03-18 21:39 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Port sync for skl+ (rev3) Patchwork
2020-03-18 22:05 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-03-19  0:19 ` [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=20200319132056.GH13686@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=manasi.d.navare@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