提交 dd9f31c7 编写于 作者: I Imre Deak

drm/i915/gen9+: Set same power state before hibernation image save/restore

Atm, on GEN9 big core platforms before saving the hibernation image we
uninitialize the display, disabling power wells manually, while before
restoring the image we keep things powered (letting HW/DMC power down
things as needed). The state mismatch will trigger the following error:

DC state mismatch (0x0 -> 0x2)

While the restore handler knows how to initialize the display from an
unknown state (due to a different loader kernel or not having i915
loaded in the loader kernel) we should still use the same state for
consistency before image saving and restoring. Do this by uniniting the
display before restoring the image too.

Bugzilla: https://bugs.freedesktop.org/attachment.cgi?id=133376Reported-and-tested-by: NWang Wendy <wendy.wang@intel.com>
Reported-and-tested-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Wang Wendy <wendy.wang@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: NImre Deak <imre.deak@intel.com>
Reviewed-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170816144607.9935-1-imre.deak@intel.com
上级 097a9481
...@@ -1580,7 +1580,7 @@ static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation) ...@@ -1580,7 +1580,7 @@ static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation)
intel_display_set_init_power(dev_priv, false); intel_display_set_init_power(dev_priv, false);
fw_csr = !IS_GEN9_LP(dev_priv) && fw_csr = !IS_GEN9_LP(dev_priv) && !hibernation &&
suspend_to_idle(dev_priv) && dev_priv->csr.dmc_payload; suspend_to_idle(dev_priv) && dev_priv->csr.dmc_payload;
/* /*
* In case of firmware assisted context save/restore don't manually * In case of firmware assisted context save/restore don't manually
...@@ -2070,11 +2070,14 @@ static int i915_pm_resume(struct device *kdev) ...@@ -2070,11 +2070,14 @@ static int i915_pm_resume(struct device *kdev)
/* freeze: before creating the hibernation_image */ /* freeze: before creating the hibernation_image */
static int i915_pm_freeze(struct device *kdev) static int i915_pm_freeze(struct device *kdev)
{ {
struct drm_device *dev = &kdev_to_i915(kdev)->drm;
int ret; int ret;
ret = i915_pm_suspend(kdev); if (dev->switch_power_state != DRM_SWITCH_POWER_OFF) {
if (ret) ret = i915_drm_suspend(dev);
return ret; if (ret)
return ret;
}
ret = i915_gem_freeze(kdev_to_i915(kdev)); ret = i915_gem_freeze(kdev_to_i915(kdev));
if (ret) if (ret)
...@@ -2085,11 +2088,14 @@ static int i915_pm_freeze(struct device *kdev) ...@@ -2085,11 +2088,14 @@ static int i915_pm_freeze(struct device *kdev)
static int i915_pm_freeze_late(struct device *kdev) static int i915_pm_freeze_late(struct device *kdev)
{ {
struct drm_device *dev = &kdev_to_i915(kdev)->drm;
int ret; int ret;
ret = i915_pm_suspend_late(kdev); if (dev->switch_power_state != DRM_SWITCH_POWER_OFF) {
if (ret) ret = i915_drm_suspend_late(dev, true);
return ret; if (ret)
return ret;
}
ret = i915_gem_freeze_late(kdev_to_i915(kdev)); ret = i915_gem_freeze_late(kdev_to_i915(kdev));
if (ret) if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册