public inbox for dri-devel@lists.freedesktop.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 5/8] drm/i915/dp: rewrite DP 2.0 128b/132b link training based on errata
Date: Thu, 27 Jan 2022 09:49:51 +0200	[thread overview]
Message-ID: <YfJOn4RQMAzjaP4i@intel.com> (raw)
In-Reply-To: <5c061c1610834b9b1b057e6d32b774e7db5500a8.1643130139.git.jani.nikula@intel.com>

On Tue, Jan 25, 2022 at 07:03:43PM +0200, Jani Nikula wrote:
<snip>
> +static bool
> +intel_dp_128b132b_lane_cds(struct intel_dp *intel_dp,
> +			   const struct intel_crtc_state *crtc_state,
> +			   int lttpr_count)
> +{
> +	struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
> +	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
> +	u8 link_status[DP_LINK_STATUS_SIZE];
> +	unsigned long deadline;
> +
> +	if (drm_dp_dpcd_writeb(&intel_dp->aux, DP_TRAINING_PATTERN_SET,
> +			       DP_TRAINING_PATTERN_2_CDS) != 1) {
> +		drm_err(&i915->drm,
> +			"[ENCODER:%d:%s] Failed to start 128b/132b TPS2 CDS\n",
> +			encoder->base.base.id, encoder->base.name);
> +		return false;
> +	}
> +
> +	deadline = jiffies + msecs_to_jiffies((lttpr_count + 1) * 20);
> +	for (;;) {
> +		usleep_range(2000, 3000);
> +
> +		if (drm_dp_dpcd_read_link_status(&intel_dp->aux, link_status) < 0) {
> +			drm_err(&i915->drm,
> +				"[ENCODER:%d:%s] Failed to read link status\n",
> +				encoder->base.base.id, encoder->base.name);
> +			return false;
> +		}
> +
> +		if (drm_dp_128b132b_cds_interlane_align_done(link_status) &&
> +		    drm_dp_128b132b_lane_symbol_locked(link_status, crtc_state->lane_count)) {

I'm thinkin we want to check for both eq done and symbol locked here,
just like we do with 8b10b.

> +			drm_dbg_kms(&i915->drm,
> +				    "[ENCODER:%d:%s] CDS interlane align done\n",
> +				    encoder->base.base.id, encoder->base.name);
> +			break;
> +		}
> +
> +		if (drm_dp_128b132b_link_training_failed(link_status)) {
> +			intel_dp_dump_link_status(intel_dp, DP_PHY_DPRX, link_status);
> +			drm_err(&i915->drm,
> +				"[ENCODER:%d:%s] Downstream link training failure\n",
> +				encoder->base.base.id, encoder->base.name);
> +			return false;
> +		}
> +
> +		if (time_after(jiffies, deadline)) {
> +			intel_dp_dump_link_status(intel_dp, DP_PHY_DPRX, link_status);
> +			drm_err(&i915->drm,
> +				"[ENCODER:%d:%s] CDS timeout\n",
> +				encoder->base.base.id, encoder->base.name);
> +			return false;
> +		}
> +	}
> +
> +	/* FIXME: Should DP_TRAINING_PATTERN_DISABLE be written first? */
> +	if (intel_dp->set_idle_link_train)
> +		intel_dp->set_idle_link_train(intel_dp, crtc_state);
> +
> +	return true;
> +}

-- 
Ville Syrjälä
Intel

  parent reply	other threads:[~2022-01-27  7:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25 17:03 [PATCH 0/8] drm/dp, drm/i915: 128b/132b updates Jani Nikula
2022-01-25 17:03 ` [PATCH 1/8] drm/dp: add drm_dp_128b132b_read_aux_rd_interval() Jani Nikula
2022-01-27  7:26   ` Ville Syrjälä
2022-01-25 17:03 ` [PATCH 2/8] drm/dp: add 128b/132b link status helpers from DP 2.0 E11 Jani Nikula
2022-01-25 17:03 ` [PATCH 3/8] drm/dp: add some new DPCD macros " Jani Nikula
2022-01-27  7:31   ` Ville Syrjälä
2022-01-25 17:03 ` [PATCH 4/8] drm/i915/dp: move intel_dp_prepare_link_train() call Jani Nikula
2022-01-25 17:03 ` [PATCH 5/8] drm/i915/dp: rewrite DP 2.0 128b/132b link training based on errata Jani Nikula
2022-01-26  5:34   ` Ville Syrjälä
2022-02-02 10:22     ` Jani Nikula
2022-01-27  7:49   ` Ville Syrjälä [this message]
2022-02-02 10:23     ` Jani Nikula
2022-01-25 17:03 ` [PATCH 6/8] drm/i915/dp: add 128b/132b support to link status checks Jani Nikula
2022-01-27  7:50   ` Ville Syrjälä
2022-01-25 17:03 ` [PATCH 7/8] drm/i915/dp: give more time for CDS Jani Nikula
2022-01-25 17:03 ` [PATCH 8/8] drm/i915/mst: update slot information for 128b/132b Jani Nikula
2022-01-25 18:07   ` Lyude Paul

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=YfJOn4RQMAzjaP4i@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox