summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2017-04-03 10:32:53 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-04-05 09:26:54 +0200
commita5b8444e289c9e759927f9bf2e82f10719729fe7 (patch)
tree45260fca22a3e155735f5690d9a6b16e78091106 /drivers
parentb260ac3ebef5eb748207cd542dba00af6c5caaa5 (diff)
drm/atomic-helper: remove modeset_lock_all from helper_resume
Atomic code rely shouldn't rely on the magic hidden acquire context. v2: Remove unused config local var (gcc). Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170403083304.9083-5-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 3160d0881348..0a3d91c51d61 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2622,14 +2622,22 @@ EXPORT_SYMBOL(drm_atomic_helper_commit_duplicated_state);
int drm_atomic_helper_resume(struct drm_device *dev,
struct drm_atomic_state *state)
{
- struct drm_mode_config *config = &dev->mode_config;
+ struct drm_modeset_acquire_ctx ctx;
int err;
drm_mode_config_reset(dev);
- drm_modeset_lock_all(dev);
- err = drm_atomic_helper_commit_duplicated_state(state, config->acquire_ctx);
- drm_modeset_unlock_all(dev);
+ drm_modeset_acquire_init(&ctx, 0);
+ while (1) {
+ err = drm_atomic_helper_commit_duplicated_state(state, &ctx);
+ if (err != -EDEADLK)
+ break;
+
+ drm_modeset_backoff(&ctx);
+ }
+
+ drm_modeset_drop_locks(&ctx);
+ drm_modeset_acquire_fini(&ctx);
return err;
}