[PATCH 2/3] drm: Move atomic_state_put after locks are dropped

Sean Paul sean at poorly.run
Tue Nov 27 22:46:39 UTC 2018


From: Sean Paul <seanpaul at chromium.org>

drm_atomic_state_put doesn't require any locking, and this makes things
easier for switching to modeset_lock_all helpers in a future patch

Cc: Daniel Vetter <daniel at ffwll.ch>
Signed-off-by: Sean Paul <seanpaul at chromium.org>
---
 drivers/gpu/drm/drm_atomic_helper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index fe8dd8aa4ae40..15a75b9f185fa 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -3286,9 +3286,10 @@ int drm_atomic_helper_resume(struct drm_device *dev,
 		drm_modeset_backoff(&ctx);
 	}
 
-	drm_atomic_state_put(state);
+	state->acquire_ctx = NULL;
 	drm_modeset_drop_locks(&ctx);
 	drm_modeset_acquire_fini(&ctx);
+	drm_atomic_state_put(state);
 
 	return err;
 }
-- 
Sean Paul, Software Engineer, Google / Chromium OS



More information about the dri-devel mailing list