[PATCH] drm: Don't allow legacy cursor updates to stall others or be stalled

Chris Wilson chris at chris-wilson.co.uk
Tue Aug 23 10:48:34 UTC 2016


Legacy cursor updates are entirely asynchronous with respect to all
other users of the atomic pipeline. They neither wait for any
outstanding flips, nor do they cause subsequent flips to be delayed. The
only ordering we do require is given by making the legacy cursor update
nonblocking (so the sequence of userspace calls from a process is
ordered from the pov of the client).

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 drivers/gpu/drm/drm_atomic_helper.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 9abe0a242f96..9441fb9d9637 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1422,9 +1422,11 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state,
 
 		state->crtcs[i].commit = commit;
 
-		ret = stall_checks(crtc, nonblock);
-		if (ret)
-			return ret;
+		if (!state->legacy_cursor_update) {
+			ret = stall_checks(crtc, nonblock);
+			if (ret)
+				return ret;
+		}
 
 		/* Drivers only send out events when at least either current or
 		 * new CRTC state is active. Complete right away if everything
@@ -1989,7 +1991,7 @@ void drm_atomic_helper_swap_state(struct drm_atomic_state *state,
 		swap(state->crtcs[i].state, crtc->state);
 		crtc->state->state = NULL;
 
-		if (state->crtcs[i].commit) {
+		if (state->crtcs[i].commit && !state->legacy_cursor_update) {
 			spin_lock(&crtc->commit_lock);
 			list_add(&state->crtcs[i].commit->commit_entry,
 				 &crtc->commit_list);
-- 
2.9.3



More information about the dri-devel mailing list