diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2014-06-27 19:04:00 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-08-08 11:43:43 -0400 |
commit | 1ae0d1377fda91367b27596001c82e877ec2057e (patch) | |
tree | e4a97247c4bbb405284ccd9309f3825981f40649 /drivers/gpu/drm/i915/intel_display.c | |
parent | d17ec4ced6c0907f80f51677a44236da94ecd92d (diff) |
drm/i915: Split chv_update_pll() apart
Split chv_update_pll() into two parts ala:
commit bdd4b6a655749970cc632aafc5fd596c07b60b1c
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Thu Apr 24 23:55:11 2014 +0200
drm/i915: Extract vlv_prepare_pll
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
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.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 6ca53b372a4c..60ba6962026b 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -100,6 +100,7 @@ static void ironlake_set_pipeconf(struct drm_crtc *crtc); | |||
100 | static void haswell_set_pipeconf(struct drm_crtc *crtc); | 100 | static void haswell_set_pipeconf(struct drm_crtc *crtc); |
101 | static void intel_set_pipe_csc(struct drm_crtc *crtc); | 101 | static void intel_set_pipe_csc(struct drm_crtc *crtc); |
102 | static void vlv_prepare_pll(struct intel_crtc *crtc); | 102 | static void vlv_prepare_pll(struct intel_crtc *crtc); |
103 | static void chv_prepare_pll(struct intel_crtc *crtc); | ||
103 | 104 | ||
104 | static struct intel_encoder *intel_find_encoder(struct intel_connector *connector, int pipe) | 105 | static struct intel_encoder *intel_find_encoder(struct intel_connector *connector, int pipe) |
105 | { | 106 | { |
@@ -4642,8 +4643,12 @@ static void valleyview_crtc_enable(struct drm_crtc *crtc) | |||
4642 | 4643 | ||
4643 | is_dsi = intel_pipe_has_type(crtc, INTEL_OUTPUT_DSI); | 4644 | is_dsi = intel_pipe_has_type(crtc, INTEL_OUTPUT_DSI); |
4644 | 4645 | ||
4645 | if (!is_dsi && !IS_CHERRYVIEW(dev)) | 4646 | if (!is_dsi) { |
4646 | vlv_prepare_pll(intel_crtc); | 4647 | if (IS_CHERRYVIEW(dev)) |
4648 | chv_prepare_pll(intel_crtc); | ||
4649 | else | ||
4650 | vlv_prepare_pll(intel_crtc); | ||
4651 | } | ||
4647 | 4652 | ||
4648 | /* Set up the display plane register */ | 4653 | /* Set up the display plane register */ |
4649 | dspcntr = DISPPLANE_GAMMA_ENABLE; | 4654 | dspcntr = DISPPLANE_GAMMA_ENABLE; |
@@ -5692,6 +5697,18 @@ static void vlv_prepare_pll(struct intel_crtc *crtc) | |||
5692 | 5697 | ||
5693 | static void chv_update_pll(struct intel_crtc *crtc) | 5698 | static void chv_update_pll(struct intel_crtc *crtc) |
5694 | { | 5699 | { |
5700 | crtc->config.dpll_hw_state.dpll = DPLL_SSC_REF_CLOCK_CHV | | ||
5701 | DPLL_REFA_CLK_ENABLE_VLV | DPLL_VGA_MODE_DIS | | ||
5702 | DPLL_VCO_ENABLE; | ||
5703 | if (crtc->pipe != PIPE_A) | ||
5704 | crtc->config.dpll_hw_state.dpll |= DPLL_INTEGRATED_CRI_CLK_VLV; | ||
5705 | |||
5706 | crtc->config.dpll_hw_state.dpll_md = | ||
5707 | (crtc->config.pixel_multiplier - 1) << DPLL_MD_UDI_MULTIPLIER_SHIFT; | ||
5708 | } | ||
5709 | |||
5710 | static void chv_prepare_pll(struct intel_crtc *crtc) | ||
5711 | { | ||
5695 | struct drm_device *dev = crtc->base.dev; | 5712 | struct drm_device *dev = crtc->base.dev; |
5696 | struct drm_i915_private *dev_priv = dev->dev_private; | 5713 | struct drm_i915_private *dev_priv = dev->dev_private; |
5697 | int pipe = crtc->pipe; | 5714 | int pipe = crtc->pipe; |
@@ -5701,15 +5718,6 @@ static void chv_update_pll(struct intel_crtc *crtc) | |||
5701 | u32 bestn, bestm1, bestm2, bestp1, bestp2, bestm2_frac; | 5718 | u32 bestn, bestm1, bestm2, bestp1, bestp2, bestm2_frac; |
5702 | int refclk; | 5719 | int refclk; |
5703 | 5720 | ||
5704 | crtc->config.dpll_hw_state.dpll = DPLL_SSC_REF_CLOCK_CHV | | ||
5705 | DPLL_REFA_CLK_ENABLE_VLV | DPLL_VGA_MODE_DIS | | ||
5706 | DPLL_VCO_ENABLE; | ||
5707 | if (pipe != PIPE_A) | ||
5708 | crtc->config.dpll_hw_state.dpll |= DPLL_INTEGRATED_CRI_CLK_VLV; | ||
5709 | |||
5710 | crtc->config.dpll_hw_state.dpll_md = | ||
5711 | (crtc->config.pixel_multiplier - 1) << DPLL_MD_UDI_MULTIPLIER_SHIFT; | ||
5712 | |||
5713 | bestn = crtc->config.dpll.n; | 5721 | bestn = crtc->config.dpll.n; |
5714 | bestm2_frac = crtc->config.dpll.m2 & 0x3fffff; | 5722 | bestm2_frac = crtc->config.dpll.m2 & 0x3fffff; |
5715 | bestm1 = crtc->config.dpll.m1; | 5723 | bestm1 = crtc->config.dpll.m1; |