diff options
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 82 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 55 |
4 files changed, 98 insertions, 51 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 7ef3e8b6864d..02f96fd0d52d 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -313,10 +313,10 @@ static void i915_hotplug_work_func(struct work_struct *work) | |||
313 | if (encoder->hot_plug) | 313 | if (encoder->hot_plug) |
314 | encoder->hot_plug(encoder); | 314 | encoder->hot_plug(encoder); |
315 | 315 | ||
316 | mutex_unlock(&mode_config->mutex); | ||
317 | |||
316 | /* Just fire off a uevent and let userspace tell us what to do */ | 318 | /* Just fire off a uevent and let userspace tell us what to do */ |
317 | drm_helper_hpd_irq_event(dev); | 319 | drm_helper_hpd_irq_event(dev); |
318 | |||
319 | mutex_unlock(&mode_config->mutex); | ||
320 | } | 320 | } |
321 | 321 | ||
322 | static void i915_handle_rps_change(struct drm_device *dev) | 322 | static void i915_handle_rps_change(struct drm_device *dev) |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 02db299f621a..a900809baf2a 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -2084,9 +2084,6 @@ | |||
2084 | #define DP_PIPEB_SELECT (1 << 30) | 2084 | #define DP_PIPEB_SELECT (1 << 30) |
2085 | #define DP_PIPE_MASK (1 << 30) | 2085 | #define DP_PIPE_MASK (1 << 30) |
2086 | 2086 | ||
2087 | #define DP_PIPE_ENABLED(V, P) \ | ||
2088 | (((V) & (DP_PIPE_MASK | DP_PORT_EN)) == ((P) << 30 | DP_PORT_EN)) | ||
2089 | |||
2090 | /* Link training mode - select a suitable mode for each stage */ | 2087 | /* Link training mode - select a suitable mode for each stage */ |
2091 | #define DP_LINK_TRAIN_PAT_1 (0 << 28) | 2088 | #define DP_LINK_TRAIN_PAT_1 (0 << 28) |
2092 | #define DP_LINK_TRAIN_PAT_2 (1 << 28) | 2089 | #define DP_LINK_TRAIN_PAT_2 (1 << 28) |
@@ -3076,6 +3073,11 @@ | |||
3076 | #define TRANS_6BPC (2<<5) | 3073 | #define TRANS_6BPC (2<<5) |
3077 | #define TRANS_12BPC (3<<5) | 3074 | #define TRANS_12BPC (3<<5) |
3078 | 3075 | ||
3076 | #define _TRANSA_CHICKEN2 0xf0064 | ||
3077 | #define _TRANSB_CHICKEN2 0xf1064 | ||
3078 | #define TRANS_CHICKEN2(pipe) _PIPE(pipe, _TRANSA_CHICKEN2, _TRANSB_CHICKEN2) | ||
3079 | #define TRANS_AUTOTRAIN_GEN_STALL_DIS (1<<31) | ||
3080 | |||
3079 | #define SOUTH_CHICKEN2 0xc2004 | 3081 | #define SOUTH_CHICKEN2 0xc2004 |
3080 | #define DPLS_EDP_PPS_FIX_DIS (1<<0) | 3082 | #define DPLS_EDP_PPS_FIX_DIS (1<<0) |
3081 | 3083 | ||
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 97d28013db79..ce908ec02900 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -980,11 +980,29 @@ static void assert_transcoder_disabled(struct drm_i915_private *dev_priv, | |||
980 | pipe_name(pipe)); | 980 | pipe_name(pipe)); |
981 | } | 981 | } |
982 | 982 | ||
983 | static bool dp_pipe_enabled(struct drm_i915_private *dev_priv, enum pipe pipe, | ||
984 | int reg, u32 port_sel, u32 val) | ||
985 | { | ||
986 | if ((val & DP_PORT_EN) == 0) | ||
987 | return false; | ||
988 | |||
989 | if (HAS_PCH_CPT(dev_priv->dev)) { | ||
990 | u32 trans_dp_ctl_reg = TRANS_DP_CTL(pipe); | ||
991 | u32 trans_dp_ctl = I915_READ(trans_dp_ctl_reg); | ||
992 | if ((trans_dp_ctl & TRANS_DP_PORT_SEL_MASK) != port_sel) | ||
993 | return false; | ||
994 | } else { | ||
995 | if ((val & DP_PIPE_MASK) != (pipe << 30)) | ||
996 | return false; | ||
997 | } | ||
998 | return true; | ||
999 | } | ||
1000 | |||
983 | static void assert_pch_dp_disabled(struct drm_i915_private *dev_priv, | 1001 | static void assert_pch_dp_disabled(struct drm_i915_private *dev_priv, |
984 | enum pipe pipe, int reg) | 1002 | enum pipe pipe, int reg, u32 port_sel) |
985 | { | 1003 | { |
986 | u32 val = I915_READ(reg); | 1004 | u32 val = I915_READ(reg); |
987 | WARN(DP_PIPE_ENABLED(val, pipe), | 1005 | WARN(dp_pipe_enabled(dev_priv, pipe, reg, port_sel, val), |
988 | "PCH DP (0x%08x) enabled on transcoder %c, should be disabled\n", | 1006 | "PCH DP (0x%08x) enabled on transcoder %c, should be disabled\n", |
989 | reg, pipe_name(pipe)); | 1007 | reg, pipe_name(pipe)); |
990 | } | 1008 | } |
@@ -1004,9 +1022,9 @@ static void assert_pch_ports_disabled(struct drm_i915_private *dev_priv, | |||
1004 | int reg; | 1022 | int reg; |
1005 | u32 val; | 1023 | u32 val; |
1006 | 1024 | ||
1007 | assert_pch_dp_disabled(dev_priv, pipe, PCH_DP_B); | 1025 | assert_pch_dp_disabled(dev_priv, pipe, PCH_DP_B, TRANS_DP_PORT_SEL_B); |
1008 | assert_pch_dp_disabled(dev_priv, pipe, PCH_DP_C); | 1026 | assert_pch_dp_disabled(dev_priv, pipe, PCH_DP_C, TRANS_DP_PORT_SEL_C); |
1009 | assert_pch_dp_disabled(dev_priv, pipe, PCH_DP_D); | 1027 | assert_pch_dp_disabled(dev_priv, pipe, PCH_DP_D, TRANS_DP_PORT_SEL_D); |
1010 | 1028 | ||
1011 | reg = PCH_ADPA; | 1029 | reg = PCH_ADPA; |
1012 | val = I915_READ(reg); | 1030 | val = I915_READ(reg); |
@@ -1276,6 +1294,17 @@ static void intel_disable_pipe(struct drm_i915_private *dev_priv, | |||
1276 | intel_wait_for_pipe_off(dev_priv->dev, pipe); | 1294 | intel_wait_for_pipe_off(dev_priv->dev, pipe); |
1277 | } | 1295 | } |
1278 | 1296 | ||
1297 | /* | ||
1298 | * Plane regs are double buffered, going from enabled->disabled needs a | ||
1299 | * trigger in order to latch. The display address reg provides this. | ||
1300 | */ | ||
1301 | static void intel_flush_display_plane(struct drm_i915_private *dev_priv, | ||
1302 | enum plane plane) | ||
1303 | { | ||
1304 | I915_WRITE(DSPADDR(plane), I915_READ(DSPADDR(plane))); | ||
1305 | I915_WRITE(DSPSURF(plane), I915_READ(DSPSURF(plane))); | ||
1306 | } | ||
1307 | |||
1279 | /** | 1308 | /** |
1280 | * intel_enable_plane - enable a display plane on a given pipe | 1309 | * intel_enable_plane - enable a display plane on a given pipe |
1281 | * @dev_priv: i915 private structure | 1310 | * @dev_priv: i915 private structure |
@@ -1299,20 +1328,10 @@ static void intel_enable_plane(struct drm_i915_private *dev_priv, | |||
1299 | return; | 1328 | return; |
1300 | 1329 | ||
1301 | I915_WRITE(reg, val | DISPLAY_PLANE_ENABLE); | 1330 | I915_WRITE(reg, val | DISPLAY_PLANE_ENABLE); |
1331 | intel_flush_display_plane(dev_priv, plane); | ||
1302 | intel_wait_for_vblank(dev_priv->dev, pipe); | 1332 | intel_wait_for_vblank(dev_priv->dev, pipe); |
1303 | } | 1333 | } |
1304 | 1334 | ||
1305 | /* | ||
1306 | * Plane regs are double buffered, going from enabled->disabled needs a | ||
1307 | * trigger in order to latch. The display address reg provides this. | ||
1308 | */ | ||
1309 | static void intel_flush_display_plane(struct drm_i915_private *dev_priv, | ||
1310 | enum plane plane) | ||
1311 | { | ||
1312 | u32 reg = DSPADDR(plane); | ||
1313 | I915_WRITE(reg, I915_READ(reg)); | ||
1314 | } | ||
1315 | |||
1316 | /** | 1335 | /** |
1317 | * intel_disable_plane - disable a display plane | 1336 | * intel_disable_plane - disable a display plane |
1318 | * @dev_priv: i915 private structure | 1337 | * @dev_priv: i915 private structure |
@@ -1338,19 +1357,24 @@ static void intel_disable_plane(struct drm_i915_private *dev_priv, | |||
1338 | } | 1357 | } |
1339 | 1358 | ||
1340 | static void disable_pch_dp(struct drm_i915_private *dev_priv, | 1359 | static void disable_pch_dp(struct drm_i915_private *dev_priv, |
1341 | enum pipe pipe, int reg) | 1360 | enum pipe pipe, int reg, u32 port_sel) |
1342 | { | 1361 | { |
1343 | u32 val = I915_READ(reg); | 1362 | u32 val = I915_READ(reg); |
1344 | if (DP_PIPE_ENABLED(val, pipe)) | 1363 | if (dp_pipe_enabled(dev_priv, pipe, reg, port_sel, val)) { |
1364 | DRM_DEBUG_KMS("Disabling pch dp %x on pipe %d\n", reg, pipe); | ||
1345 | I915_WRITE(reg, val & ~DP_PORT_EN); | 1365 | I915_WRITE(reg, val & ~DP_PORT_EN); |
1366 | } | ||
1346 | } | 1367 | } |
1347 | 1368 | ||
1348 | static void disable_pch_hdmi(struct drm_i915_private *dev_priv, | 1369 | static void disable_pch_hdmi(struct drm_i915_private *dev_priv, |
1349 | enum pipe pipe, int reg) | 1370 | enum pipe pipe, int reg) |
1350 | { | 1371 | { |
1351 | u32 val = I915_READ(reg); | 1372 | u32 val = I915_READ(reg); |
1352 | if (HDMI_PIPE_ENABLED(val, pipe)) | 1373 | if (HDMI_PIPE_ENABLED(val, pipe)) { |
1374 | DRM_DEBUG_KMS("Disabling pch HDMI %x on pipe %d\n", | ||
1375 | reg, pipe); | ||
1353 | I915_WRITE(reg, val & ~PORT_ENABLE); | 1376 | I915_WRITE(reg, val & ~PORT_ENABLE); |
1377 | } | ||
1354 | } | 1378 | } |
1355 | 1379 | ||
1356 | /* Disable any ports connected to this transcoder */ | 1380 | /* Disable any ports connected to this transcoder */ |
@@ -1362,9 +1386,9 @@ static void intel_disable_pch_ports(struct drm_i915_private *dev_priv, | |||
1362 | val = I915_READ(PCH_PP_CONTROL); | 1386 | val = I915_READ(PCH_PP_CONTROL); |
1363 | I915_WRITE(PCH_PP_CONTROL, val | PANEL_UNLOCK_REGS); | 1387 | I915_WRITE(PCH_PP_CONTROL, val | PANEL_UNLOCK_REGS); |
1364 | 1388 | ||
1365 | disable_pch_dp(dev_priv, pipe, PCH_DP_B); | 1389 | disable_pch_dp(dev_priv, pipe, PCH_DP_B, TRANS_DP_PORT_SEL_B); |
1366 | disable_pch_dp(dev_priv, pipe, PCH_DP_C); | 1390 | disable_pch_dp(dev_priv, pipe, PCH_DP_C, TRANS_DP_PORT_SEL_C); |
1367 | disable_pch_dp(dev_priv, pipe, PCH_DP_D); | 1391 | disable_pch_dp(dev_priv, pipe, PCH_DP_D, TRANS_DP_PORT_SEL_D); |
1368 | 1392 | ||
1369 | reg = PCH_ADPA; | 1393 | reg = PCH_ADPA; |
1370 | val = I915_READ(reg); | 1394 | val = I915_READ(reg); |
@@ -5523,6 +5547,8 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
5523 | 5547 | ||
5524 | drm_vblank_post_modeset(dev, pipe); | 5548 | drm_vblank_post_modeset(dev, pipe); |
5525 | 5549 | ||
5550 | intel_crtc->dpms_mode = DRM_MODE_DPMS_ON; | ||
5551 | |||
5526 | return ret; | 5552 | return ret; |
5527 | } | 5553 | } |
5528 | 5554 | ||
@@ -7721,10 +7747,12 @@ static void gen6_init_clock_gating(struct drm_device *dev) | |||
7721 | ILK_DPARB_CLK_GATE | | 7747 | ILK_DPARB_CLK_GATE | |
7722 | ILK_DPFD_CLK_GATE); | 7748 | ILK_DPFD_CLK_GATE); |
7723 | 7749 | ||
7724 | for_each_pipe(pipe) | 7750 | for_each_pipe(pipe) { |
7725 | I915_WRITE(DSPCNTR(pipe), | 7751 | I915_WRITE(DSPCNTR(pipe), |
7726 | I915_READ(DSPCNTR(pipe)) | | 7752 | I915_READ(DSPCNTR(pipe)) | |
7727 | DISPPLANE_TRICKLE_FEED_DISABLE); | 7753 | DISPPLANE_TRICKLE_FEED_DISABLE); |
7754 | intel_flush_display_plane(dev_priv, pipe); | ||
7755 | } | ||
7728 | } | 7756 | } |
7729 | 7757 | ||
7730 | static void ivybridge_init_clock_gating(struct drm_device *dev) | 7758 | static void ivybridge_init_clock_gating(struct drm_device *dev) |
@@ -7741,10 +7769,12 @@ static void ivybridge_init_clock_gating(struct drm_device *dev) | |||
7741 | 7769 | ||
7742 | I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE); | 7770 | I915_WRITE(ILK_DSPCLK_GATE, IVB_VRHUNIT_CLK_GATE); |
7743 | 7771 | ||
7744 | for_each_pipe(pipe) | 7772 | for_each_pipe(pipe) { |
7745 | I915_WRITE(DSPCNTR(pipe), | 7773 | I915_WRITE(DSPCNTR(pipe), |
7746 | I915_READ(DSPCNTR(pipe)) | | 7774 | I915_READ(DSPCNTR(pipe)) | |
7747 | DISPPLANE_TRICKLE_FEED_DISABLE); | 7775 | DISPPLANE_TRICKLE_FEED_DISABLE); |
7776 | intel_flush_display_plane(dev_priv, pipe); | ||
7777 | } | ||
7748 | } | 7778 | } |
7749 | 7779 | ||
7750 | static void g4x_init_clock_gating(struct drm_device *dev) | 7780 | static void g4x_init_clock_gating(struct drm_device *dev) |
@@ -7827,6 +7857,7 @@ static void ibx_init_clock_gating(struct drm_device *dev) | |||
7827 | static void cpt_init_clock_gating(struct drm_device *dev) | 7857 | static void cpt_init_clock_gating(struct drm_device *dev) |
7828 | { | 7858 | { |
7829 | struct drm_i915_private *dev_priv = dev->dev_private; | 7859 | struct drm_i915_private *dev_priv = dev->dev_private; |
7860 | int pipe; | ||
7830 | 7861 | ||
7831 | /* | 7862 | /* |
7832 | * On Ibex Peak and Cougar Point, we need to disable clock | 7863 | * On Ibex Peak and Cougar Point, we need to disable clock |
@@ -7836,6 +7867,9 @@ static void cpt_init_clock_gating(struct drm_device *dev) | |||
7836 | I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE); | 7867 | I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE); |
7837 | I915_WRITE(SOUTH_CHICKEN2, I915_READ(SOUTH_CHICKEN2) | | 7868 | I915_WRITE(SOUTH_CHICKEN2, I915_READ(SOUTH_CHICKEN2) | |
7838 | DPLS_EDP_PPS_FIX_DIS); | 7869 | DPLS_EDP_PPS_FIX_DIS); |
7870 | /* Without this, mode sets may fail silently on FDI */ | ||
7871 | for_each_pipe(pipe) | ||
7872 | I915_WRITE(TRANS_CHICKEN2(pipe), TRANS_AUTOTRAIN_GEN_STALL_DIS); | ||
7839 | } | 7873 | } |
7840 | 7874 | ||
7841 | static void ironlake_teardown_rc6(struct drm_device *dev) | 7875 | static void ironlake_teardown_rc6(struct drm_device *dev) |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 6a9ec00f8c81..84bfdd1434f5 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -50,6 +50,7 @@ struct intel_dp { | |||
50 | bool has_audio; | 50 | bool has_audio; |
51 | int force_audio; | 51 | int force_audio; |
52 | uint32_t color_range; | 52 | uint32_t color_range; |
53 | int dpms_mode; | ||
53 | uint8_t link_bw; | 54 | uint8_t link_bw; |
54 | uint8_t lane_count; | 55 | uint8_t lane_count; |
55 | uint8_t dpcd[8]; | 56 | uint8_t dpcd[8]; |
@@ -1012,6 +1013,8 @@ static void intel_dp_commit(struct drm_encoder *encoder) | |||
1012 | 1013 | ||
1013 | if (is_edp(intel_dp)) | 1014 | if (is_edp(intel_dp)) |
1014 | ironlake_edp_backlight_on(dev); | 1015 | ironlake_edp_backlight_on(dev); |
1016 | |||
1017 | intel_dp->dpms_mode = DRM_MODE_DPMS_ON; | ||
1015 | } | 1018 | } |
1016 | 1019 | ||
1017 | static void | 1020 | static void |
@@ -1046,6 +1049,7 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode) | |||
1046 | if (is_edp(intel_dp)) | 1049 | if (is_edp(intel_dp)) |
1047 | ironlake_edp_backlight_on(dev); | 1050 | ironlake_edp_backlight_on(dev); |
1048 | } | 1051 | } |
1052 | intel_dp->dpms_mode = mode; | ||
1049 | } | 1053 | } |
1050 | 1054 | ||
1051 | /* | 1055 | /* |
@@ -1568,6 +1572,18 @@ intel_dp_link_down(struct intel_dp *intel_dp) | |||
1568 | POSTING_READ(intel_dp->output_reg); | 1572 | POSTING_READ(intel_dp->output_reg); |
1569 | } | 1573 | } |
1570 | 1574 | ||
1575 | static bool | ||
1576 | intel_dp_get_dpcd(struct intel_dp *intel_dp) | ||
1577 | { | ||
1578 | if (intel_dp_aux_native_read_retry(intel_dp, 0x000, intel_dp->dpcd, | ||
1579 | sizeof (intel_dp->dpcd)) && | ||
1580 | (intel_dp->dpcd[DP_DPCD_REV] != 0)) { | ||
1581 | return true; | ||
1582 | } | ||
1583 | |||
1584 | return false; | ||
1585 | } | ||
1586 | |||
1571 | /* | 1587 | /* |
1572 | * According to DP spec | 1588 | * According to DP spec |
1573 | * 5.1.2: | 1589 | * 5.1.2: |
@@ -1580,42 +1596,38 @@ intel_dp_link_down(struct intel_dp *intel_dp) | |||
1580 | static void | 1596 | static void |
1581 | intel_dp_check_link_status(struct intel_dp *intel_dp) | 1597 | intel_dp_check_link_status(struct intel_dp *intel_dp) |
1582 | { | 1598 | { |
1583 | int ret; | 1599 | if (intel_dp->dpms_mode != DRM_MODE_DPMS_ON) |
1600 | return; | ||
1584 | 1601 | ||
1585 | if (!intel_dp->base.base.crtc) | 1602 | if (!intel_dp->base.base.crtc) |
1586 | return; | 1603 | return; |
1587 | 1604 | ||
1605 | /* Try to read receiver status if the link appears to be up */ | ||
1588 | if (!intel_dp_get_link_status(intel_dp)) { | 1606 | if (!intel_dp_get_link_status(intel_dp)) { |
1589 | intel_dp_link_down(intel_dp); | 1607 | intel_dp_link_down(intel_dp); |
1590 | return; | 1608 | return; |
1591 | } | 1609 | } |
1592 | 1610 | ||
1593 | /* Try to read receiver status if the link appears to be up */ | 1611 | /* Now read the DPCD to see if it's actually running */ |
1594 | ret = intel_dp_aux_native_read(intel_dp, | 1612 | if (!intel_dp_get_dpcd(intel_dp)) { |
1595 | 0x000, intel_dp->dpcd, | ||
1596 | sizeof (intel_dp->dpcd)); | ||
1597 | if (ret != sizeof(intel_dp->dpcd)) { | ||
1598 | intel_dp_link_down(intel_dp); | 1613 | intel_dp_link_down(intel_dp); |
1599 | return; | 1614 | return; |
1600 | } | 1615 | } |
1601 | 1616 | ||
1602 | if (!intel_channel_eq_ok(intel_dp)) { | 1617 | if (!intel_channel_eq_ok(intel_dp)) { |
1618 | DRM_DEBUG_KMS("%s: channel EQ not ok, retraining\n", | ||
1619 | drm_get_encoder_name(&intel_dp->base.base)); | ||
1603 | intel_dp_start_link_train(intel_dp); | 1620 | intel_dp_start_link_train(intel_dp); |
1604 | intel_dp_complete_link_train(intel_dp); | 1621 | intel_dp_complete_link_train(intel_dp); |
1605 | } | 1622 | } |
1606 | } | 1623 | } |
1607 | 1624 | ||
1608 | static enum drm_connector_status | 1625 | static enum drm_connector_status |
1609 | i915_dp_detect_common(struct intel_dp *intel_dp) | 1626 | intel_dp_detect_dpcd(struct intel_dp *intel_dp) |
1610 | { | 1627 | { |
1611 | enum drm_connector_status status = connector_status_disconnected; | 1628 | if (intel_dp_get_dpcd(intel_dp)) |
1612 | 1629 | return connector_status_connected; | |
1613 | if (intel_dp_aux_native_read_retry(intel_dp, 0x000, intel_dp->dpcd, | 1630 | return connector_status_disconnected; |
1614 | sizeof (intel_dp->dpcd)) && | ||
1615 | (intel_dp->dpcd[DP_DPCD_REV] != 0)) | ||
1616 | status = connector_status_connected; | ||
1617 | |||
1618 | return status; | ||
1619 | } | 1631 | } |
1620 | 1632 | ||
1621 | static enum drm_connector_status | 1633 | static enum drm_connector_status |
@@ -1631,7 +1643,7 @@ ironlake_dp_detect(struct intel_dp *intel_dp) | |||
1631 | return status; | 1643 | return status; |
1632 | } | 1644 | } |
1633 | 1645 | ||
1634 | return i915_dp_detect_common(intel_dp); | 1646 | return intel_dp_detect_dpcd(intel_dp); |
1635 | } | 1647 | } |
1636 | 1648 | ||
1637 | static enum drm_connector_status | 1649 | static enum drm_connector_status |
@@ -1660,7 +1672,7 @@ g4x_dp_detect(struct intel_dp *intel_dp) | |||
1660 | if ((temp & bit) == 0) | 1672 | if ((temp & bit) == 0) |
1661 | return connector_status_disconnected; | 1673 | return connector_status_disconnected; |
1662 | 1674 | ||
1663 | return i915_dp_detect_common(intel_dp); | 1675 | return intel_dp_detect_dpcd(intel_dp); |
1664 | } | 1676 | } |
1665 | 1677 | ||
1666 | /** | 1678 | /** |
@@ -1935,6 +1947,7 @@ intel_dp_init(struct drm_device *dev, int output_reg) | |||
1935 | return; | 1947 | return; |
1936 | 1948 | ||
1937 | intel_dp->output_reg = output_reg; | 1949 | intel_dp->output_reg = output_reg; |
1950 | intel_dp->dpms_mode = -1; | ||
1938 | 1951 | ||
1939 | intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); | 1952 | intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); |
1940 | if (!intel_connector) { | 1953 | if (!intel_connector) { |
@@ -2011,7 +2024,7 @@ intel_dp_init(struct drm_device *dev, int output_reg) | |||
2011 | 2024 | ||
2012 | /* Cache some DPCD data in the eDP case */ | 2025 | /* Cache some DPCD data in the eDP case */ |
2013 | if (is_edp(intel_dp)) { | 2026 | if (is_edp(intel_dp)) { |
2014 | int ret; | 2027 | bool ret; |
2015 | u32 pp_on, pp_div; | 2028 | u32 pp_on, pp_div; |
2016 | 2029 | ||
2017 | pp_on = I915_READ(PCH_PP_ON_DELAYS); | 2030 | pp_on = I915_READ(PCH_PP_ON_DELAYS); |
@@ -2024,11 +2037,9 @@ intel_dp_init(struct drm_device *dev, int output_reg) | |||
2024 | dev_priv->panel_t12 *= 100; /* t12 in 100ms units */ | 2037 | dev_priv->panel_t12 *= 100; /* t12 in 100ms units */ |
2025 | 2038 | ||
2026 | ironlake_edp_panel_vdd_on(intel_dp); | 2039 | ironlake_edp_panel_vdd_on(intel_dp); |
2027 | ret = intel_dp_aux_native_read(intel_dp, DP_DPCD_REV, | 2040 | ret = intel_dp_get_dpcd(intel_dp); |
2028 | intel_dp->dpcd, | ||
2029 | sizeof(intel_dp->dpcd)); | ||
2030 | ironlake_edp_panel_vdd_off(intel_dp); | 2041 | ironlake_edp_panel_vdd_off(intel_dp); |
2031 | if (ret == sizeof(intel_dp->dpcd)) { | 2042 | if (ret) { |
2032 | if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11) | 2043 | if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11) |
2033 | dev_priv->no_aux_handshake = | 2044 | dev_priv->no_aux_handshake = |
2034 | intel_dp->dpcd[DP_MAX_DOWNSPREAD] & | 2045 | intel_dp->dpcd[DP_MAX_DOWNSPREAD] & |