Commit aab9094b authored by Maarten Lankhorst's avatar Maarten Lankhorst

drm/i915: Do not use lock all in hsw_trans_edp_pipe_A_crc_wa

There is no need to acquire all locks here,
doing a commit after forcing a modeset on the affected crtc
is enough. Any other locks needed will be acquired as needed.
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1491312297-18673-1-git-send-email-maarten.lankhorst@linux.intel.comReviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent c50b4bf6
...@@ -513,16 +513,20 @@ static void hsw_trans_edp_pipe_A_crc_wa(struct drm_i915_private *dev_priv, ...@@ -513,16 +513,20 @@ static void hsw_trans_edp_pipe_A_crc_wa(struct drm_i915_private *dev_priv,
struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_A); struct intel_crtc *crtc = intel_get_crtc_for_pipe(dev_priv, PIPE_A);
struct intel_crtc_state *pipe_config; struct intel_crtc_state *pipe_config;
struct drm_atomic_state *state; struct drm_atomic_state *state;
struct drm_modeset_acquire_ctx ctx;
int ret = 0; int ret = 0;
drm_modeset_lock_all(dev); drm_modeset_acquire_init(&ctx, 0);
state = drm_atomic_state_alloc(dev); state = drm_atomic_state_alloc(dev);
if (!state) { if (!state) {
ret = -ENOMEM; ret = -ENOMEM;
goto unlock; goto unlock;
} }
state->acquire_ctx = crtc->base.dev->mode_config.acquire_ctx; state->acquire_ctx = &ctx;
retry:
pipe_config = intel_atomic_get_crtc_state(state, crtc); pipe_config = intel_atomic_get_crtc_state(state, crtc);
if (IS_ERR(pipe_config)) { if (IS_ERR(pipe_config)) {
ret = PTR_ERR(pipe_config); ret = PTR_ERR(pipe_config);
...@@ -537,10 +541,17 @@ static void hsw_trans_edp_pipe_A_crc_wa(struct drm_i915_private *dev_priv, ...@@ -537,10 +541,17 @@ static void hsw_trans_edp_pipe_A_crc_wa(struct drm_i915_private *dev_priv,
ret = drm_atomic_commit(state); ret = drm_atomic_commit(state);
put_state: put_state:
if (ret == -EDEADLK) {
drm_atomic_state_clear(state);
drm_modeset_backoff(&ctx);
goto retry;
}
drm_atomic_state_put(state); drm_atomic_state_put(state);
unlock: unlock:
WARN(ret, "Toggling workaround to %i returns %i\n", enable, ret); WARN(ret, "Toggling workaround to %i returns %i\n", enable, ret);
drm_modeset_unlock_all(dev); drm_modeset_drop_locks(&ctx);
drm_modeset_acquire_fini(&ctx);
} }
static int ivb_pipe_crc_ctl_reg(struct drm_i915_private *dev_priv, static int ivb_pipe_crc_ctl_reg(struct drm_i915_private *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