Commit 2e2f08d0 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Take a runtime pm wakeref for atomic commits

Before we start prepping the system for an atomic modeset, wake the
device up. We then keep track of this wakeref until we complete the
atomic commit, so we hold keep the device awake for all potential HW
access, and do not allow the device to sleep with a pending modeset.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110771Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190528075354.22341-1-chris@chris-wilson.co.uk
parent 1ac159e2
...@@ -13834,6 +13834,7 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state) ...@@ -13834,6 +13834,7 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
intel_uncore_arm_unclaimed_mmio_detection(&dev_priv->uncore); intel_uncore_arm_unclaimed_mmio_detection(&dev_priv->uncore);
intel_display_power_put(dev_priv, POWER_DOMAIN_MODESET, wakeref); intel_display_power_put(dev_priv, POWER_DOMAIN_MODESET, wakeref);
} }
intel_runtime_pm_put(dev_priv, intel_state->wakeref);
/* /*
* Defer the cleanup of the old state to a separate worker to not * Defer the cleanup of the old state to a separate worker to not
...@@ -13912,6 +13913,8 @@ static int intel_atomic_commit(struct drm_device *dev, ...@@ -13912,6 +13913,8 @@ static int intel_atomic_commit(struct drm_device *dev,
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
int ret = 0; int ret = 0;
intel_state->wakeref = intel_runtime_pm_get(dev_priv);
drm_atomic_state_get(state); drm_atomic_state_get(state);
i915_sw_fence_init(&intel_state->commit_ready, i915_sw_fence_init(&intel_state->commit_ready,
intel_atomic_commit_ready); intel_atomic_commit_ready);
...@@ -13948,6 +13951,7 @@ static int intel_atomic_commit(struct drm_device *dev, ...@@ -13948,6 +13951,7 @@ static int intel_atomic_commit(struct drm_device *dev,
if (ret) { if (ret) {
DRM_DEBUG_ATOMIC("Preparing state failed with %i\n", ret); DRM_DEBUG_ATOMIC("Preparing state failed with %i\n", ret);
i915_sw_fence_commit(&intel_state->commit_ready); i915_sw_fence_commit(&intel_state->commit_ready);
intel_runtime_pm_put(dev_priv, intel_state->wakeref);
return ret; return ret;
} }
...@@ -13959,6 +13963,7 @@ static int intel_atomic_commit(struct drm_device *dev, ...@@ -13959,6 +13963,7 @@ static int intel_atomic_commit(struct drm_device *dev,
i915_sw_fence_commit(&intel_state->commit_ready); i915_sw_fence_commit(&intel_state->commit_ready);
drm_atomic_helper_cleanup_planes(dev, state); drm_atomic_helper_cleanup_planes(dev, state);
intel_runtime_pm_put(dev_priv, intel_state->wakeref);
return ret; return ret;
} }
dev_priv->wm.distrust_bios_wm = false; dev_priv->wm.distrust_bios_wm = false;
......
...@@ -420,6 +420,8 @@ struct dpll { ...@@ -420,6 +420,8 @@ struct dpll {
struct intel_atomic_state { struct intel_atomic_state {
struct drm_atomic_state base; struct drm_atomic_state base;
intel_wakeref_t wakeref;
struct { struct {
/* /*
* Logical state of cdclk (used for all scaling, watermark, * Logical state of cdclk (used for all scaling, watermark,
......
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