Skip to content

Commit a133c69

Browse files
vsyrjalazehortigoza
authored andcommitted
drm/i915: WARN if max vswing/pre-emphasis violates the DP spec
According to the DP spec a DPTX must support vswing/pre-emphasis up to and including level 2. Level 3 is optional (actually DP 1.4a seems to make even level 3 mandatory for HBR2/3, while leaving it optional for RBR/HBR1). WARN if out encoders' .voltage_max()/.preemph_max() return an illegal value. Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: José Roberto de Souza <[email protected]> Signed-off-by: José Roberto de Souza <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent e398d7c commit a133c69

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/gpu/drm/i915/display/intel_dp_link_training.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ static u8 dp_voltage_max(u8 preemph)
5252
void intel_dp_get_adjust_train(struct intel_dp *intel_dp,
5353
const u8 link_status[DP_LINK_STATUS_SIZE])
5454
{
55+
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
5556
u8 v = 0;
5657
u8 p = 0;
5758
int lane;
@@ -64,12 +65,20 @@ void intel_dp_get_adjust_train(struct intel_dp *intel_dp,
6465
}
6566

6667
preemph_max = intel_dp->preemph_max(intel_dp);
68+
drm_WARN_ON_ONCE(&i915->drm,
69+
preemph_max != DP_TRAIN_PRE_EMPH_LEVEL_2 &&
70+
preemph_max != DP_TRAIN_PRE_EMPH_LEVEL_3);
71+
6772
if (p >= preemph_max)
6873
p = preemph_max | DP_TRAIN_MAX_PRE_EMPHASIS_REACHED;
6974

7075
v = min(v, dp_voltage_max(p));
7176

7277
voltage_max = intel_dp->voltage_max(intel_dp);
78+
drm_WARN_ON_ONCE(&i915->drm,
79+
voltage_max != DP_TRAIN_VOLTAGE_SWING_LEVEL_2 &&
80+
voltage_max != DP_TRAIN_VOLTAGE_SWING_LEVEL_3);
81+
7382
if (v >= voltage_max)
7483
v = voltage_max | DP_TRAIN_MAX_SWING_REACHED;
7584

0 commit comments

Comments
 (0)