diff options
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 60 |
1 files changed, 41 insertions, 19 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e25601bbcb57..a1833cbfaafd 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -1488,6 +1488,15 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
1488 | case DRM_MODE_DPMS_STANDBY: | 1488 | case DRM_MODE_DPMS_STANDBY: |
1489 | case DRM_MODE_DPMS_SUSPEND: | 1489 | case DRM_MODE_DPMS_SUSPEND: |
1490 | DRM_DEBUG_KMS("crtc %d dpms on\n", pipe); | 1490 | DRM_DEBUG_KMS("crtc %d dpms on\n", pipe); |
1491 | |||
1492 | if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { | ||
1493 | temp = I915_READ(PCH_LVDS); | ||
1494 | if ((temp & LVDS_PORT_EN) == 0) { | ||
1495 | I915_WRITE(PCH_LVDS, temp | LVDS_PORT_EN); | ||
1496 | POSTING_READ(PCH_LVDS); | ||
1497 | } | ||
1498 | } | ||
1499 | |||
1491 | if (HAS_eDP) { | 1500 | if (HAS_eDP) { |
1492 | /* enable eDP PLL */ | 1501 | /* enable eDP PLL */ |
1493 | igdng_enable_pll_edp(crtc); | 1502 | igdng_enable_pll_edp(crtc); |
@@ -1674,8 +1683,6 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
1674 | case DRM_MODE_DPMS_OFF: | 1683 | case DRM_MODE_DPMS_OFF: |
1675 | DRM_DEBUG_KMS("crtc %d dpms off\n", pipe); | 1684 | DRM_DEBUG_KMS("crtc %d dpms off\n", pipe); |
1676 | 1685 | ||
1677 | i915_disable_vga(dev); | ||
1678 | |||
1679 | /* Disable display plane */ | 1686 | /* Disable display plane */ |
1680 | temp = I915_READ(dspcntr_reg); | 1687 | temp = I915_READ(dspcntr_reg); |
1681 | if ((temp & DISPLAY_PLANE_ENABLE) != 0) { | 1688 | if ((temp & DISPLAY_PLANE_ENABLE) != 0) { |
@@ -1685,6 +1692,8 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
1685 | I915_READ(dspbase_reg); | 1692 | I915_READ(dspbase_reg); |
1686 | } | 1693 | } |
1687 | 1694 | ||
1695 | i915_disable_vga(dev); | ||
1696 | |||
1688 | /* disable cpu pipe, disable after all planes disabled */ | 1697 | /* disable cpu pipe, disable after all planes disabled */ |
1689 | temp = I915_READ(pipeconf_reg); | 1698 | temp = I915_READ(pipeconf_reg); |
1690 | if ((temp & PIPEACONF_ENABLE) != 0) { | 1699 | if ((temp & PIPEACONF_ENABLE) != 0) { |
@@ -1706,9 +1715,15 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
1706 | } else | 1715 | } else |
1707 | DRM_DEBUG_KMS("crtc %d is disabled\n", pipe); | 1716 | DRM_DEBUG_KMS("crtc %d is disabled\n", pipe); |
1708 | 1717 | ||
1709 | if (HAS_eDP) { | 1718 | udelay(100); |
1710 | igdng_disable_pll_edp(crtc); | 1719 | |
1720 | /* Disable PF */ | ||
1721 | temp = I915_READ(pf_ctl_reg); | ||
1722 | if ((temp & PF_ENABLE) != 0) { | ||
1723 | I915_WRITE(pf_ctl_reg, temp & ~PF_ENABLE); | ||
1724 | I915_READ(pf_ctl_reg); | ||
1711 | } | 1725 | } |
1726 | I915_WRITE(pf_win_size, 0); | ||
1712 | 1727 | ||
1713 | /* disable CPU FDI tx and PCH FDI rx */ | 1728 | /* disable CPU FDI tx and PCH FDI rx */ |
1714 | temp = I915_READ(fdi_tx_reg); | 1729 | temp = I915_READ(fdi_tx_reg); |
@@ -1734,6 +1749,13 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
1734 | 1749 | ||
1735 | udelay(100); | 1750 | udelay(100); |
1736 | 1751 | ||
1752 | if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS)) { | ||
1753 | temp = I915_READ(PCH_LVDS); | ||
1754 | I915_WRITE(PCH_LVDS, temp & ~LVDS_PORT_EN); | ||
1755 | I915_READ(PCH_LVDS); | ||
1756 | udelay(100); | ||
1757 | } | ||
1758 | |||
1737 | /* disable PCH transcoder */ | 1759 | /* disable PCH transcoder */ |
1738 | temp = I915_READ(transconf_reg); | 1760 | temp = I915_READ(transconf_reg); |
1739 | if ((temp & TRANS_ENABLE) != 0) { | 1761 | if ((temp & TRANS_ENABLE) != 0) { |
@@ -1754,6 +1776,8 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
1754 | } | 1776 | } |
1755 | } | 1777 | } |
1756 | 1778 | ||
1779 | udelay(100); | ||
1780 | |||
1757 | /* disable PCH DPLL */ | 1781 | /* disable PCH DPLL */ |
1758 | temp = I915_READ(pch_dpll_reg); | 1782 | temp = I915_READ(pch_dpll_reg); |
1759 | if ((temp & DPLL_VCO_ENABLE) != 0) { | 1783 | if ((temp & DPLL_VCO_ENABLE) != 0) { |
@@ -1761,14 +1785,20 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
1761 | I915_READ(pch_dpll_reg); | 1785 | I915_READ(pch_dpll_reg); |
1762 | } | 1786 | } |
1763 | 1787 | ||
1764 | temp = I915_READ(fdi_rx_reg); | 1788 | if (HAS_eDP) { |
1765 | if ((temp & FDI_RX_PLL_ENABLE) != 0) { | 1789 | igdng_disable_pll_edp(crtc); |
1766 | temp &= ~FDI_SEL_PCDCLK; | ||
1767 | temp &= ~FDI_RX_PLL_ENABLE; | ||
1768 | I915_WRITE(fdi_rx_reg, temp); | ||
1769 | I915_READ(fdi_rx_reg); | ||
1770 | } | 1790 | } |
1771 | 1791 | ||
1792 | temp = I915_READ(fdi_rx_reg); | ||
1793 | temp &= ~FDI_SEL_PCDCLK; | ||
1794 | I915_WRITE(fdi_rx_reg, temp); | ||
1795 | I915_READ(fdi_rx_reg); | ||
1796 | |||
1797 | temp = I915_READ(fdi_rx_reg); | ||
1798 | temp &= ~FDI_RX_PLL_ENABLE; | ||
1799 | I915_WRITE(fdi_rx_reg, temp); | ||
1800 | I915_READ(fdi_rx_reg); | ||
1801 | |||
1772 | /* Disable CPU FDI TX PLL */ | 1802 | /* Disable CPU FDI TX PLL */ |
1773 | temp = I915_READ(fdi_tx_reg); | 1803 | temp = I915_READ(fdi_tx_reg); |
1774 | if ((temp & FDI_TX_PLL_ENABLE) != 0) { | 1804 | if ((temp & FDI_TX_PLL_ENABLE) != 0) { |
@@ -1777,16 +1807,8 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
1777 | udelay(100); | 1807 | udelay(100); |
1778 | } | 1808 | } |
1779 | 1809 | ||
1780 | /* Disable PF */ | ||
1781 | temp = I915_READ(pf_ctl_reg); | ||
1782 | if ((temp & PF_ENABLE) != 0) { | ||
1783 | I915_WRITE(pf_ctl_reg, temp & ~PF_ENABLE); | ||
1784 | I915_READ(pf_ctl_reg); | ||
1785 | } | ||
1786 | I915_WRITE(pf_win_size, 0); | ||
1787 | |||
1788 | /* Wait for the clocks to turn off. */ | 1810 | /* Wait for the clocks to turn off. */ |
1789 | udelay(150); | 1811 | udelay(100); |
1790 | break; | 1812 | break; |
1791 | } | 1813 | } |
1792 | } | 1814 | } |