aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2014-01-09 10:08:16 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-01-10 11:59:57 -0500
commite5cbfbfb2e0e44ed18cbadc02e0247bd1e60fb39 (patch)
treebcbcd31b849818bf12951651f631723a92558628
parent404faabc3f1a0e38babd9d900134fef3d41e2ae7 (diff)
drm/i915: vlv: W/a for hotplug/manual VGA detection
VGA detection requires the reference clock to be on, so make sure this is the case. This fixes VGA hotplug/manual detection where all pipes are off and so we would normally disable all clocks. v2: - Instead of disabling PSR clock gating, force the reference clock on through the DPLL_A register. (Kin Chan S <kin.s.chan@intel.com>) v3: - Move enabling of the clock to intel_reset_dpio() and use the DPLL_B register instead, where we already have a similar tweak for the CRI clock. (Ville) Reported-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_display.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 7df05112951d..fe2d71a1c39e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1374,8 +1374,12 @@ static void intel_reset_dpio(struct drm_device *dev)
1374 if (!IS_VALLEYVIEW(dev)) 1374 if (!IS_VALLEYVIEW(dev))
1375 return; 1375 return;
1376 1376
1377 /* Enable the CRI clock source so we can get at the display */ 1377 /*
1378 * Enable the CRI clock source so we can get at the display and the
1379 * reference clock for VGA hotplug / manual detection.
1380 */
1378 I915_WRITE(DPLL(PIPE_B), I915_READ(DPLL(PIPE_B)) | 1381 I915_WRITE(DPLL(PIPE_B), I915_READ(DPLL(PIPE_B)) |
1382 DPLL_REFA_CLK_ENABLE_VLV |
1379 DPLL_INTEGRATED_CRI_CLK_VLV); 1383 DPLL_INTEGRATED_CRI_CLK_VLV);
1380 1384
1381 /* 1385 /*
@@ -1504,9 +1508,12 @@ static void vlv_disable_pll(struct drm_i915_private *dev_priv, enum pipe pipe)
1504 /* Make sure the pipe isn't still relying on us */ 1508 /* Make sure the pipe isn't still relying on us */
1505 assert_pipe_disabled(dev_priv, pipe); 1509 assert_pipe_disabled(dev_priv, pipe);
1506 1510
1507 /* Leave integrated clock source enabled */ 1511 /*
1512 * Leave integrated clock source and reference clock enabled for pipe B.
1513 * The latter is needed for VGA hotplug / manual detection.
1514 */
1508 if (pipe == PIPE_B) 1515 if (pipe == PIPE_B)
1509 val = DPLL_INTEGRATED_CRI_CLK_VLV; 1516 val = DPLL_INTEGRATED_CRI_CLK_VLV | DPLL_REFA_CLK_ENABLE_VLV;
1510 I915_WRITE(DPLL(pipe), val); 1517 I915_WRITE(DPLL(pipe), val);
1511 POSTING_READ(DPLL(pipe)); 1518 POSTING_READ(DPLL(pipe));
1512} 1519}
@@ -4983,7 +4990,11 @@ static void vlv_update_pll(struct intel_crtc *crtc)
4983 4990
4984 vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW11(pipe), 0x87871000); 4991 vlv_dpio_write(dev_priv, pipe, VLV_PLL_DW11(pipe), 0x87871000);
4985 4992
4986 /* Enable DPIO clock input */ 4993 /*
4994 * Enable DPIO clock input. We should never disable the reference
4995 * clock for pipe B, since VGA hotplug / manual detection depends
4996 * on it.
4997 */
4987 dpll = DPLL_EXT_BUFFER_ENABLE_VLV | DPLL_REFA_CLK_ENABLE_VLV | 4998 dpll = DPLL_EXT_BUFFER_ENABLE_VLV | DPLL_REFA_CLK_ENABLE_VLV |
4988 DPLL_VGA_MODE_DIS | DPLL_INTEGRATED_CLOCK_VLV; 4999 DPLL_VGA_MODE_DIS | DPLL_INTEGRATED_CLOCK_VLV;
4989 /* We should never disable this, set it here for state tracking */ 5000 /* We should never disable this, set it here for state tracking */