summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@canonical.com>2014-05-14 17:41:49 +0400
committerMaarten Lankhorst <maarten.lankhorst@canonical.com>2014-09-02 19:28:47 +0400
commit5fbad9928faf93f69903c8662ec9874ac4a0754e (patch)
tree371d73245753e3d944dbdc1685da897d4263a5e2 /drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
parent39e7f6f84b3a3aa4520504473f2e2bac1f949ffa (diff)
downloadlinux-5fbad9928faf93f69903c8662ec9874ac4a0754e.tar.xz
drm/vmwgfx: use rcu in vmw_user_dmabuf_synccpu_grab
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_resource.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_resource.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
index 98d5afd9a9df..ff0e03b97753 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
@@ -568,13 +568,17 @@ static int vmw_user_dmabuf_synccpu_grab(struct vmw_user_dma_buffer *user_bo,
if (flags & drm_vmw_synccpu_allow_cs) {
bool nonblock = !!(flags & drm_vmw_synccpu_dontblock);
+ long lret;
- ret = ttm_bo_reserve(bo, true, nonblock, false, NULL);
- if (!ret) {
- ret = ttm_bo_wait(bo, false, true, nonblock);
- ttm_bo_unreserve(bo);
- }
- return ret;
+ if (nonblock)
+ return reservation_object_test_signaled_rcu(bo->resv, true) ? 0 : -EBUSY;
+
+ lret = reservation_object_wait_timeout_rcu(bo->resv, true, true, MAX_SCHEDULE_TIMEOUT);
+ if (!lret)
+ return -EBUSY;
+ else if (lret < 0)
+ return lret;
+ return 0;
}
ret = ttm_bo_synccpu_write_grab