diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2013-10-01 13:41:38 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-10-03 14:01:06 -0400 |
commit | f60711666bcab6df2c6c91d851e07ed54088453c (patch) | |
tree | 841f8e01dd952b19c6e96d3d55a84a59d933b2f3 /drivers/gpu/drm/i915/intel_display.c | |
parent | 492ab6697c9ff40be43591c8254cbb5b9753b1dc (diff) |
i915/vlv: untangle integrated clock source handling v4
The global integrated clock source bit resides in DPLL B on VLV, but we
were treating it as a per-pipe resource. It needs to be set whenever
any PLL is active, so pull setting the bit out of vlv_update_pll and
into vlv_enable_pll. Also add a vlv_disable_pll to prevent disabling it
when pipe B shuts down.
I'm guessing on the references here, I expect this to bite any config
where multiple displays are active or displays are moved from pipe to
pipe.
v2: re-add bits in vlv_update_pll to keep from confusing the state checker
v3: use enum pipe checks (Daniel)
set CRI clock source early (Ville)
consistently set CRI clock source everywhere (Ville)
v4: drop unnecessary setting of bit in vlv enable pll (Ville)
References: https://bugs.freedesktop.org/show_bug.cgi?id=67245
References: https://bugs.freedesktop.org/show_bug.cgi?id=69693
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
[danvet: s/1/PIPE_B/]
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 | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 29b938779812..99efbe51d7ce 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -1466,6 +1466,20 @@ static void i9xx_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe) | |||
1466 | POSTING_READ(DPLL(pipe)); | 1466 | POSTING_READ(DPLL(pipe)); |
1467 | } | 1467 | } |
1468 | 1468 | ||
1469 | static void vlv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe) | ||
1470 | { | ||
1471 | u32 val = 0; | ||
1472 | |||
1473 | /* Make sure the pipe isn't still relying on us */ | ||
1474 | assert_pipe_disabled(dev_priv, pipe); | ||
1475 | |||
1476 | /* Leave integrated clock source enabled */ | ||
1477 | if (pipe == PIPE_B) | ||
1478 | val = DPLL_INTEGRATED_CRI_CLK_VLV; | ||
1479 | I915_WRITE(DPLL(pipe), val); | ||
1480 | POSTING_READ(DPLL(pipe)); | ||
1481 | } | ||
1482 | |||
1469 | void vlv_wait_port_ready(struct drm_i915_private *dev_priv, int port) | 1483 | void vlv_wait_port_ready(struct drm_i915_private *dev_priv, int port) |
1470 | { | 1484 | { |
1471 | u32 port_mask; | 1485 | u32 port_mask; |
@@ -3875,7 +3889,9 @@ static void i9xx_crtc_disable(struct drm_crtc *crtc) | |||
3875 | if (encoder->post_disable) | 3889 | if (encoder->post_disable) |
3876 | encoder->post_disable(encoder); | 3890 | encoder->post_disable(encoder); |
3877 | 3891 | ||
3878 | if (!intel_pipe_has_type(crtc, INTEL_OUTPUT_DSI)) | 3892 | if (IS_VALLEYVIEW(dev) && !intel_pipe_has_type(crtc, INTEL_OUTPUT_DSI)) |
3893 | vlv_disable_pll(dev_priv, pipe); | ||
3894 | else if (!IS_VALLEYVIEW(dev)) | ||
3879 | i9xx_disable_pll(dev_priv, pipe); | 3895 | i9xx_disable_pll(dev_priv, pipe); |
3880 | 3896 | ||
3881 | intel_crtc->active = false; | 3897 | intel_crtc->active = false; |
@@ -4615,9 +4631,9 @@ static void vlv_update_pll(struct intel_crtc *crtc) | |||
4615 | /* Enable DPIO clock input */ | 4631 | /* Enable DPIO clock input */ |
4616 | dpll = DPLL_EXT_BUFFER_ENABLE_VLV | DPLL_REFA_CLK_ENABLE_VLV | | 4632 | dpll = DPLL_EXT_BUFFER_ENABLE_VLV | DPLL_REFA_CLK_ENABLE_VLV | |
4617 | DPLL_VGA_MODE_DIS | DPLL_INTEGRATED_CLOCK_VLV; | 4633 | DPLL_VGA_MODE_DIS | DPLL_INTEGRATED_CLOCK_VLV; |
4618 | if (pipe) | 4634 | /* We should never disable this, set it here for state tracking */ |
4635 | if (pipe == PIPE_B) | ||
4619 | dpll |= DPLL_INTEGRATED_CRI_CLK_VLV; | 4636 | dpll |= DPLL_INTEGRATED_CRI_CLK_VLV; |
4620 | |||
4621 | dpll |= DPLL_VCO_ENABLE; | 4637 | dpll |= DPLL_VCO_ENABLE; |
4622 | crtc->config.dpll_hw_state.dpll = dpll; | 4638 | crtc->config.dpll_hw_state.dpll = dpll; |
4623 | 4639 | ||
@@ -10279,10 +10295,17 @@ void i915_disable_vga_mem(struct drm_device *dev) | |||
10279 | 10295 | ||
10280 | void intel_modeset_init_hw(struct drm_device *dev) | 10296 | void intel_modeset_init_hw(struct drm_device *dev) |
10281 | { | 10297 | { |
10298 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
10299 | |||
10282 | intel_prepare_ddi(dev); | 10300 | intel_prepare_ddi(dev); |
10283 | 10301 | ||
10284 | intel_init_clock_gating(dev); | 10302 | intel_init_clock_gating(dev); |
10285 | 10303 | ||
10304 | /* Enable the CRI clock source so we can get at the display */ | ||
10305 | if (IS_VALLEYVIEW(dev)) | ||
10306 | I915_WRITE(DPLL(PIPE_B), I915_READ(DPLL(PIPE_B)) | | ||
10307 | DPLL_INTEGRATED_CRI_CLK_VLV); | ||
10308 | |||
10286 | mutex_lock(&dev->struct_mutex); | 10309 | mutex_lock(&dev->struct_mutex); |
10287 | intel_enable_gt_powersave(dev); | 10310 | intel_enable_gt_powersave(dev); |
10288 | mutex_unlock(&dev->struct_mutex); | 10311 | mutex_unlock(&dev->struct_mutex); |