All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, uma.shankar@intel.com,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 6/8] drm/i915/dp: add 128b/132b support to link status checks
Date: Wed, 9 Feb 2022 11:17:30 +0200	[thread overview]
Message-ID: <YgOGqmEigGnYIK8f@intel.com> (raw)
In-Reply-To: <87sfsspfsa.fsf@intel.com>

On Wed, Feb 09, 2022 at 11:09:41AM +0200, Jani Nikula wrote:
> On Tue, 08 Feb 2022, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> > On Thu, Feb 03, 2022 at 11:03:55AM +0200, Jani Nikula wrote:
> >> Abstract link status check to a function that takes 128b/132b and 8b/10b
> >> into account, and use it. Also dump link status on failures.
> >> 
> >> Cc: Uma Shankar <uma.shankar@intel.com>
> >> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> >> ---
> >>  drivers/gpu/drm/i915/display/intel_dp.c       | 39 ++++++++++++++-----
> >>  .../drm/i915/display/intel_dp_link_training.c |  2 +-
> >>  .../drm/i915/display/intel_dp_link_training.h |  4 ++
> >>  3 files changed, 34 insertions(+), 11 deletions(-)
> >> 
> >> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> >> index 146b83916005..8c5590f0409a 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> >> @@ -3628,6 +3628,32 @@ static void intel_dp_handle_test_request(struct intel_dp *intel_dp)
> >>  			    "Could not write test response to sink\n");
> >>  }
> >>  
> >> +static bool intel_dp_link_ok(struct intel_dp *intel_dp,
> >> +			     u8 link_status[DP_LINK_STATUS_SIZE])
> >> +{
> >> +	struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
> >> +	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
> >> +	bool uhbr = intel_dp->link_rate >= 1000000;
> >> +	bool ok;
> >> +
> >> +	if (uhbr)
> >> +		ok = drm_dp_128b132b_lane_channel_eq_done(link_status,
> >> +							  intel_dp->lane_count);
> >
> > I was pondering whether we need to check more of the bits here. I guess
> > time will tell.
> >
> > Remainder of the series is
> > Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Just to be on the safe side, does this cover patches 2 and 4 too?

Yeah, pretty sure I read through all of them.

> 
> And thanks for all the reviews so far, much appreciated!
>
> BR,
> Jani.
> 
> 
> >
> >> +	else
> >> +		ok = drm_dp_channel_eq_ok(link_status, intel_dp->lane_count);
> >> +
> >> +	if (ok)
> >> +		return true;
> >> +
> >> +	intel_dp_dump_link_status(intel_dp, DP_PHY_DPRX, link_status);
> >> +	drm_dbg_kms(&i915->drm,
> >> +		    "[ENCODER:%d:%s] %s link not ok, retraining\n",
> >> +		    encoder->base.base.id, encoder->base.name,
> >> +		    uhbr ? "128b/132b" : "8b/10b");
> >> +
> >> +	return false;
> >> +}
> >> +
> >>  static void
> >>  intel_dp_mst_hpd_irq(struct intel_dp *intel_dp, u8 *esi, u8 *ack)
> >>  {
> >> @@ -3658,14 +3684,7 @@ static bool intel_dp_mst_link_status(struct intel_dp *intel_dp)
> >>  		return false;
> >>  	}
> >>  
> >> -	if (!drm_dp_channel_eq_ok(link_status, intel_dp->lane_count)) {
> >> -		drm_dbg_kms(&i915->drm,
> >> -			    "[ENCODER:%d:%s] channel EQ not ok, retraining\n",
> >> -			    encoder->base.base.id, encoder->base.name);
> >> -		return false;
> >> -	}
> >> -
> >> -	return true;
> >> +	return intel_dp_link_ok(intel_dp, link_status);
> >>  }
> >>  
> >>  /**
> >> @@ -3779,8 +3798,8 @@ intel_dp_needs_link_retrain(struct intel_dp *intel_dp)
> >>  					intel_dp->lane_count))
> >>  		return false;
> >>  
> >> -	/* Retrain if Channel EQ or CR not ok */
> >> -	return !drm_dp_channel_eq_ok(link_status, intel_dp->lane_count);
> >> +	/* Retrain if link not ok */
> >> +	return !intel_dp_link_ok(intel_dp, link_status);
> >>  }
> >>  
> >>  static bool intel_dp_has_connector(struct intel_dp *intel_dp,
> >> diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> >> index cc2b82d9114c..0686da36c428 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> >> @@ -712,7 +712,7 @@ static bool intel_dp_adjust_request_changed(const struct intel_crtc_state *crtc_
> >>  	return false;
> >>  }
> >>  
> >> -static void
> >> +void
> >>  intel_dp_dump_link_status(struct intel_dp *intel_dp, enum drm_dp_phy dp_phy,
> >>  			  const u8 link_status[DP_LINK_STATUS_SIZE])
> >>  {
> >> diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.h b/drivers/gpu/drm/i915/display/intel_dp_link_training.h
> >> index dbfb15705aaa..dc1556b46b85 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.h
> >> +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.h
> >> @@ -29,6 +29,10 @@ void intel_dp_start_link_train(struct intel_dp *intel_dp,
> >>  void intel_dp_stop_link_train(struct intel_dp *intel_dp,
> >>  			      const struct intel_crtc_state *crtc_state);
> >>  
> >> +void
> >> +intel_dp_dump_link_status(struct intel_dp *intel_dp, enum drm_dp_phy dp_phy,
> >> +			  const u8 link_status[DP_LINK_STATUS_SIZE]);
> >> +
> >>  /* Get the TPSx symbol type of the value programmed to DP_TRAINING_PATTERN_SET */
> >>  static inline u8 intel_dp_training_pattern_symbol(u8 pattern)
> >>  {
> >> -- 
> >> 2.30.2
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center

-- 
Ville Syrjälä
Intel

WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 6/8] drm/i915/dp: add 128b/132b support to link status checks
Date: Wed, 9 Feb 2022 11:17:30 +0200	[thread overview]
Message-ID: <YgOGqmEigGnYIK8f@intel.com> (raw)
In-Reply-To: <87sfsspfsa.fsf@intel.com>

On Wed, Feb 09, 2022 at 11:09:41AM +0200, Jani Nikula wrote:
> On Tue, 08 Feb 2022, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> > On Thu, Feb 03, 2022 at 11:03:55AM +0200, Jani Nikula wrote:
> >> Abstract link status check to a function that takes 128b/132b and 8b/10b
> >> into account, and use it. Also dump link status on failures.
> >> 
> >> Cc: Uma Shankar <uma.shankar@intel.com>
> >> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> >> ---
> >>  drivers/gpu/drm/i915/display/intel_dp.c       | 39 ++++++++++++++-----
> >>  .../drm/i915/display/intel_dp_link_training.c |  2 +-
> >>  .../drm/i915/display/intel_dp_link_training.h |  4 ++
> >>  3 files changed, 34 insertions(+), 11 deletions(-)
> >> 
> >> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> >> index 146b83916005..8c5590f0409a 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> >> @@ -3628,6 +3628,32 @@ static void intel_dp_handle_test_request(struct intel_dp *intel_dp)
> >>  			    "Could not write test response to sink\n");
> >>  }
> >>  
> >> +static bool intel_dp_link_ok(struct intel_dp *intel_dp,
> >> +			     u8 link_status[DP_LINK_STATUS_SIZE])
> >> +{
> >> +	struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
> >> +	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
> >> +	bool uhbr = intel_dp->link_rate >= 1000000;
> >> +	bool ok;
> >> +
> >> +	if (uhbr)
> >> +		ok = drm_dp_128b132b_lane_channel_eq_done(link_status,
> >> +							  intel_dp->lane_count);
> >
> > I was pondering whether we need to check more of the bits here. I guess
> > time will tell.
> >
> > Remainder of the series is
> > Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Just to be on the safe side, does this cover patches 2 and 4 too?

Yeah, pretty sure I read through all of them.

> 
> And thanks for all the reviews so far, much appreciated!
>
> BR,
> Jani.
> 
> 
> >
> >> +	else
> >> +		ok = drm_dp_channel_eq_ok(link_status, intel_dp->lane_count);
> >> +
> >> +	if (ok)
> >> +		return true;
> >> +
> >> +	intel_dp_dump_link_status(intel_dp, DP_PHY_DPRX, link_status);
> >> +	drm_dbg_kms(&i915->drm,
> >> +		    "[ENCODER:%d:%s] %s link not ok, retraining\n",
> >> +		    encoder->base.base.id, encoder->base.name,
> >> +		    uhbr ? "128b/132b" : "8b/10b");
> >> +
> >> +	return false;
> >> +}
> >> +
> >>  static void
> >>  intel_dp_mst_hpd_irq(struct intel_dp *intel_dp, u8 *esi, u8 *ack)
> >>  {
> >> @@ -3658,14 +3684,7 @@ static bool intel_dp_mst_link_status(struct intel_dp *intel_dp)
> >>  		return false;
> >>  	}
> >>  
> >> -	if (!drm_dp_channel_eq_ok(link_status, intel_dp->lane_count)) {
> >> -		drm_dbg_kms(&i915->drm,
> >> -			    "[ENCODER:%d:%s] channel EQ not ok, retraining\n",
> >> -			    encoder->base.base.id, encoder->base.name);
> >> -		return false;
> >> -	}
> >> -
> >> -	return true;
> >> +	return intel_dp_link_ok(intel_dp, link_status);
> >>  }
> >>  
> >>  /**
> >> @@ -3779,8 +3798,8 @@ intel_dp_needs_link_retrain(struct intel_dp *intel_dp)
> >>  					intel_dp->lane_count))
> >>  		return false;
> >>  
> >> -	/* Retrain if Channel EQ or CR not ok */
> >> -	return !drm_dp_channel_eq_ok(link_status, intel_dp->lane_count);
> >> +	/* Retrain if link not ok */
> >> +	return !intel_dp_link_ok(intel_dp, link_status);
> >>  }
> >>  
> >>  static bool intel_dp_has_connector(struct intel_dp *intel_dp,
> >> diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> >> index cc2b82d9114c..0686da36c428 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> >> @@ -712,7 +712,7 @@ static bool intel_dp_adjust_request_changed(const struct intel_crtc_state *crtc_
> >>  	return false;
> >>  }
> >>  
> >> -static void
> >> +void
> >>  intel_dp_dump_link_status(struct intel_dp *intel_dp, enum drm_dp_phy dp_phy,
> >>  			  const u8 link_status[DP_LINK_STATUS_SIZE])
> >>  {
> >> diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.h b/drivers/gpu/drm/i915/display/intel_dp_link_training.h
> >> index dbfb15705aaa..dc1556b46b85 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.h
> >> +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.h
> >> @@ -29,6 +29,10 @@ void intel_dp_start_link_train(struct intel_dp *intel_dp,
> >>  void intel_dp_stop_link_train(struct intel_dp *intel_dp,
> >>  			      const struct intel_crtc_state *crtc_state);
> >>  
> >> +void
> >> +intel_dp_dump_link_status(struct intel_dp *intel_dp, enum drm_dp_phy dp_phy,
> >> +			  const u8 link_status[DP_LINK_STATUS_SIZE]);
> >> +
> >>  /* Get the TPSx symbol type of the value programmed to DP_TRAINING_PATTERN_SET */
> >>  static inline u8 intel_dp_training_pattern_symbol(u8 pattern)
> >>  {
> >> -- 
> >> 2.30.2
> 
> -- 
> Jani Nikula, Intel Open Source Graphics Center

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2022-02-09  9:17 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-03  9:03 [PATCH v2 0/8] drm/dp, drm/i915: 128b/132b updates Jani Nikula
2022-02-03  9:03 ` [Intel-gfx] " Jani Nikula
2022-02-03  9:03 ` [PATCH v2 1/8] drm/dp: add drm_dp_128b132b_read_aux_rd_interval() Jani Nikula
2022-02-03  9:03   ` [Intel-gfx] " Jani Nikula
2022-02-03  9:03 ` [PATCH v2 2/8] drm/dp: add 128b/132b link status helpers from DP 2.0 E11 Jani Nikula
2022-02-03  9:03   ` [Intel-gfx] " Jani Nikula
2022-02-03  9:03 ` [PATCH v2 3/8] drm/dp: add some new DPCD macros " Jani Nikula
2022-02-03  9:03   ` [Intel-gfx] " Jani Nikula
2022-02-03  9:03 ` [PATCH v2 4/8] drm/i915/dp: move intel_dp_prepare_link_train() call Jani Nikula
2022-02-03  9:03   ` [Intel-gfx] " Jani Nikula
2022-02-03  9:03 ` [PATCH v2 5/8] drm/i915/dp: rewrite DP 2.0 128b/132b link training based on errata Jani Nikula
2022-02-03  9:03   ` [Intel-gfx] " Jani Nikula
2022-02-04 11:37   ` Ville Syrjälä
2022-02-04 11:37     ` [Intel-gfx] " Ville Syrjälä
2022-02-08  9:17     ` Jani Nikula
2022-02-08  9:17       ` [Intel-gfx] " Jani Nikula
2022-02-08  9:39       ` Ville Syrjälä
2022-02-08  9:39         ` [Intel-gfx] " Ville Syrjälä
2022-02-08 12:12         ` Jani Nikula
2022-02-08 12:12           ` [Intel-gfx] " Jani Nikula
2022-02-08 12:55           ` Ville Syrjälä
2022-02-08 12:55             ` [Intel-gfx] " Ville Syrjälä
2022-02-08 13:31             ` Jani Nikula
2022-02-08 13:31               ` Jani Nikula
2022-02-08 13:30   ` [PATCH v3] " Jani Nikula
2022-02-08 13:30     ` [Intel-gfx] " Jani Nikula
2022-02-08 14:32   ` [PATCH v4] " Jani Nikula
2022-02-08 14:32     ` [Intel-gfx] " Jani Nikula
2022-02-08 14:38     ` Ville Syrjälä
2022-02-08 14:38       ` [Intel-gfx] " Ville Syrjälä
2022-02-03  9:03 ` [PATCH v2 6/8] drm/i915/dp: add 128b/132b support to link status checks Jani Nikula
2022-02-03  9:03   ` [Intel-gfx] " Jani Nikula
2022-02-08 15:06   ` Ville Syrjälä
2022-02-08 15:06     ` [Intel-gfx] " Ville Syrjälä
2022-02-09  9:09     ` Jani Nikula
2022-02-09  9:09       ` [Intel-gfx] " Jani Nikula
2022-02-09  9:17       ` Ville Syrjälä [this message]
2022-02-09  9:17         ` Ville Syrjälä
2022-02-11 10:11         ` Jani Nikula
2022-02-11 10:11           ` [Intel-gfx] " Jani Nikula
2022-02-03  9:03 ` [PATCH v2 7/8] drm/i915/mst: update slot information for 128b/132b Jani Nikula
2022-02-03  9:03   ` [Intel-gfx] " Jani Nikula
2022-02-08 15:02   ` Ville Syrjälä
2022-02-08 15:02     ` [Intel-gfx] " Ville Syrjälä
2022-02-08 15:23   ` [PATCH v3] " Jani Nikula
2022-02-08 15:23     ` [Intel-gfx] " Jani Nikula
2022-02-03  9:03 ` [PATCH v2 8/8] HACK: drm/i915/dp: give more time for CDS Jani Nikula
2022-02-03  9:03   ` [Intel-gfx] " Jani Nikula
2022-02-03 13:44 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/dp, drm/i915: 128b/132b updates (rev2) Patchwork
2022-02-03 13:47 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-02-03 14:14 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-02-03 17:31 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-02-08 14:41 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/dp, drm/i915: 128b/132b updates (rev4) Patchwork
2022-02-08 14:43 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-02-08 15:15 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2022-02-08 16:57 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/dp, drm/i915: 128b/132b updates (rev5) Patchwork
2022-02-08 17:00 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-02-08 17:28 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2022-02-08 19:51 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/dp, drm/i915: 128b/132b updates (rev6) Patchwork
2022-02-08 19:54 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-02-08 20:20 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-02-08 21:33 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-02-09  9:26 ` [PATCH v2 0/8] drm/dp, drm/i915: 128b/132b updates Jani Nikula
2022-02-09  9:26   ` [Intel-gfx] " Jani Nikula

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=YgOGqmEigGnYIK8f@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=uma.shankar@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.