aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-04-24 17:55:13 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-05-20 09:19:35 -0400
commitb14b105586dc3a8221f282220da1d47bb8a85c5b (patch)
tree12235ee246f9e4c58c0c91274c6704fad2853811 /drivers/gpu/drm
parentf2a69f44aff8d96eb9080b97e39f3230b2c02ab2 (diff)
drm/i915: Extract intel_prepare_shared_dpll
This is the last piece of code which write state to the hardware in the ironalake ->crtc_mode_set callback. I think we could merge this with the pll->enable hook, but otoh the ordering requirements with the ldvs port are really tricky. Doing the FP0/1 writes up-front before we even prepare the lvds port (in the pre_pll_enable hook) like on i9xx seems safest. With this ilk+ platforms are now ready for runtime PM with DPMS. Since hsw/bdw also support runtime pm besides snb we need to first make the haswell code save before we can touch the core code. Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 88d47d531bf0..7def8dd0e8a8 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1739,6 +1739,22 @@ void vlv_wait_port_ready(struct drm_i915_private *dev_priv,
1739 port_name(dport->port), I915_READ(dpll_reg)); 1739 port_name(dport->port), I915_READ(dpll_reg));
1740} 1740}
1741 1741
1742static void intel_prepare_shared_dpll(struct intel_crtc *crtc)
1743{
1744 struct drm_device *dev = crtc->base.dev;
1745 struct drm_i915_private *dev_priv = dev->dev_private;
1746 struct intel_shared_dpll *pll = intel_crtc_to_shared_dpll(crtc);
1747
1748 WARN_ON(!pll->refcount);
1749 if (pll->active == 0) {
1750 DRM_DEBUG_DRIVER("setting up %s\n", pll->name);
1751 WARN_ON(pll->on);
1752 assert_shared_dpll_disabled(dev_priv, pll);
1753
1754 pll->mode_set(dev_priv, pll);
1755 }
1756}
1757
1742/** 1758/**
1743 * ironlake_enable_shared_dpll - enable PCH PLL 1759 * ironlake_enable_shared_dpll - enable PCH PLL
1744 * @dev_priv: i915 private structure 1760 * @dev_priv: i915 private structure
@@ -3644,13 +3660,6 @@ found:
3644 DRM_DEBUG_DRIVER("using %s for pipe %c\n", pll->name, 3660 DRM_DEBUG_DRIVER("using %s for pipe %c\n", pll->name,
3645 pipe_name(crtc->pipe)); 3661 pipe_name(crtc->pipe));
3646 3662
3647 if (pll->active == 0) {
3648 DRM_DEBUG_DRIVER("setting up %s\n", pll->name);
3649 WARN_ON(pll->on);
3650 assert_shared_dpll_disabled(dev_priv, pll);
3651
3652 pll->mode_set(dev_priv, pll);
3653 }
3654 pll->refcount++; 3663 pll->refcount++;
3655 3664
3656 return pll; 3665 return pll;
@@ -3926,6 +3935,9 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc)
3926 if (intel_crtc->active) 3935 if (intel_crtc->active)
3927 return; 3936 return;
3928 3937
3938 if (intel_crtc->config.has_pch_encoder)
3939 intel_prepare_shared_dpll(intel_crtc);
3940
3929 if (intel_crtc->config.has_dp_encoder) 3941 if (intel_crtc->config.has_dp_encoder)
3930 intel_dp_set_m_n(intel_crtc); 3942 intel_dp_set_m_n(intel_crtc);
3931 3943