diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-03-22 17:50:58 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-03-29 03:59:16 -0400 |
commit | 38b6441e4e75c0b319cfe4d9364c1059fc1e3c2b (patch) | |
tree | f3a0a122ab1dd1120456ce342e8ca95d66a097b8 | |
parent | a4eff9aa6db8eb3d1864118f3558214b26f630b4 (diff) |
drm/atomic-helper: Remove the backoff hack from set_config
Another one bites the dust.
Again let's not forget to remove the temporary hidden acquire_ctx
assignment, now that we pass this all around explicitly it can go
away again.
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170322215058.8671-20-daniel.vetter@ffwll.ch
-rw-r--r-- | drivers/gpu/drm/drm_atomic_helper.c | 21 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 1 |
2 files changed, 2 insertions, 20 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index c137e39fc506..c4538c5dbc97 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c | |||
@@ -2290,32 +2290,15 @@ int drm_atomic_helper_set_config(struct drm_mode_set *set, | |||
2290 | return -ENOMEM; | 2290 | return -ENOMEM; |
2291 | 2291 | ||
2292 | state->legacy_set_config = true; | 2292 | state->legacy_set_config = true; |
2293 | state->acquire_ctx = drm_modeset_legacy_acquire_ctx(crtc); | 2293 | state->acquire_ctx = ctx; |
2294 | retry: | ||
2295 | ret = __drm_atomic_helper_set_config(set, state); | 2294 | ret = __drm_atomic_helper_set_config(set, state); |
2296 | if (ret != 0) | 2295 | if (ret != 0) |
2297 | goto fail; | 2296 | return ret; |
2298 | 2297 | ||
2299 | ret = drm_atomic_commit(state); | 2298 | ret = drm_atomic_commit(state); |
2300 | fail: | ||
2301 | if (ret == -EDEADLK) | ||
2302 | goto backoff; | ||
2303 | 2299 | ||
2304 | drm_atomic_state_put(state); | 2300 | drm_atomic_state_put(state); |
2305 | return ret; | 2301 | return ret; |
2306 | |||
2307 | backoff: | ||
2308 | drm_atomic_state_clear(state); | ||
2309 | drm_atomic_legacy_backoff(state); | ||
2310 | |||
2311 | /* | ||
2312 | * Someone might have exchanged the framebuffer while we dropped locks | ||
2313 | * in the backoff code. We need to fix up the fb refcount tracking the | ||
2314 | * core does for us. | ||
2315 | */ | ||
2316 | crtc->primary->old_fb = crtc->primary->fb; | ||
2317 | |||
2318 | goto retry; | ||
2319 | } | 2302 | } |
2320 | EXPORT_SYMBOL(drm_atomic_helper_set_config); | 2303 | EXPORT_SYMBOL(drm_atomic_helper_set_config); |
2321 | 2304 | ||
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index b3f9f178375d..d69e180fc563 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -581,7 +581,6 @@ retry: | |||
581 | ret = drm_modeset_lock_all_ctx(crtc->dev, &ctx); | 581 | ret = drm_modeset_lock_all_ctx(crtc->dev, &ctx); |
582 | if (ret) | 582 | if (ret) |
583 | goto out; | 583 | goto out; |
584 | dev->mode_config.acquire_ctx = &ctx; | ||
585 | if (crtc_req->mode_valid) { | 584 | if (crtc_req->mode_valid) { |
586 | /* If we have a mode we need a framebuffer. */ | 585 | /* If we have a mode we need a framebuffer. */ |
587 | /* If we pass -1, set the mode with the currently bound fb */ | 586 | /* If we pass -1, set the mode with the currently bound fb */ |