Skip to content

Commit

Permalink
drm/vgem: Use ww_mutex_(un)lock even with a NULL context
Browse files Browse the repository at this point in the history
v2: use resv->lock instead of resv->lock.base (Christian König)

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Maarten Lankhorst <dev@mblankhorst.nl>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Nicolai Hähnle <Nicolai.Haehnle@amd.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1480601214-26583-2-git-send-email-nhaehnle@gmail.com
  • Loading branch information
Nicolai Hähnle authored and Daniel Vetter committed Dec 2, 2016
1 parent 949f088 commit ad12310
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/vgem/vgem_fence.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ int vgem_fence_attach_ioctl(struct drm_device *dev,

/* Expose the fence via the dma-buf */
ret = 0;
mutex_lock(&resv->lock.base);
ww_mutex_lock(&resv->lock, NULL);
if (arg->flags & VGEM_FENCE_WRITE)
reservation_object_add_excl_fence(resv, fence);
else if ((ret = reservation_object_reserve_shared(resv)) == 0)
reservation_object_add_shared_fence(resv, fence);
mutex_unlock(&resv->lock.base);
ww_mutex_unlock(&resv->lock);

/* Record the fence in our idr for later signaling */
if (ret == 0) {
Expand Down

0 comments on commit ad12310

Please sign in to comment.