diff mbox

drm/vgem: Switch to reservation_object_lock() helpers

Message ID 20170123095357.29514-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson Jan. 23, 2017, 9:53 a.m. UTC
For the convenience of encapsulation the reservation object's ww_mutex
was wrapped in pair of lock/unlock helpers.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/vgem/vgem_fence.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Daniel Vetter Jan. 24, 2017, 8:58 a.m. UTC | #1
On Mon, Jan 23, 2017 at 09:53:57AM +0000, Chris Wilson wrote:
> For the convenience of encapsulation the reservation object's ww_mutex
> was wrapped in pair of lock/unlock helpers.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Applied to drm-misc, thx.
-Daniel

> ---
>  drivers/gpu/drm/vgem/vgem_fence.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c
> index da25dfe7b80e..3109c8308eb5 100644
> --- a/drivers/gpu/drm/vgem/vgem_fence.c
> +++ b/drivers/gpu/drm/vgem/vgem_fence.c
> @@ -190,12 +190,12 @@ int vgem_fence_attach_ioctl(struct drm_device *dev,
>  
>  	/* Expose the fence via the dma-buf */
>  	ret = 0;
> -	ww_mutex_lock(&resv->lock, NULL);
> +	reservation_object_lock(resv, 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);
> -	ww_mutex_unlock(&resv->lock);
> +	reservation_object_unlock(resv);
>  
>  	/* Record the fence in our idr for later signaling */
>  	if (ret == 0) {
> -- 
> 2.11.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c
index da25dfe7b80e..3109c8308eb5 100644
--- a/drivers/gpu/drm/vgem/vgem_fence.c
+++ b/drivers/gpu/drm/vgem/vgem_fence.c
@@ -190,12 +190,12 @@  int vgem_fence_attach_ioctl(struct drm_device *dev,
 
 	/* Expose the fence via the dma-buf */
 	ret = 0;
-	ww_mutex_lock(&resv->lock, NULL);
+	reservation_object_lock(resv, 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);
-	ww_mutex_unlock(&resv->lock);
+	reservation_object_unlock(resv);
 
 	/* Record the fence in our idr for later signaling */
 	if (ret == 0) {