Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 1/5] drm/i915: Tweak the DP "max vswing reached?" condition
Date: Wed, 6 Oct 2021 18:44:29 +0300	[thread overview]
Message-ID: <20211006154429.GA3025323@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <20211004170535.4173-2-ville.syrjala@linux.intel.com>

On Mon, Oct 04, 2021 at 08:05:31PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Currently we consider the max vswing reached when we transmit a
> the max voltage level, but we don't consider pre-emphasis at all.
> This kinda matches older DP specs that only had some vague text
> about transmitting the maximum voltage swing. Latest versions
> now say something vague about consider the sum of the vswing
> and pre-emphasis fields in the ADJUST_REQUEST_LANE registers.
> Very vague, and super confusing especially the fact that it
> talks about transmitted voltgage swing in the same sentence
> as it say to look at the requested values.
> 
> Also glanced at the link CTS spec, and that one seems to have
> tests that assume contradicting behaviour. Some say to consider
> just the vswing level we transmit, others say to check for
> sum of transmitted vswing+preemph being 3.
> 
> So let's try to take some kind of sane middle ground here.
> I think what could make sense is only consider max vswing
> reached if MAX_SWING_REACHED==1 _and_ vswing+preemph==3.
> That will allow things to go all the way up to vswing 3 +
> pre-emph 0 or vswing 2 + pre-emph 1, depending on what
> the maximum supported vswing is. Only considering the sum
> of vswing+pre-emph doesn't make much sense to me since
> we could terminate too early if the sink requests eg.
> vswing 0 + pre-emph 3. And if we'd stick to the current
> code we could terminate too early of the sink asks for
> vswing 2 + pre-emph 0 when vswing level 3 is not supported.
> 
> Side note: I don't really understand why any of this stuff is
> "specified" at all. There is already a limit of 5 attempts at
> the same vswing+pre-emph level, and a total limit of 10
> attempts. So might as well stick to the same max 5 attempts
> across the board IMO.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Imre Deak <imre.deak@intel.com>

> ---
>  .../drm/i915/display/intel_dp_link_training.c | 22 ++++++++++++++++---
>  1 file changed, 19 insertions(+), 3 deletions(-)
> 
> 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 c052ce14894d..a45569b8c959 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> @@ -492,11 +492,27 @@ static bool intel_dp_link_max_vswing_reached(struct intel_dp *intel_dp,
>  {
>  	int lane;
>  
> -	for (lane = 0; lane < crtc_state->lane_count; lane++)
> -		if ((intel_dp->train_set[lane] &
> -		     DP_TRAIN_MAX_SWING_REACHED) == 0)
> +	/*
> +	 * FIXME: The DP spec is very confusing here, also the Link CTS
> +	 * spec seems to have self contradicting tests around this area.
> +	 *
> +	 * In lieu of better ideas let's just stop when we've reached the
> +	 * max supported vswing with its max pre-emphasis, which is either
> +	 * 2+1 or 3+0 depending on whether vswing level 3 is supported or not.
> +	 */
> +	for (lane = 0; lane < crtc_state->lane_count; lane++) {
> +		u8 v = (intel_dp->train_set[lane] & DP_TRAIN_VOLTAGE_SWING_MASK) >>
> +			DP_TRAIN_VOLTAGE_SWING_SHIFT;
> +		u8 p = (intel_dp->train_set[lane] & DP_TRAIN_PRE_EMPHASIS_MASK) >>
> +			DP_TRAIN_PRE_EMPHASIS_SHIFT;
> +
> +		if ((intel_dp->train_set[lane] & DP_TRAIN_MAX_SWING_REACHED) == 0)
>  			return false;
>  
> +		if (v + p != 3)
> +			return false;
> +	}
> +
>  	return true;
>  }
>  
> -- 
> 2.32.0
> 

  reply	other threads:[~2021-10-06 15:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 17:05 [Intel-gfx] [PATCH v2 0/5] drm/i915: Improve DP link training further Ville Syrjala
2021-10-04 17:05 ` [Intel-gfx] [PATCH v2 1/5] drm/i915: Tweak the DP "max vswing reached?" condition Ville Syrjala
2021-10-06 15:44   ` Imre Deak [this message]
2021-10-04 17:05 ` [Intel-gfx] [PATCH v2 2/5] drm/i915: Show LTTPR in the TPS debug print Ville Syrjala
2021-10-06 15:47   ` Imre Deak
2021-10-04 17:05 ` [Intel-gfx] [PATCH v2 3/5] drm/i915: Print the DP vswing adjustment request Ville Syrjala
2021-10-06 15:50   ` Imre Deak
2021-10-04 17:05 ` [Intel-gfx] [PATCH v2 4/5] drm/i915: Pimp link training debug prints Ville Syrjala
2021-10-06 16:09   ` Imre Deak
2021-10-06 16:48     ` Ville Syrjälä
2021-10-06 19:28       ` Ville Syrjälä
2021-10-04 17:05 ` [Intel-gfx] [PATCH v2 5/5] drm/i915: Call intel_dp_dump_link_status() for CR failures Ville Syrjala
2021-10-06 16:12   ` Imre Deak
2021-10-04 18:55 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: Improve DP link training further (rev2) Patchwork
2021-10-04 23:46 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/i915: Improve DP link training further (rev3) Patchwork
2021-10-05 12:18 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Improve DP link training further (rev4) Patchwork
2021-10-05 12:49 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2021-10-05 13:42   ` Ville Syrjälä
2021-10-05 14:02 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Improve DP link training further (rev5) Patchwork
2021-10-05 14:35 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-10-05 18:25 ` [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=20211006154429.GA3025323@ideak-desk.fi.intel.com \
    --to=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox