drm: Fix locking gotcha in page_flip ioctl
authorDaniel Vetter <[email protected]>
Thu, 30 Mar 2017 20:48:31 +0000 (22:48 +0200)
committerEric Anholt <[email protected]>
Fri, 31 Mar 2017 00:28:24 +0000 (17:28 -0700)
We want to lock the primary plane, not the cursor (which might be
optional). Real bad case of copy-paste fail, unfortunately our CI
didn't catch that because i915 does have a cursor plane.

Reported-by: Eric Anholt <[email protected]>
Fixes: 29dc0d1de182 ("drm: Roll out acquire context for the page_flip ioctl")
Cc: Jani Nikula <[email protected]>
Cc: Sean Paul <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Tested-by: Eric Anholt <[email protected]>
Reviewed-by: Harry Wentland <[email protected]>
drivers/gpu/drm/drm_plane.c

index 5eca3184a74786dd3e747ffa0a6fc26fbe698a49..bc71aa2b78728d1c241682ce9eee852faafade13 100644 (file)
@@ -872,7 +872,7 @@ retry:
        ret = drm_modeset_lock(&crtc->mutex, &ctx);
        if (ret)
                goto out;
-       ret = drm_modeset_lock(&crtc->cursor->mutex, &ctx);
+       ret = drm_modeset_lock(&crtc->primary->mutex, &ctx);
        if (ret)
                goto out;