Commit 5fbad992 authored by Maarten Lankhorst's avatar Maarten Lankhorst

drm/vmwgfx: use rcu in vmw_user_dmabuf_synccpu_grab

Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@canonical.com>
parent 39e7f6f8
...@@ -568,13 +568,17 @@ static int vmw_user_dmabuf_synccpu_grab(struct vmw_user_dma_buffer *user_bo, ...@@ -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) { if (flags & drm_vmw_synccpu_allow_cs) {
bool nonblock = !!(flags & drm_vmw_synccpu_dontblock); bool nonblock = !!(flags & drm_vmw_synccpu_dontblock);
long lret;
ret = ttm_bo_reserve(bo, true, nonblock, false, NULL); if (nonblock)
if (!ret) { return reservation_object_test_signaled_rcu(bo->resv, true) ? 0 : -EBUSY;
ret = ttm_bo_wait(bo, false, true, nonblock);
ttm_bo_unreserve(bo); lret = reservation_object_wait_timeout_rcu(bo->resv, true, true, MAX_SCHEDULE_TIMEOUT);
} if (!lret)
return ret; return -EBUSY;
else if (lret < 0)
return lret;
return 0;
} }
ret = ttm_bo_synccpu_write_grab ret = ttm_bo_synccpu_write_grab
......
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