Commit da1d0e26 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Plumb the correct acquire ctx into intel_crtc_disable_noatomic()

If intel_crtc_disable_noatomic() were to ever get called during resume
we'd end up deadlocking since resume has its own acqcuire_ctx but
intel_crtc_disable_noatomic() still tries to use the
mode_config.acquire_ctx. Pass down the correct acquire ctx from the top.

Cc: stable@vger.kernel.org
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Fixes: e2c8b870 ("drm/i915: Use atomic helpers for suspend, v2.")
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170601143619.27840-3-ville.syrjala@linux.intel.comReviewed-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
parent aecd36b8
...@@ -5841,7 +5841,8 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state, ...@@ -5841,7 +5841,8 @@ static void i9xx_crtc_disable(struct intel_crtc_state *old_crtc_state,
intel_update_watermarks(intel_crtc); intel_update_watermarks(intel_crtc);
} }
static void intel_crtc_disable_noatomic(struct drm_crtc *crtc) static void intel_crtc_disable_noatomic(struct drm_crtc *crtc,
struct drm_modeset_acquire_ctx *ctx)
{ {
struct intel_encoder *encoder; struct intel_encoder *encoder;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
...@@ -5871,7 +5872,7 @@ static void intel_crtc_disable_noatomic(struct drm_crtc *crtc) ...@@ -5871,7 +5872,7 @@ static void intel_crtc_disable_noatomic(struct drm_crtc *crtc)
return; return;
} }
state->acquire_ctx = crtc->dev->mode_config.acquire_ctx; state->acquire_ctx = ctx;
/* Everything's already locked, -EDEADLK can't happen. */ /* Everything's already locked, -EDEADLK can't happen. */
crtc_state = intel_atomic_get_crtc_state(state, intel_crtc); crtc_state = intel_atomic_get_crtc_state(state, intel_crtc);
...@@ -15272,7 +15273,7 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc, ...@@ -15272,7 +15273,7 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc,
plane = crtc->plane; plane = crtc->plane;
crtc->base.primary->state->visible = true; crtc->base.primary->state->visible = true;
crtc->plane = !plane; crtc->plane = !plane;
intel_crtc_disable_noatomic(&crtc->base); intel_crtc_disable_noatomic(&crtc->base, ctx);
crtc->plane = plane; crtc->plane = plane;
} }
...@@ -15288,7 +15289,7 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc, ...@@ -15288,7 +15289,7 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc,
/* Adjust the state of the output pipe according to whether we /* Adjust the state of the output pipe according to whether we
* have active connectors/encoders. */ * have active connectors/encoders. */
if (crtc->active && !intel_crtc_has_encoders(crtc)) if (crtc->active && !intel_crtc_has_encoders(crtc))
intel_crtc_disable_noatomic(&crtc->base); intel_crtc_disable_noatomic(&crtc->base, ctx);
if (crtc->active || HAS_GMCH_DISPLAY(dev_priv)) { if (crtc->active || HAS_GMCH_DISPLAY(dev_priv)) {
/* /*
......
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