aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2013-10-03 14:35:46 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-10-04 04:17:04 -0400
commit40e9cf649a88abea96d5756aa6f86e89cfabde6e (patch)
treee477735291fde811d960e9d103a2eb8cd72f4f7b
parenta031d709bb90ce72cc016d242e8c1fef65ae9d5c (diff)
drm/i915/vlv: reset DPIO on load and resume v2
DPIO needs to have common reset de-asserted on soft resets like boot and S3. In some cases, the BIOS will have done this for us, but it should be safe to do at runtime as well, as long as we do it when the pipes are otherwise off. v2: update bit name to match docs better (Ville) reset after CRI clock select (Ville) References: https://bugs.freedesktop.org/show_bug.cgi?id=69166 Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> 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/i915_reg.h2
-rw-r--r--drivers/gpu/drm/i915/intel_display.c22
2 files changed, 23 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index daaabe788f21..c1017431fa5b 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -430,7 +430,7 @@
430#define DPIO_MODSEL1 (1<<3) /* if ref clk b == 27 */ 430#define DPIO_MODSEL1 (1<<3) /* if ref clk b == 27 */
431#define DPIO_MODSEL0 (1<<2) /* if ref clk a == 27 */ 431#define DPIO_MODSEL0 (1<<2) /* if ref clk a == 27 */
432#define DPIO_SFR_BYPASS (1<<1) 432#define DPIO_SFR_BYPASS (1<<1)
433#define DPIO_RESET (1<<0) 433#define DPIO_CMNRST (1<<0)
434 434
435#define _DPIO_TX3_SWING_CTL4_A 0x690 435#define _DPIO_TX3_SWING_CTL4_A 0x690
436#define _DPIO_TX3_SWING_CTL4_B 0x2a90 436#define _DPIO_TX3_SWING_CTL4_B 0x2a90
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 169d6825f9e5..214984c814e8 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1360,6 +1360,26 @@ static void assert_pch_ports_disabled(struct drm_i915_private *dev_priv,
1360 assert_pch_hdmi_disabled(dev_priv, pipe, PCH_HDMID); 1360 assert_pch_hdmi_disabled(dev_priv, pipe, PCH_HDMID);
1361} 1361}
1362 1362
1363static void intel_init_dpio(struct drm_device *dev)
1364{
1365 struct drm_i915_private *dev_priv = dev->dev_private;
1366
1367 if (!IS_VALLEYVIEW(dev))
1368 return;
1369
1370 /*
1371 * From VLV2A0_DP_eDP_DPIO_driver_vbios_notes_10.docx -
1372 * 6. De-assert cmn_reset/side_reset. Same as VLV X0.
1373 * a. GUnit 0x2110 bit[0] set to 1 (def 0)
1374 * b. The other bits such as sfr settings / modesel may all be set
1375 * to 0.
1376 *
1377 * This should only be done on init and resume from S3 with both
1378 * PLLs disabled, or we risk losing DPIO and PLL synchronization.
1379 */
1380 I915_WRITE(DPIO_CTL, I915_READ(DPIO_CTL) | DPIO_CMNRST);
1381}
1382
1363static void vlv_enable_pll(struct intel_crtc *crtc) 1383static void vlv_enable_pll(struct intel_crtc *crtc)
1364{ 1384{
1365 struct drm_device *dev = crtc->base.dev; 1385 struct drm_device *dev = crtc->base.dev;
@@ -10370,6 +10390,8 @@ void intel_modeset_init_hw(struct drm_device *dev)
10370 I915_WRITE(DPLL(PIPE_B), I915_READ(DPLL(PIPE_B)) | 10390 I915_WRITE(DPLL(PIPE_B), I915_READ(DPLL(PIPE_B)) |
10371 DPLL_INTEGRATED_CRI_CLK_VLV); 10391 DPLL_INTEGRATED_CRI_CLK_VLV);
10372 10392
10393 intel_init_dpio(dev);
10394
10373 mutex_lock(&dev->struct_mutex); 10395 mutex_lock(&dev->struct_mutex);
10374 intel_enable_gt_powersave(dev); 10396 intel_enable_gt_powersave(dev);
10375 mutex_unlock(&dev->struct_mutex); 10397 mutex_unlock(&dev->struct_mutex);