diff options
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 11 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 49 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_hdmi.c | 28 |
3 files changed, 59 insertions, 29 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index eba35bcca2ac..8bcc5e2313f5 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -807,6 +807,17 @@ enum punit_power_well { | |||
807 | #define _TXLANE(ch, lane, offset) ((ch ? 0x2400 : 0) + \ | 807 | #define _TXLANE(ch, lane, offset) ((ch ? 0x2400 : 0) + \ |
808 | (lane) * 0x200 + (offset)) | 808 | (lane) * 0x200 + (offset)) |
809 | 809 | ||
810 | #define CHV_TX_DW0(ch, lane) _TXLANE(ch, lane, 0x80) | ||
811 | #define CHV_TX_DW1(ch, lane) _TXLANE(ch, lane, 0x84) | ||
812 | #define CHV_TX_DW2(ch, lane) _TXLANE(ch, lane, 0x88) | ||
813 | #define CHV_TX_DW3(ch, lane) _TXLANE(ch, lane, 0x8c) | ||
814 | #define CHV_TX_DW4(ch, lane) _TXLANE(ch, lane, 0x90) | ||
815 | #define CHV_TX_DW5(ch, lane) _TXLANE(ch, lane, 0x94) | ||
816 | #define CHV_TX_DW6(ch, lane) _TXLANE(ch, lane, 0x98) | ||
817 | #define CHV_TX_DW7(ch, lane) _TXLANE(ch, lane, 0x9c) | ||
818 | #define CHV_TX_DW8(ch, lane) _TXLANE(ch, lane, 0xa0) | ||
819 | #define CHV_TX_DW9(ch, lane) _TXLANE(ch, lane, 0xa4) | ||
820 | #define CHV_TX_DW10(ch, lane) _TXLANE(ch, lane, 0xa8) | ||
810 | #define CHV_TX_DW11(ch, lane) _TXLANE(ch, lane, 0xac) | 821 | #define CHV_TX_DW11(ch, lane) _TXLANE(ch, lane, 0xac) |
811 | #define DPIO_FRC_LATENCY_SHFIT 8 | 822 | #define DPIO_FRC_LATENCY_SHFIT 8 |
812 | #define CHV_TX_DW14(ch, lane) _TXLANE(ch, lane, 0xb8) | 823 | #define CHV_TX_DW14(ch, lane) _TXLANE(ch, lane, 0xb8) |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index d98de3c18621..f36904c14666 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -2311,10 +2311,11 @@ static uint32_t intel_chv_signal_levels(struct intel_dp *intel_dp) | |||
2311 | struct drm_i915_private *dev_priv = dev->dev_private; | 2311 | struct drm_i915_private *dev_priv = dev->dev_private; |
2312 | struct intel_digital_port *dport = dp_to_dig_port(intel_dp); | 2312 | struct intel_digital_port *dport = dp_to_dig_port(intel_dp); |
2313 | struct intel_crtc *intel_crtc = to_intel_crtc(dport->base.base.crtc); | 2313 | struct intel_crtc *intel_crtc = to_intel_crtc(dport->base.base.crtc); |
2314 | u32 deemph_reg_value, margin_reg_value, val, tx_dw2; | 2314 | u32 deemph_reg_value, margin_reg_value, val; |
2315 | uint8_t train_set = intel_dp->train_set[0]; | 2315 | uint8_t train_set = intel_dp->train_set[0]; |
2316 | enum dpio_channel ch = vlv_dport_to_channel(dport); | 2316 | enum dpio_channel ch = vlv_dport_to_channel(dport); |
2317 | int pipe = intel_crtc->pipe; | 2317 | enum pipe pipe = intel_crtc->pipe; |
2318 | int i; | ||
2318 | 2319 | ||
2319 | switch (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) { | 2320 | switch (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) { |
2320 | case DP_TRAIN_PRE_EMPHASIS_0: | 2321 | case DP_TRAIN_PRE_EMPHASIS_0: |
@@ -2392,21 +2393,27 @@ static uint32_t intel_chv_signal_levels(struct intel_dp *intel_dp) | |||
2392 | vlv_dpio_write(dev_priv, pipe, CHV_PCS_DW10(ch), 0); | 2393 | vlv_dpio_write(dev_priv, pipe, CHV_PCS_DW10(ch), 0); |
2393 | 2394 | ||
2394 | /* Program swing deemph */ | 2395 | /* Program swing deemph */ |
2395 | val = vlv_dpio_read(dev_priv, pipe, VLV_TX_DW4(ch)); | 2396 | for (i = 0; i < 4; i++) { |
2396 | val &= ~DPIO_SWING_DEEMPH9P5_MASK; | 2397 | val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW4(ch, i)); |
2397 | val |= deemph_reg_value << DPIO_SWING_DEEMPH9P5_SHIFT; | 2398 | val &= ~DPIO_SWING_DEEMPH9P5_MASK; |
2398 | vlv_dpio_write(dev_priv, pipe, VLV_TX_DW4(ch), val); | 2399 | val |= deemph_reg_value << DPIO_SWING_DEEMPH9P5_SHIFT; |
2400 | vlv_dpio_write(dev_priv, pipe, CHV_TX_DW4(ch, i), val); | ||
2401 | } | ||
2399 | 2402 | ||
2400 | /* Program swing margin */ | 2403 | /* Program swing margin */ |
2401 | tx_dw2 = vlv_dpio_read(dev_priv, pipe, VLV_TX_DW2(ch)); | 2404 | for (i = 0; i < 4; i++) { |
2402 | tx_dw2 &= ~DPIO_SWING_MARGIN_MASK; | 2405 | val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW2(ch, i)); |
2403 | tx_dw2 |= margin_reg_value << DPIO_SWING_MARGIN_SHIFT; | 2406 | val &= ~DPIO_SWING_MARGIN_MASK; |
2404 | vlv_dpio_write(dev_priv, pipe, VLV_TX_DW2(ch), tx_dw2); | 2407 | val |= margin_reg_value << DPIO_SWING_MARGIN_SHIFT; |
2408 | vlv_dpio_write(dev_priv, pipe, CHV_TX_DW2(ch, i), val); | ||
2409 | } | ||
2405 | 2410 | ||
2406 | /* Disable unique transition scale */ | 2411 | /* Disable unique transition scale */ |
2407 | val = vlv_dpio_read(dev_priv, pipe, VLV_TX_DW3(ch)); | 2412 | for (i = 0; i < 4; i++) { |
2408 | val &= ~DPIO_TX_UNIQ_TRANS_SCALE_EN; | 2413 | val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW3(ch, i)); |
2409 | vlv_dpio_write(dev_priv, pipe, VLV_TX_DW3(ch), val); | 2414 | val &= ~DPIO_TX_UNIQ_TRANS_SCALE_EN; |
2415 | vlv_dpio_write(dev_priv, pipe, CHV_TX_DW3(ch, i), val); | ||
2416 | } | ||
2410 | 2417 | ||
2411 | if (((train_set & DP_TRAIN_PRE_EMPHASIS_MASK) | 2418 | if (((train_set & DP_TRAIN_PRE_EMPHASIS_MASK) |
2412 | == DP_TRAIN_PRE_EMPHASIS_0) && | 2419 | == DP_TRAIN_PRE_EMPHASIS_0) && |
@@ -2419,12 +2426,18 @@ static uint32_t intel_chv_signal_levels(struct intel_dp *intel_dp) | |||
2419 | * For now, for this unique transition scale selection, set bit | 2426 | * For now, for this unique transition scale selection, set bit |
2420 | * 27 for ch0 and ch1. | 2427 | * 27 for ch0 and ch1. |
2421 | */ | 2428 | */ |
2422 | val = vlv_dpio_read(dev_priv, pipe, VLV_TX_DW3(ch)); | 2429 | for (i = 0; i < 4; i++) { |
2423 | val |= DPIO_TX_UNIQ_TRANS_SCALE_EN; | 2430 | val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW3(ch, i)); |
2424 | vlv_dpio_write(dev_priv, pipe, VLV_TX_DW3(ch), val); | 2431 | val |= DPIO_TX_UNIQ_TRANS_SCALE_EN; |
2432 | vlv_dpio_write(dev_priv, pipe, CHV_TX_DW3(ch, i), val); | ||
2433 | } | ||
2425 | 2434 | ||
2426 | tx_dw2 |= (0x9a << DPIO_UNIQ_TRANS_SCALE_SHIFT); | 2435 | for (i = 0; i < 4; i++) { |
2427 | vlv_dpio_write(dev_priv, pipe, VLV_TX_DW2(ch), tx_dw2); | 2436 | val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW2(ch, i)); |
2437 | val &= ~(0xff << DPIO_UNIQ_TRANS_SCALE_SHIFT); | ||
2438 | val |= (0x9a << DPIO_UNIQ_TRANS_SCALE_SHIFT); | ||
2439 | vlv_dpio_write(dev_priv, pipe, CHV_TX_DW2(ch, i), val); | ||
2440 | } | ||
2428 | } | 2441 | } |
2429 | 2442 | ||
2430 | /* Start swing calculation */ | 2443 | /* Start swing calculation */ |
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index b976255f7961..9d9b019953fb 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
@@ -1330,20 +1330,26 @@ static void chv_hdmi_pre_enable(struct intel_encoder *encoder) | |||
1330 | 1330 | ||
1331 | /* FIXME: Program the support xxx V-dB */ | 1331 | /* FIXME: Program the support xxx V-dB */ |
1332 | /* Use 800mV-0dB */ | 1332 | /* Use 800mV-0dB */ |
1333 | val = vlv_dpio_read(dev_priv, pipe, VLV_TX_DW4(ch)); | 1333 | for (i = 0; i < 4; i++) { |
1334 | val &= ~DPIO_SWING_DEEMPH9P5_MASK; | 1334 | val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW4(ch, i)); |
1335 | val |= 128 << DPIO_SWING_DEEMPH9P5_SHIFT; | 1335 | val &= ~DPIO_SWING_DEEMPH9P5_MASK; |
1336 | vlv_dpio_write(dev_priv, pipe, VLV_TX_DW4(ch), val); | 1336 | val |= 128 << DPIO_SWING_DEEMPH9P5_SHIFT; |
1337 | vlv_dpio_write(dev_priv, pipe, CHV_TX_DW4(ch, i), val); | ||
1338 | } | ||
1337 | 1339 | ||
1338 | val = vlv_dpio_read(dev_priv, pipe, VLV_TX_DW2(ch)); | 1340 | for (i = 0; i < 4; i++) { |
1339 | val &= ~DPIO_SWING_MARGIN_MASK; | 1341 | val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW2(ch, i)); |
1340 | val |= 102 << DPIO_SWING_MARGIN_SHIFT; | 1342 | val &= ~DPIO_SWING_MARGIN_MASK; |
1341 | vlv_dpio_write(dev_priv, pipe, VLV_TX_DW2(ch), val); | 1343 | val |= 102 << DPIO_SWING_MARGIN_SHIFT; |
1344 | vlv_dpio_write(dev_priv, pipe, CHV_TX_DW2(ch, i), val); | ||
1345 | } | ||
1342 | 1346 | ||
1343 | /* Disable unique transition scale */ | 1347 | /* Disable unique transition scale */ |
1344 | val = vlv_dpio_read(dev_priv, pipe, VLV_TX_DW3(ch)); | 1348 | for (i = 0; i < 4; i++) { |
1345 | val &= ~DPIO_TX_UNIQ_TRANS_SCALE_EN; | 1349 | val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW3(ch, i)); |
1346 | vlv_dpio_write(dev_priv, pipe, VLV_TX_DW3(ch), val); | 1350 | val &= ~DPIO_TX_UNIQ_TRANS_SCALE_EN; |
1351 | vlv_dpio_write(dev_priv, pipe, CHV_TX_DW3(ch, i), val); | ||
1352 | } | ||
1347 | 1353 | ||
1348 | /* Additional steps for 1200mV-0dB */ | 1354 | /* Additional steps for 1200mV-0dB */ |
1349 | #if 0 | 1355 | #if 0 |