diff options
author | Keith Packard <keithp@keithp.com> | 2011-11-16 19:26:07 -0500 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-11-23 16:07:12 -0500 |
commit | 1a2eb4604b85c5efb343da8a4dcf41288fcfca85 (patch) | |
tree | 4bfe2b03b118bb19314a855e0b6e2a3a62a2e8c8 /drivers/gpu | |
parent | 8d715f0024f64ad1b1be85d8c081cf577944c847 (diff) |
drm/i915: Hook up Ivybridge eDP
The Ivybridge eDP control register looks like a cross between a
Cougarpoint PCH DP control register and a Sandybridge eDP control
register.
Where things trivially match, share the code. Where there are any
tricky bits, just split things out into two obviously separate code paths.
Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Fang Xun <xunx.fang@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=41991
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 18 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 149 |
2 files changed, 133 insertions, 34 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 8990057e384c..6ef68c74189d 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -3447,6 +3447,24 @@ | |||
3447 | #define EDP_LINK_TRAIN_800_1200MV_0DB_SNB_B (0x38<<22) | 3447 | #define EDP_LINK_TRAIN_800_1200MV_0DB_SNB_B (0x38<<22) |
3448 | #define EDP_LINK_TRAIN_VOL_EMP_MASK_SNB (0x3f<<22) | 3448 | #define EDP_LINK_TRAIN_VOL_EMP_MASK_SNB (0x3f<<22) |
3449 | 3449 | ||
3450 | /* IVB */ | ||
3451 | #define EDP_LINK_TRAIN_400MV_0DB_IVB (0x24 <<22) | ||
3452 | #define EDP_LINK_TRAIN_400MV_3_5DB_IVB (0x2a <<22) | ||
3453 | #define EDP_LINK_TRAIN_400MV_6DB_IVB (0x2f <<22) | ||
3454 | #define EDP_LINK_TRAIN_600MV_0DB_IVB (0x30 <<22) | ||
3455 | #define EDP_LINK_TRAIN_600MV_3_5DB_IVB (0x36 <<22) | ||
3456 | #define EDP_LINK_TRAIN_800MV_0DB_IVB (0x38 <<22) | ||
3457 | #define EDP_LINK_TRAIN_800MV_3_5DB_IVB (0x33 <<22) | ||
3458 | |||
3459 | /* legacy values */ | ||
3460 | #define EDP_LINK_TRAIN_500MV_0DB_IVB (0x00 <<22) | ||
3461 | #define EDP_LINK_TRAIN_1000MV_0DB_IVB (0x20 <<22) | ||
3462 | #define EDP_LINK_TRAIN_500MV_3_5DB_IVB (0x02 <<22) | ||
3463 | #define EDP_LINK_TRAIN_1000MV_3_5DB_IVB (0x22 <<22) | ||
3464 | #define EDP_LINK_TRAIN_1000MV_6DB_IVB (0x23 <<22) | ||
3465 | |||
3466 | #define EDP_LINK_TRAIN_VOL_EMP_MASK_IVB (0x3f<<22) | ||
3467 | |||
3450 | #define FORCEWAKE 0xA18C | 3468 | #define FORCEWAKE 0xA18C |
3451 | #define FORCEWAKE_ACK 0x130090 | 3469 | #define FORCEWAKE_ACK 0x130090 |
3452 | #define FORCEWAKE_MT 0xa188 /* multi-threaded */ | 3470 | #define FORCEWAKE_MT 0xa188 /* multi-threaded */ |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 4d0358fad937..294f55788f0b 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -362,8 +362,8 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, | |||
362 | * clock divider. | 362 | * clock divider. |
363 | */ | 363 | */ |
364 | if (is_cpu_edp(intel_dp)) { | 364 | if (is_cpu_edp(intel_dp)) { |
365 | if (IS_GEN6(dev)) | 365 | if (IS_GEN6(dev) || IS_GEN7(dev)) |
366 | aux_clock_divider = 200; /* SNB eDP input clock at 400Mhz */ | 366 | aux_clock_divider = 200; /* SNB & IVB eDP input clock at 400Mhz */ |
367 | else | 367 | else |
368 | aux_clock_divider = 225; /* eDP input clock at 450Mhz */ | 368 | aux_clock_divider = 225; /* eDP input clock at 450Mhz */ |
369 | } else if (HAS_PCH_SPLIT(dev)) | 369 | } else if (HAS_PCH_SPLIT(dev)) |
@@ -817,10 +817,11 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
817 | } | 817 | } |
818 | 818 | ||
819 | /* | 819 | /* |
820 | * There are three kinds of DP registers: | 820 | * There are four kinds of DP registers: |
821 | * | 821 | * |
822 | * IBX PCH | 822 | * IBX PCH |
823 | * CPU | 823 | * SNB CPU |
824 | * IVB CPU | ||
824 | * CPT PCH | 825 | * CPT PCH |
825 | * | 826 | * |
826 | * IBX PCH and CPU are the same for almost everything, | 827 | * IBX PCH and CPU are the same for almost everything, |
@@ -873,7 +874,25 @@ intel_dp_mode_set(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
873 | 874 | ||
874 | /* Split out the IBX/CPU vs CPT settings */ | 875 | /* Split out the IBX/CPU vs CPT settings */ |
875 | 876 | ||
876 | if (!HAS_PCH_CPT(dev) || is_cpu_edp(intel_dp)) { | 877 | if (is_cpu_edp(intel_dp) && IS_GEN7(dev)) { |
878 | if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) | ||
879 | intel_dp->DP |= DP_SYNC_HS_HIGH; | ||
880 | if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) | ||
881 | intel_dp->DP |= DP_SYNC_VS_HIGH; | ||
882 | intel_dp->DP |= DP_LINK_TRAIN_OFF_CPT; | ||
883 | |||
884 | if (intel_dp->link_configuration[1] & DP_LANE_COUNT_ENHANCED_FRAME_EN) | ||
885 | intel_dp->DP |= DP_ENHANCED_FRAMING; | ||
886 | |||
887 | intel_dp->DP |= intel_crtc->pipe << 29; | ||
888 | |||
889 | /* don't miss out required setting for eDP */ | ||
890 | intel_dp->DP |= DP_PLL_ENABLE; | ||
891 | if (adjusted_mode->clock < 200000) | ||
892 | intel_dp->DP |= DP_PLL_FREQ_160MHZ; | ||
893 | else | ||
894 | intel_dp->DP |= DP_PLL_FREQ_270MHZ; | ||
895 | } else if (!HAS_PCH_CPT(dev) || is_cpu_edp(intel_dp)) { | ||
877 | intel_dp->DP |= intel_dp->color_range; | 896 | intel_dp->DP |= intel_dp->color_range; |
878 | 897 | ||
879 | if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) | 898 | if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) |
@@ -1375,34 +1394,59 @@ static char *link_train_names[] = { | |||
1375 | * These are source-specific values; current Intel hardware supports | 1394 | * These are source-specific values; current Intel hardware supports |
1376 | * a maximum voltage of 800mV and a maximum pre-emphasis of 6dB | 1395 | * a maximum voltage of 800mV and a maximum pre-emphasis of 6dB |
1377 | */ | 1396 | */ |
1378 | #define I830_DP_VOLTAGE_MAX DP_TRAIN_VOLTAGE_SWING_800 | ||
1379 | #define I830_DP_VOLTAGE_MAX_CPT DP_TRAIN_VOLTAGE_SWING_1200 | ||
1380 | 1397 | ||
1381 | static uint8_t | 1398 | static uint8_t |
1382 | intel_dp_pre_emphasis_max(uint8_t voltage_swing) | 1399 | intel_dp_voltage_max(struct intel_dp *intel_dp) |
1383 | { | 1400 | { |
1384 | switch (voltage_swing & DP_TRAIN_VOLTAGE_SWING_MASK) { | 1401 | struct drm_device *dev = intel_dp->base.base.dev; |
1385 | case DP_TRAIN_VOLTAGE_SWING_400: | 1402 | |
1386 | return DP_TRAIN_PRE_EMPHASIS_6; | 1403 | if (IS_GEN7(dev) && is_cpu_edp(intel_dp)) |
1387 | case DP_TRAIN_VOLTAGE_SWING_600: | 1404 | return DP_TRAIN_VOLTAGE_SWING_800; |
1388 | return DP_TRAIN_PRE_EMPHASIS_6; | 1405 | else if (HAS_PCH_CPT(dev) && !is_cpu_edp(intel_dp)) |
1389 | case DP_TRAIN_VOLTAGE_SWING_800: | 1406 | return DP_TRAIN_VOLTAGE_SWING_1200; |
1390 | return DP_TRAIN_PRE_EMPHASIS_3_5; | 1407 | else |
1391 | case DP_TRAIN_VOLTAGE_SWING_1200: | 1408 | return DP_TRAIN_VOLTAGE_SWING_800; |
1392 | default: | 1409 | } |
1393 | return DP_TRAIN_PRE_EMPHASIS_0; | 1410 | |
1411 | static uint8_t | ||
1412 | intel_dp_pre_emphasis_max(struct intel_dp *intel_dp, uint8_t voltage_swing) | ||
1413 | { | ||
1414 | struct drm_device *dev = intel_dp->base.base.dev; | ||
1415 | |||
1416 | if (IS_GEN7(dev) && is_cpu_edp(intel_dp)) { | ||
1417 | switch (voltage_swing & DP_TRAIN_VOLTAGE_SWING_MASK) { | ||
1418 | case DP_TRAIN_VOLTAGE_SWING_400: | ||
1419 | return DP_TRAIN_PRE_EMPHASIS_6; | ||
1420 | case DP_TRAIN_VOLTAGE_SWING_600: | ||
1421 | case DP_TRAIN_VOLTAGE_SWING_800: | ||
1422 | return DP_TRAIN_PRE_EMPHASIS_3_5; | ||
1423 | default: | ||
1424 | return DP_TRAIN_PRE_EMPHASIS_0; | ||
1425 | } | ||
1426 | } else { | ||
1427 | switch (voltage_swing & DP_TRAIN_VOLTAGE_SWING_MASK) { | ||
1428 | case DP_TRAIN_VOLTAGE_SWING_400: | ||
1429 | return DP_TRAIN_PRE_EMPHASIS_6; | ||
1430 | case DP_TRAIN_VOLTAGE_SWING_600: | ||
1431 | return DP_TRAIN_PRE_EMPHASIS_6; | ||
1432 | case DP_TRAIN_VOLTAGE_SWING_800: | ||
1433 | return DP_TRAIN_PRE_EMPHASIS_3_5; | ||
1434 | case DP_TRAIN_VOLTAGE_SWING_1200: | ||
1435 | default: | ||
1436 | return DP_TRAIN_PRE_EMPHASIS_0; | ||
1437 | } | ||
1394 | } | 1438 | } |
1395 | } | 1439 | } |
1396 | 1440 | ||
1397 | static void | 1441 | static void |
1398 | intel_get_adjust_train(struct intel_dp *intel_dp, uint8_t link_status[DP_LINK_STATUS_SIZE]) | 1442 | intel_get_adjust_train(struct intel_dp *intel_dp, uint8_t link_status[DP_LINK_STATUS_SIZE]) |
1399 | { | 1443 | { |
1400 | struct drm_device *dev = intel_dp->base.base.dev; | ||
1401 | uint8_t v = 0; | 1444 | uint8_t v = 0; |
1402 | uint8_t p = 0; | 1445 | uint8_t p = 0; |
1403 | int lane; | 1446 | int lane; |
1404 | uint8_t *adjust_request = link_status + (DP_ADJUST_REQUEST_LANE0_1 - DP_LANE0_1_STATUS); | 1447 | uint8_t *adjust_request = link_status + (DP_ADJUST_REQUEST_LANE0_1 - DP_LANE0_1_STATUS); |
1405 | int voltage_max; | 1448 | uint8_t voltage_max; |
1449 | uint8_t preemph_max; | ||
1406 | 1450 | ||
1407 | for (lane = 0; lane < intel_dp->lane_count; lane++) { | 1451 | for (lane = 0; lane < intel_dp->lane_count; lane++) { |
1408 | uint8_t this_v = intel_get_adjust_request_voltage(adjust_request, lane); | 1452 | uint8_t this_v = intel_get_adjust_request_voltage(adjust_request, lane); |
@@ -1414,15 +1458,13 @@ intel_get_adjust_train(struct intel_dp *intel_dp, uint8_t link_status[DP_LINK_ST | |||
1414 | p = this_p; | 1458 | p = this_p; |
1415 | } | 1459 | } |
1416 | 1460 | ||
1417 | if (HAS_PCH_CPT(dev) && !is_cpu_edp(intel_dp)) | 1461 | voltage_max = intel_dp_voltage_max(intel_dp); |
1418 | voltage_max = I830_DP_VOLTAGE_MAX_CPT; | ||
1419 | else | ||
1420 | voltage_max = I830_DP_VOLTAGE_MAX; | ||
1421 | if (v >= voltage_max) | 1462 | if (v >= voltage_max) |
1422 | v = voltage_max | DP_TRAIN_MAX_SWING_REACHED; | 1463 | v = voltage_max | DP_TRAIN_MAX_SWING_REACHED; |
1423 | 1464 | ||
1424 | if (p >= intel_dp_pre_emphasis_max(v)) | 1465 | preemph_max = intel_dp_pre_emphasis_max(intel_dp, v); |
1425 | p = intel_dp_pre_emphasis_max(v) | DP_TRAIN_MAX_PRE_EMPHASIS_REACHED; | 1466 | if (p >= preemph_max) |
1467 | p = preemph_max | DP_TRAIN_MAX_PRE_EMPHASIS_REACHED; | ||
1426 | 1468 | ||
1427 | for (lane = 0; lane < 4; lane++) | 1469 | for (lane = 0; lane < 4; lane++) |
1428 | intel_dp->train_set[lane] = v | p; | 1470 | intel_dp->train_set[lane] = v | p; |
@@ -1494,6 +1536,37 @@ intel_gen6_edp_signal_levels(uint8_t train_set) | |||
1494 | } | 1536 | } |
1495 | } | 1537 | } |
1496 | 1538 | ||
1539 | /* Gen7's DP voltage swing and pre-emphasis control */ | ||
1540 | static uint32_t | ||
1541 | intel_gen7_edp_signal_levels(uint8_t train_set) | ||
1542 | { | ||
1543 | int signal_levels = train_set & (DP_TRAIN_VOLTAGE_SWING_MASK | | ||
1544 | DP_TRAIN_PRE_EMPHASIS_MASK); | ||
1545 | switch (signal_levels) { | ||
1546 | case DP_TRAIN_VOLTAGE_SWING_400 | DP_TRAIN_PRE_EMPHASIS_0: | ||
1547 | return EDP_LINK_TRAIN_400MV_0DB_IVB; | ||
1548 | case DP_TRAIN_VOLTAGE_SWING_400 | DP_TRAIN_PRE_EMPHASIS_3_5: | ||
1549 | return EDP_LINK_TRAIN_400MV_3_5DB_IVB; | ||
1550 | case DP_TRAIN_VOLTAGE_SWING_400 | DP_TRAIN_PRE_EMPHASIS_6: | ||
1551 | return EDP_LINK_TRAIN_400MV_6DB_IVB; | ||
1552 | |||
1553 | case DP_TRAIN_VOLTAGE_SWING_600 | DP_TRAIN_PRE_EMPHASIS_0: | ||
1554 | return EDP_LINK_TRAIN_600MV_0DB_IVB; | ||
1555 | case DP_TRAIN_VOLTAGE_SWING_600 | DP_TRAIN_PRE_EMPHASIS_3_5: | ||
1556 | return EDP_LINK_TRAIN_600MV_3_5DB_IVB; | ||
1557 | |||
1558 | case DP_TRAIN_VOLTAGE_SWING_800 | DP_TRAIN_PRE_EMPHASIS_0: | ||
1559 | return EDP_LINK_TRAIN_800MV_0DB_IVB; | ||
1560 | case DP_TRAIN_VOLTAGE_SWING_800 | DP_TRAIN_PRE_EMPHASIS_3_5: | ||
1561 | return EDP_LINK_TRAIN_800MV_3_5DB_IVB; | ||
1562 | |||
1563 | default: | ||
1564 | DRM_DEBUG_KMS("Unsupported voltage swing/pre-emphasis level:" | ||
1565 | "0x%x\n", signal_levels); | ||
1566 | return EDP_LINK_TRAIN_500MV_0DB_IVB; | ||
1567 | } | ||
1568 | } | ||
1569 | |||
1497 | static uint8_t | 1570 | static uint8_t |
1498 | intel_get_lane_status(uint8_t link_status[DP_LINK_STATUS_SIZE], | 1571 | intel_get_lane_status(uint8_t link_status[DP_LINK_STATUS_SIZE], |
1499 | int lane) | 1572 | int lane) |
@@ -1599,7 +1672,8 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) | |||
1599 | DP_LINK_CONFIGURATION_SIZE); | 1672 | DP_LINK_CONFIGURATION_SIZE); |
1600 | 1673 | ||
1601 | DP |= DP_PORT_EN; | 1674 | DP |= DP_PORT_EN; |
1602 | if (HAS_PCH_CPT(dev) && !is_cpu_edp(intel_dp)) | 1675 | |
1676 | if (HAS_PCH_CPT(dev) && (IS_GEN7(dev) || !is_cpu_edp(intel_dp))) | ||
1603 | DP &= ~DP_LINK_TRAIN_MASK_CPT; | 1677 | DP &= ~DP_LINK_TRAIN_MASK_CPT; |
1604 | else | 1678 | else |
1605 | DP &= ~DP_LINK_TRAIN_MASK; | 1679 | DP &= ~DP_LINK_TRAIN_MASK; |
@@ -1613,7 +1687,11 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) | |||
1613 | uint8_t link_status[DP_LINK_STATUS_SIZE]; | 1687 | uint8_t link_status[DP_LINK_STATUS_SIZE]; |
1614 | uint32_t signal_levels; | 1688 | uint32_t signal_levels; |
1615 | 1689 | ||
1616 | if (IS_GEN6(dev) && is_cpu_edp(intel_dp)) { | 1690 | |
1691 | if (IS_GEN7(dev) && is_cpu_edp(intel_dp)) { | ||
1692 | signal_levels = intel_gen7_edp_signal_levels(intel_dp->train_set[0]); | ||
1693 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_IVB) | signal_levels; | ||
1694 | } else if (IS_GEN6(dev) && is_cpu_edp(intel_dp)) { | ||
1617 | signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); | 1695 | signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); |
1618 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; | 1696 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; |
1619 | } else { | 1697 | } else { |
@@ -1622,7 +1700,7 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) | |||
1622 | DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; | 1700 | DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; |
1623 | } | 1701 | } |
1624 | 1702 | ||
1625 | if (HAS_PCH_CPT(dev) && !is_cpu_edp(intel_dp)) | 1703 | if (HAS_PCH_CPT(dev) && (IS_GEN7(dev) || !is_cpu_edp(intel_dp))) |
1626 | reg = DP | DP_LINK_TRAIN_PAT_1_CPT; | 1704 | reg = DP | DP_LINK_TRAIN_PAT_1_CPT; |
1627 | else | 1705 | else |
1628 | reg = DP | DP_LINK_TRAIN_PAT_1; | 1706 | reg = DP | DP_LINK_TRAIN_PAT_1; |
@@ -1703,7 +1781,10 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) | |||
1703 | break; | 1781 | break; |
1704 | } | 1782 | } |
1705 | 1783 | ||
1706 | if (IS_GEN6(dev) && is_cpu_edp(intel_dp)) { | 1784 | if (IS_GEN7(dev) && is_cpu_edp(intel_dp)) { |
1785 | signal_levels = intel_gen7_edp_signal_levels(intel_dp->train_set[0]); | ||
1786 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_IVB) | signal_levels; | ||
1787 | } else if (IS_GEN6(dev) && is_cpu_edp(intel_dp)) { | ||
1707 | signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); | 1788 | signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); |
1708 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; | 1789 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; |
1709 | } else { | 1790 | } else { |
@@ -1711,7 +1792,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) | |||
1711 | DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; | 1792 | DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; |
1712 | } | 1793 | } |
1713 | 1794 | ||
1714 | if (HAS_PCH_CPT(dev) && !is_cpu_edp(intel_dp)) | 1795 | if (HAS_PCH_CPT(dev) && (IS_GEN7(dev) || !is_cpu_edp(intel_dp))) |
1715 | reg = DP | DP_LINK_TRAIN_PAT_2_CPT; | 1796 | reg = DP | DP_LINK_TRAIN_PAT_2_CPT; |
1716 | else | 1797 | else |
1717 | reg = DP | DP_LINK_TRAIN_PAT_2; | 1798 | reg = DP | DP_LINK_TRAIN_PAT_2; |
@@ -1752,7 +1833,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) | |||
1752 | ++tries; | 1833 | ++tries; |
1753 | } | 1834 | } |
1754 | 1835 | ||
1755 | if (HAS_PCH_CPT(dev) && !is_cpu_edp(intel_dp)) | 1836 | if (HAS_PCH_CPT(dev) && (IS_GEN7(dev) || !is_cpu_edp(intel_dp))) |
1756 | reg = DP | DP_LINK_TRAIN_OFF_CPT; | 1837 | reg = DP | DP_LINK_TRAIN_OFF_CPT; |
1757 | else | 1838 | else |
1758 | reg = DP | DP_LINK_TRAIN_OFF; | 1839 | reg = DP | DP_LINK_TRAIN_OFF; |
@@ -1782,7 +1863,7 @@ intel_dp_link_down(struct intel_dp *intel_dp) | |||
1782 | udelay(100); | 1863 | udelay(100); |
1783 | } | 1864 | } |
1784 | 1865 | ||
1785 | if (HAS_PCH_CPT(dev) && !is_cpu_edp(intel_dp)) { | 1866 | if (HAS_PCH_CPT(dev) && (IS_GEN7(dev) || !is_cpu_edp(intel_dp))) { |
1786 | DP &= ~DP_LINK_TRAIN_MASK_CPT; | 1867 | DP &= ~DP_LINK_TRAIN_MASK_CPT; |
1787 | I915_WRITE(intel_dp->output_reg, DP | DP_LINK_TRAIN_PAT_IDLE_CPT); | 1868 | I915_WRITE(intel_dp->output_reg, DP | DP_LINK_TRAIN_PAT_IDLE_CPT); |
1788 | } else { | 1869 | } else { |
@@ -1794,7 +1875,7 @@ intel_dp_link_down(struct intel_dp *intel_dp) | |||
1794 | msleep(17); | 1875 | msleep(17); |
1795 | 1876 | ||
1796 | if (is_edp(intel_dp)) { | 1877 | if (is_edp(intel_dp)) { |
1797 | if (HAS_PCH_CPT(dev) && !is_cpu_edp(intel_dp)) | 1878 | if (HAS_PCH_CPT(dev) && (IS_GEN7(dev) || !is_cpu_edp(intel_dp))) |
1798 | DP |= DP_LINK_TRAIN_OFF_CPT; | 1879 | DP |= DP_LINK_TRAIN_OFF_CPT; |
1799 | else | 1880 | else |
1800 | DP |= DP_LINK_TRAIN_OFF; | 1881 | DP |= DP_LINK_TRAIN_OFF; |