drm/i915: Fix DP_TRAIN_MAX_{PRE_EMPHASIS,SWING}_REACHED handling
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 12 May 2020 17:41:44 +0000 (20:41 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 25 Jun 2020 21:37:50 +0000 (00:37 +0300)
commit3625a1f5bf6ba47fbd903be1d63dade9a48e8e72
tree941434f1dab29e7b6881bbdb8409a316dc21f70f
parent0f69403d2535ffc7200a8414cf3ca66a49b0d741
drm/i915: Fix DP_TRAIN_MAX_{PRE_EMPHASIS,SWING}_REACHED handling

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@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200512174145.3186-7-ville.syrjala@linux.intel.com
Reviewed-by: Imre Deak <imre.deak@intel.com>
drivers/gpu/drm/i915/display/intel_dp_link_training.c