aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorChon Ming Lee <chon.ming.lee@intel.com>2014-04-09 06:28:17 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-05-12 13:50:13 -0400
commit076ed3b2955e5934e137abff39fe9e7180f236fe (patch)
tree4a963817c4b3ade8f78964094f7f7c35b92a0cec /drivers/gpu/drm/i915/intel_display.c
parenteb69b0e59ac845666b7b284ca83a1fef17ebaa9f (diff)
drm/i915/chv: Trigger phy common lane reset
During cold boot, the display controller needs to deassert the common lane reset. Only do it once during intel_init_dpio for both PHYx2 and PHYx1. Besides, assert the common lane reset when disable pll. This still to be determined whether need to do it by driver. Signed-off-by: Chon Ming Lee <chon.ming.lee@intel.com> [vsyrjala: Don't disable DPIO PLL when using DSI] [vsyrjala: Don't call vlv_disable_pll() by accident on CHV] Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com> [danvet: Move part of a moved comment back as suggested by Imre since it's valid for both byt and chv.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c72
1 files changed, 57 insertions, 15 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index c42593fd53a5..8942f393b791 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1395,17 +1395,42 @@ static void intel_reset_dpio(struct drm_device *dev)
1395 DPLL_REFA_CLK_ENABLE_VLV | 1395 DPLL_REFA_CLK_ENABLE_VLV |
1396 DPLL_INTEGRATED_CRI_CLK_VLV); 1396 DPLL_INTEGRATED_CRI_CLK_VLV);
1397 1397
1398 /* 1398 if (IS_CHERRYVIEW(dev)) {
1399 * From VLV2A0_DP_eDP_DPIO_driver_vbios_notes_10.docx - 1399 enum dpio_phy phy;
1400 * 6. De-assert cmn_reset/side_reset. Same as VLV X0. 1400 u32 val;
1401 * a. GUnit 0x2110 bit[0] set to 1 (def 0) 1401
1402 * b. The other bits such as sfr settings / modesel may all be set 1402 for (phy = DPIO_PHY0; phy < I915_NUM_PHYS_VLV; phy++) {
1403 * to 0. 1403 /* Poll for phypwrgood signal */
1404 * 1404 if (wait_for(I915_READ(DISPLAY_PHY_STATUS) &
1405 * This should only be done on init and resume from S3 with both 1405 PHY_POWERGOOD(phy), 1))
1406 * PLLs disabled, or we risk losing DPIO and PLL synchronization. 1406 DRM_ERROR("Display PHY %d is not power up\n", phy);
1407 */ 1407
1408 I915_WRITE(DPIO_CTL, I915_READ(DPIO_CTL) | DPIO_CMNRST); 1408 /*
1409 * Deassert common lane reset for PHY.
1410 *
1411 * This should only be done on init and resume from S3
1412 * with both PLLs disabled, or we risk losing DPIO and
1413 * PLL synchronization.
1414 */
1415 val = I915_READ(DISPLAY_PHY_CONTROL);
1416 I915_WRITE(DISPLAY_PHY_CONTROL,
1417 PHY_COM_LANE_RESET_DEASSERT(phy, val));
1418 }
1419
1420 } else {
1421 /*
1422 * From VLV2A0_DP_eDP_DPIO_driver_vbios_notes_10.docx -
1423 * 6. De-assert cmn_reset/side_reset. Same as VLV X0.
1424 * a. GUnit 0x2110 bit[0] set to 1 (def 0)
1425 * b. The other bits such as sfr settings / modesel may all
1426 * be set to 0.
1427 *
1428 * This should only be done on init and resume from S3 with
1429 * both PLLs disabled, or we risk losing DPIO and PLL
1430 * synchronization.
1431 */
1432 I915_WRITE(DPIO_CTL, I915_READ(DPIO_CTL) | DPIO_CMNRST);
1433 }
1409} 1434}
1410 1435
1411static void vlv_enable_pll(struct intel_crtc *crtc) 1436static void vlv_enable_pll(struct intel_crtc *crtc)
@@ -1529,6 +1554,19 @@ static void vlv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
1529 val = DPLL_INTEGRATED_CRI_CLK_VLV | DPLL_REFA_CLK_ENABLE_VLV; 1554 val = DPLL_INTEGRATED_CRI_CLK_VLV | DPLL_REFA_CLK_ENABLE_VLV;
1530 I915_WRITE(DPLL(pipe), val); 1555 I915_WRITE(DPLL(pipe), val);
1531 POSTING_READ(DPLL(pipe)); 1556 POSTING_READ(DPLL(pipe));
1557
1558}
1559
1560static void chv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
1561{
1562 int dpll = DPLL(pipe);
1563 u32 val;
1564
1565 /* Set PLL en = 0 */
1566 val = I915_READ(dpll);
1567 val &= ~DPLL_VCO_ENABLE;
1568 I915_WRITE(dpll, val);
1569
1532} 1570}
1533 1571
1534void vlv_wait_port_ready(struct drm_i915_private *dev_priv, 1572void vlv_wait_port_ready(struct drm_i915_private *dev_priv,
@@ -4446,10 +4484,14 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc)
4446 if (encoder->post_disable) 4484 if (encoder->post_disable)
4447 encoder->post_disable(encoder); 4485 encoder->post_disable(encoder);
4448 4486
4449 if (IS_VALLEYVIEW(dev) && !intel_pipe_has_type(crtc, INTEL_OUTPUT_DSI)) 4487 if (!intel_pipe_has_type(crtc, INTEL_OUTPUT_DSI)) {
4450 vlv_disable_pll(dev_priv, pipe); 4488 if (IS_CHERRYVIEW(dev))
4451 else if (!IS_VALLEYVIEW(dev)) 4489 chv_disable_pll(dev_priv, pipe);
4452 i9xx_disable_pll(dev_priv, pipe); 4490 else if (IS_VALLEYVIEW(dev))
4491 vlv_disable_pll(dev_priv, pipe);
4492 else
4493 i9xx_disable_pll(dev_priv, pipe);
4494 }
4453 4495
4454 intel_crtc->active = false; 4496 intel_crtc->active = false;
4455 intel_update_watermarks(crtc); 4497 intel_update_watermarks(crtc);