diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 82 |
1 files changed, 53 insertions, 29 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 990f065374b2..bee24b1a58e8 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -1611,6 +1611,18 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, | |||
1611 | 1611 | ||
1612 | wait_event(dev_priv->pending_flip_queue, | 1612 | wait_event(dev_priv->pending_flip_queue, |
1613 | atomic_read(&obj_priv->pending_flip) == 0); | 1613 | atomic_read(&obj_priv->pending_flip) == 0); |
1614 | |||
1615 | /* Big Hammer, we also need to ensure that any pending | ||
1616 | * MI_WAIT_FOR_EVENT inside a user batch buffer on the | ||
1617 | * current scanout is retired before unpinning the old | ||
1618 | * framebuffer. | ||
1619 | */ | ||
1620 | ret = i915_gem_object_flush_gpu(obj_priv, false); | ||
1621 | if (ret) { | ||
1622 | i915_gem_object_unpin(to_intel_framebuffer(crtc->fb)->obj); | ||
1623 | mutex_unlock(&dev->struct_mutex); | ||
1624 | return ret; | ||
1625 | } | ||
1614 | } | 1626 | } |
1615 | 1627 | ||
1616 | ret = intel_pipe_set_base_atomic(crtc, crtc->fb, x, y, | 1628 | ret = intel_pipe_set_base_atomic(crtc, crtc->fb, x, y, |
@@ -1681,6 +1693,37 @@ static void ironlake_set_pll_edp(struct drm_crtc *crtc, int clock) | |||
1681 | udelay(500); | 1693 | udelay(500); |
1682 | } | 1694 | } |
1683 | 1695 | ||
1696 | static void intel_fdi_normal_train(struct drm_crtc *crtc) | ||
1697 | { | ||
1698 | struct drm_device *dev = crtc->dev; | ||
1699 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
1700 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
1701 | int pipe = intel_crtc->pipe; | ||
1702 | u32 reg, temp; | ||
1703 | |||
1704 | /* enable normal train */ | ||
1705 | reg = FDI_TX_CTL(pipe); | ||
1706 | temp = I915_READ(reg); | ||
1707 | temp &= ~FDI_LINK_TRAIN_NONE; | ||
1708 | temp |= FDI_LINK_TRAIN_NONE | FDI_TX_ENHANCE_FRAME_ENABLE; | ||
1709 | I915_WRITE(reg, temp); | ||
1710 | |||
1711 | reg = FDI_RX_CTL(pipe); | ||
1712 | temp = I915_READ(reg); | ||
1713 | if (HAS_PCH_CPT(dev)) { | ||
1714 | temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT; | ||
1715 | temp |= FDI_LINK_TRAIN_NORMAL_CPT; | ||
1716 | } else { | ||
1717 | temp &= ~FDI_LINK_TRAIN_NONE; | ||
1718 | temp |= FDI_LINK_TRAIN_NONE; | ||
1719 | } | ||
1720 | I915_WRITE(reg, temp | FDI_RX_ENHANCE_FRAME_ENABLE); | ||
1721 | |||
1722 | /* wait one idle pattern time */ | ||
1723 | POSTING_READ(reg); | ||
1724 | udelay(1000); | ||
1725 | } | ||
1726 | |||
1684 | /* The FDI link training functions for ILK/Ibexpeak. */ | 1727 | /* The FDI link training functions for ILK/Ibexpeak. */ |
1685 | static void ironlake_fdi_link_train(struct drm_crtc *crtc) | 1728 | static void ironlake_fdi_link_train(struct drm_crtc *crtc) |
1686 | { | 1729 | { |
@@ -1767,27 +1810,6 @@ static void ironlake_fdi_link_train(struct drm_crtc *crtc) | |||
1767 | 1810 | ||
1768 | DRM_DEBUG_KMS("FDI train done\n"); | 1811 | DRM_DEBUG_KMS("FDI train done\n"); |
1769 | 1812 | ||
1770 | /* enable normal train */ | ||
1771 | reg = FDI_TX_CTL(pipe); | ||
1772 | temp = I915_READ(reg); | ||
1773 | temp &= ~FDI_LINK_TRAIN_NONE; | ||
1774 | temp |= FDI_LINK_TRAIN_NONE | FDI_TX_ENHANCE_FRAME_ENABLE; | ||
1775 | I915_WRITE(reg, temp); | ||
1776 | |||
1777 | reg = FDI_RX_CTL(pipe); | ||
1778 | temp = I915_READ(reg); | ||
1779 | if (HAS_PCH_CPT(dev)) { | ||
1780 | temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT; | ||
1781 | temp |= FDI_LINK_TRAIN_NORMAL_CPT; | ||
1782 | } else { | ||
1783 | temp &= ~FDI_LINK_TRAIN_NONE; | ||
1784 | temp |= FDI_LINK_TRAIN_NONE; | ||
1785 | } | ||
1786 | I915_WRITE(reg, temp | FDI_RX_ENHANCE_FRAME_ENABLE); | ||
1787 | |||
1788 | /* wait one idle pattern time */ | ||
1789 | POSTING_READ(reg); | ||
1790 | udelay(1000); | ||
1791 | } | 1813 | } |
1792 | 1814 | ||
1793 | static const int const snb_b_fdi_train_param [] = { | 1815 | static const int const snb_b_fdi_train_param [] = { |
@@ -2090,6 +2112,8 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc) | |||
2090 | I915_WRITE(TRANS_VBLANK(pipe), I915_READ(VBLANK(pipe))); | 2112 | I915_WRITE(TRANS_VBLANK(pipe), I915_READ(VBLANK(pipe))); |
2091 | I915_WRITE(TRANS_VSYNC(pipe), I915_READ(VSYNC(pipe))); | 2113 | I915_WRITE(TRANS_VSYNC(pipe), I915_READ(VSYNC(pipe))); |
2092 | 2114 | ||
2115 | intel_fdi_normal_train(crtc); | ||
2116 | |||
2093 | /* For PCH DP, enable TRANS_DP_CTL */ | 2117 | /* For PCH DP, enable TRANS_DP_CTL */ |
2094 | if (HAS_PCH_CPT(dev) && | 2118 | if (HAS_PCH_CPT(dev) && |
2095 | intel_pipe_has_type(crtc, INTEL_OUTPUT_DISPLAYPORT)) { | 2119 | intel_pipe_has_type(crtc, INTEL_OUTPUT_DISPLAYPORT)) { |
@@ -2200,9 +2224,10 @@ static void ironlake_crtc_disable(struct drm_crtc *crtc) | |||
2200 | udelay(100); | 2224 | udelay(100); |
2201 | 2225 | ||
2202 | /* Ironlake workaround, disable clock pointer after downing FDI */ | 2226 | /* Ironlake workaround, disable clock pointer after downing FDI */ |
2203 | I915_WRITE(FDI_RX_CHICKEN(pipe), | 2227 | if (HAS_PCH_IBX(dev)) |
2204 | I915_READ(FDI_RX_CHICKEN(pipe) & | 2228 | I915_WRITE(FDI_RX_CHICKEN(pipe), |
2205 | ~FDI_RX_PHASE_SYNC_POINTER_ENABLE)); | 2229 | I915_READ(FDI_RX_CHICKEN(pipe) & |
2230 | ~FDI_RX_PHASE_SYNC_POINTER_ENABLE)); | ||
2206 | 2231 | ||
2207 | /* still set train pattern 1 */ | 2232 | /* still set train pattern 1 */ |
2208 | reg = FDI_TX_CTL(pipe); | 2233 | reg = FDI_TX_CTL(pipe); |
@@ -5581,20 +5606,19 @@ void ironlake_enable_drps(struct drm_device *dev) | |||
5581 | fmin = (rgvmodectl & MEMMODE_FMIN_MASK); | 5606 | fmin = (rgvmodectl & MEMMODE_FMIN_MASK); |
5582 | fstart = (rgvmodectl & MEMMODE_FSTART_MASK) >> | 5607 | fstart = (rgvmodectl & MEMMODE_FSTART_MASK) >> |
5583 | MEMMODE_FSTART_SHIFT; | 5608 | MEMMODE_FSTART_SHIFT; |
5584 | fstart = fmax; | ||
5585 | 5609 | ||
5586 | vstart = (I915_READ(PXVFREQ_BASE + (fstart * 4)) & PXVFREQ_PX_MASK) >> | 5610 | vstart = (I915_READ(PXVFREQ_BASE + (fstart * 4)) & PXVFREQ_PX_MASK) >> |
5587 | PXVFREQ_PX_SHIFT; | 5611 | PXVFREQ_PX_SHIFT; |
5588 | 5612 | ||
5589 | dev_priv->fmax = fstart; /* IPS callback will increase this */ | 5613 | dev_priv->fmax = fmax; /* IPS callback will increase this */ |
5590 | dev_priv->fstart = fstart; | 5614 | dev_priv->fstart = fstart; |
5591 | 5615 | ||
5592 | dev_priv->max_delay = fmax; | 5616 | dev_priv->max_delay = fstart; |
5593 | dev_priv->min_delay = fmin; | 5617 | dev_priv->min_delay = fmin; |
5594 | dev_priv->cur_delay = fstart; | 5618 | dev_priv->cur_delay = fstart; |
5595 | 5619 | ||
5596 | DRM_DEBUG_DRIVER("fmax: %d, fmin: %d, fstart: %d\n", fmax, fmin, | 5620 | DRM_DEBUG_DRIVER("fmax: %d, fmin: %d, fstart: %d\n", |
5597 | fstart); | 5621 | fmax, fmin, fstart); |
5598 | 5622 | ||
5599 | I915_WRITE(MEMINTREN, MEMINT_CX_SUPR_EN | MEMINT_EVAL_CHG_EN); | 5623 | I915_WRITE(MEMINTREN, MEMINT_CX_SUPR_EN | MEMINT_EVAL_CHG_EN); |
5600 | 5624 | ||