Skip to content

Commit

Permalink
drm: Fix locking gotcha in page_flip ioctl
Browse files Browse the repository at this point in the history
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 <eric@anholt.net>
Fixes: 29dc0d1 ("drm: Roll out acquire context for the page_flip ioctl")
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170330204831.8225-1-daniel.vetter@ffwll.ch
Tested-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
  • Loading branch information
Daniel Vetter authored and Eric Anholt committed Mar 31, 2017
1 parent bcd2ba0 commit 9739e74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ int drm_mode_page_flip_ioctl(struct drm_device *dev,
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;

Expand Down

0 comments on commit 9739e74

Please sign in to comment.