diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-04-02 17:42:31 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-04-03 05:29:26 -0400 |
commit | 03afc4a2618e579eab402d0b4e8b035bd873286a (patch) | |
tree | 8f93b54602b716c2174fa257b93528449be8160d /drivers/gpu/drm/i915/intel_display.c | |
parent | 6cf86a5e7acd8731fa90ce24e777f684335218dc (diff) |
drm/i915: move dp_m_n computation to dp_encoder->compute_config
We need a flag to designate dp encoders and the dp link m_n parameters
in the pipe config for that. And now that the pipe bpp computations
have been moved up and stored in the pipe config, too, we can do this
without losing our sanity.
v2: Rebased on top of Takashi Iwai's fix to (again) fix the target
clock handling for eDP. Luckily the new code is sane enough and just
does the right thing!
v3: Move ->has_dp_encoder to this patch (Jesse).
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, 16 insertions, 14 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 06dacca8257c..21d8a20d9920 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -4202,6 +4202,14 @@ static void i9xx_update_pll_dividers(struct drm_crtc *crtc, | |||
4202 | } | 4202 | } |
4203 | } | 4203 | } |
4204 | 4204 | ||
4205 | static void intel_dp_set_m_n(struct intel_crtc *crtc) | ||
4206 | { | ||
4207 | if (crtc->config.has_pch_encoder) | ||
4208 | intel_pch_transcoder_set_m_n(crtc, &crtc->config.dp_m_n); | ||
4209 | else | ||
4210 | intel_cpu_transcoder_set_m_n(crtc, &crtc->config.dp_m_n); | ||
4211 | } | ||
4212 | |||
4205 | static void vlv_update_pll(struct drm_crtc *crtc, | 4213 | static void vlv_update_pll(struct drm_crtc *crtc, |
4206 | intel_clock_t *clock, intel_clock_t *reduced_clock, | 4214 | intel_clock_t *clock, intel_clock_t *reduced_clock, |
4207 | int num_connectors) | 4215 | int num_connectors) |
@@ -4209,9 +4217,6 @@ static void vlv_update_pll(struct drm_crtc *crtc, | |||
4209 | struct drm_device *dev = crtc->dev; | 4217 | struct drm_device *dev = crtc->dev; |
4210 | struct drm_i915_private *dev_priv = dev->dev_private; | 4218 | struct drm_i915_private *dev_priv = dev->dev_private; |
4211 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 4219 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
4212 | struct drm_display_mode *adjusted_mode = | ||
4213 | &intel_crtc->config.adjusted_mode; | ||
4214 | struct drm_display_mode *mode = &intel_crtc->config.requested_mode; | ||
4215 | int pipe = intel_crtc->pipe; | 4220 | int pipe = intel_crtc->pipe; |
4216 | u32 dpll, mdiv, pdiv; | 4221 | u32 dpll, mdiv, pdiv; |
4217 | u32 bestn, bestm1, bestm2, bestp1, bestp2; | 4222 | u32 bestn, bestm1, bestm2, bestp1, bestp2; |
@@ -4267,8 +4272,8 @@ static void vlv_update_pll(struct drm_crtc *crtc, | |||
4267 | 4272 | ||
4268 | intel_dpio_write(dev_priv, DPIO_FASTCLK_DISABLE, 0x620); | 4273 | intel_dpio_write(dev_priv, DPIO_FASTCLK_DISABLE, 0x620); |
4269 | 4274 | ||
4270 | if (intel_pipe_has_type(crtc, INTEL_OUTPUT_DISPLAYPORT)) | 4275 | if (intel_crtc->config.has_dp_encoder) |
4271 | intel_dp_set_m_n(crtc, mode, adjusted_mode); | 4276 | intel_dp_set_m_n(intel_crtc); |
4272 | 4277 | ||
4273 | I915_WRITE(DPLL(pipe), dpll); | 4278 | I915_WRITE(DPLL(pipe), dpll); |
4274 | 4279 | ||
@@ -4314,9 +4319,6 @@ static void i9xx_update_pll(struct drm_crtc *crtc, | |||
4314 | struct drm_device *dev = crtc->dev; | 4319 | struct drm_device *dev = crtc->dev; |
4315 | struct drm_i915_private *dev_priv = dev->dev_private; | 4320 | struct drm_i915_private *dev_priv = dev->dev_private; |
4316 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 4321 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
4317 | struct drm_display_mode *adjusted_mode = | ||
4318 | &intel_crtc->config.adjusted_mode; | ||
4319 | struct drm_display_mode *mode = &intel_crtc->config.requested_mode; | ||
4320 | struct intel_encoder *encoder; | 4322 | struct intel_encoder *encoder; |
4321 | int pipe = intel_crtc->pipe; | 4323 | int pipe = intel_crtc->pipe; |
4322 | u32 dpll; | 4324 | u32 dpll; |
@@ -4391,8 +4393,8 @@ static void i9xx_update_pll(struct drm_crtc *crtc, | |||
4391 | if (encoder->pre_pll_enable) | 4393 | if (encoder->pre_pll_enable) |
4392 | encoder->pre_pll_enable(encoder); | 4394 | encoder->pre_pll_enable(encoder); |
4393 | 4395 | ||
4394 | if (intel_pipe_has_type(crtc, INTEL_OUTPUT_DISPLAYPORT)) | 4396 | if (intel_crtc->config.has_dp_encoder) |
4395 | intel_dp_set_m_n(crtc, mode, adjusted_mode); | 4397 | intel_dp_set_m_n(intel_crtc); |
4396 | 4398 | ||
4397 | I915_WRITE(DPLL(pipe), dpll); | 4399 | I915_WRITE(DPLL(pipe), dpll); |
4398 | 4400 | ||
@@ -5647,8 +5649,8 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, | |||
5647 | } else | 5649 | } else |
5648 | intel_put_pch_pll(intel_crtc); | 5650 | intel_put_pch_pll(intel_crtc); |
5649 | 5651 | ||
5650 | if (is_dp) | 5652 | if (intel_crtc->config.has_dp_encoder) |
5651 | intel_dp_set_m_n(crtc, mode, adjusted_mode); | 5653 | intel_dp_set_m_n(intel_crtc); |
5652 | 5654 | ||
5653 | for_each_encoder_on_crtc(dev, crtc, encoder) | 5655 | for_each_encoder_on_crtc(dev, crtc, encoder) |
5654 | if (encoder->pre_pll_enable) | 5656 | if (encoder->pre_pll_enable) |
@@ -5797,8 +5799,8 @@ static int haswell_crtc_mode_set(struct drm_crtc *crtc, | |||
5797 | DRM_DEBUG_KMS("Mode for pipe %d:\n", pipe); | 5799 | DRM_DEBUG_KMS("Mode for pipe %d:\n", pipe); |
5798 | drm_mode_debug_printmodeline(mode); | 5800 | drm_mode_debug_printmodeline(mode); |
5799 | 5801 | ||
5800 | if (is_dp) | 5802 | if (intel_crtc->config.has_dp_encoder) |
5801 | intel_dp_set_m_n(crtc, mode, adjusted_mode); | 5803 | intel_dp_set_m_n(intel_crtc); |
5802 | 5804 | ||
5803 | intel_crtc->lowfreq_avail = false; | 5805 | intel_crtc->lowfreq_avail = false; |
5804 | 5806 | ||