Commit 442ffefc authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter

drm/vgem: Switch to reservation_object_lock() helpers

For the convenience of encapsulation the reservation object's ww_mutex
was wrapped in pair of lock/unlock helpers.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170123095357.29514-1-chris@chris-wilson.co.uk
parent a6a9534c
...@@ -190,12 +190,12 @@ int vgem_fence_attach_ioctl(struct drm_device *dev, ...@@ -190,12 +190,12 @@ int vgem_fence_attach_ioctl(struct drm_device *dev,
/* Expose the fence via the dma-buf */ /* Expose the fence via the dma-buf */
ret = 0; ret = 0;
ww_mutex_lock(&resv->lock, NULL); reservation_object_lock(resv, NULL);
if (arg->flags & VGEM_FENCE_WRITE) if (arg->flags & VGEM_FENCE_WRITE)
reservation_object_add_excl_fence(resv, fence); reservation_object_add_excl_fence(resv, fence);
else if ((ret = reservation_object_reserve_shared(resv)) == 0) else if ((ret = reservation_object_reserve_shared(resv)) == 0)
reservation_object_add_shared_fence(resv, fence); reservation_object_add_shared_fence(resv, fence);
ww_mutex_unlock(&resv->lock); reservation_object_unlock(resv);
/* Record the fence in our idr for later signaling */ /* Record the fence in our idr for later signaling */
if (ret == 0) { if (ret == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment