[Intel-gfx] [PATCH 6/7] drm/i915: Fix DP_TRAIN_MAX_{PRE_EMPHASIS, SWING}_REACHED handling

Imre Deak imre.deak at intel.com
Thu Jun 25 21:06:52 UTC 2020


On Tue, May 12, 2020 at 08:41:44PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> The DP spec says:
> "The transmitter shall support at least three levels of voltage
>  swing (Levels 0, 1, and 2).
> 
>  If only three levels of voltage swing are supported (VOLTAGE
>  SWING SET field (bits 1:0) are programmed to 10 (Level 2)),
>  this bit shall be set to 1, and cleared in all other cases.
> 
>  If all four levels of voltage swing are supported (VOLTAGE
>  SWING SET field (bits 1:0) are programmed to 11 (Level 3)),
>  this bit shall be set to 1,and cleared in all other cases."
> 
> Let's follow that exactly instead of the current apporach
> where we can set those also for vswing/preemph levels 0 or 1
> (or 2 when the platform max is 3).
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Yep, so the sink could've incorrectly stopped asking for higher vswing
levels after it asked for 0 vs+2 pe, when the max vs is 2 for instance.
Matches the spec:

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

> ---
>  drivers/gpu/drm/i915/display/intel_dp_link_training.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 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 573f93779449..aa7af531bcb8 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
> @@ -72,8 +72,9 @@ void intel_dp_get_adjust_train(struct intel_dp *intel_dp,
>  	if (p >= preemph_max)
>  		p = preemph_max | DP_TRAIN_MAX_PRE_EMPHASIS_REACHED;
>  
> -	voltage_max = min(intel_dp->voltage_max(intel_dp),
> -			  dp_voltage_max(p));
> +	v = min(v, dp_voltage_max(p));
> +
> +	voltage_max = intel_dp->voltage_max(intel_dp);
>  	if (v >= voltage_max)
>  		v = voltage_max | DP_TRAIN_MAX_SWING_REACHED;
>  
> -- 
> 2.26.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx


More information about the Intel-gfx mailing list