Commit f81183f7 authored by Daniel Vetter's avatar Daniel Vetter

drm/i915: don't save/restore DP regs for kms

We completely compute these anew in each modeset, hence we don't rely
on them containing anything valid after resume.

To avoid breaking any ums setup due to reordering of the reads/writes
simply don't reorder anything, but bracket the reads/writes into if
(!kms) conditionals. More churn, but safer.

v2: Fixup the logic, noticed by Paulo Zanoni.
Reviewed-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Tested-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 7346bfa0
......@@ -654,6 +654,7 @@ static void i915_save_display(struct drm_device *dev)
dev_priv->savePP_DIVISOR = I915_READ(PP_DIVISOR);
}
if (!drm_core_check_feature(dev, DRIVER_MODESET)) {
/* Display Port state */
if (SUPPORTS_INTEGRATED_DP(dev)) {
dev_priv->saveDP_B = I915_READ(DP_B);
......@@ -669,6 +670,7 @@ static void i915_save_display(struct drm_device *dev)
dev_priv->savePIPEB_DP_LINK_N = I915_READ(_PIPEB_DP_LINK_N);
}
/* FIXME: save TV & SDVO state */
}
/* Only save FBC state on the platform that supports FBC */
if (I915_HAS_FBC(dev)) {
......@@ -703,6 +705,7 @@ static void i915_restore_display(struct drm_device *dev)
/* Display arbitration */
I915_WRITE(DSPARB, dev_priv->saveDSPARB);
if (!drm_core_check_feature(dev, DRIVER_MODESET)) {
/* Display port ratios (must be done before clock is set) */
if (SUPPORTS_INTEGRATED_DP(dev)) {
I915_WRITE(_PIPEA_GMCH_DATA_M, dev_priv->savePIPEA_GMCH_DATA_M);
......@@ -714,6 +717,7 @@ static void i915_restore_display(struct drm_device *dev)
I915_WRITE(_PIPEA_DP_LINK_N, dev_priv->savePIPEA_DP_LINK_N);
I915_WRITE(_PIPEB_DP_LINK_N, dev_priv->savePIPEB_DP_LINK_N);
}
}
/* This is only meaningful in non-KMS mode */
/* Don't restore them in KMS mode */
......@@ -761,6 +765,7 @@ static void i915_restore_display(struct drm_device *dev)
I915_WRITE(PP_CONTROL, dev_priv->savePP_CONTROL);
}
if (!drm_core_check_feature(dev, DRIVER_MODESET)) {
/* Display Port state */
if (SUPPORTS_INTEGRATED_DP(dev)) {
I915_WRITE(DP_B, dev_priv->saveDP_B);
......@@ -768,6 +773,7 @@ static void i915_restore_display(struct drm_device *dev)
I915_WRITE(DP_D, dev_priv->saveDP_D);
}
/* FIXME: restore TV & SDVO state */
}
/* only restore FBC info on the platform that supports FBC*/
intel_disable_fbc(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment