diff options
author | Jakob Bornecrantz <jakob@vmware.com> | 2012-02-09 10:56:43 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-02-13 07:01:33 -0500 |
commit | bb1bd2f43ee15386a1c3f96cbcbb9302a9994443 (patch) | |
tree | 0ac02905936728ea596a768c3b8c97b406e789fd /drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | |
parent | 6b82ef50d8617f3fcd51dda9d89d973fe3bc65b8 (diff) |
vmwgfx: Make it possible to get fence from execbuf
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c')
-rw-r--r-- | drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c index 40932fbdac0f..4acced44a623 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c | |||
@@ -1109,10 +1109,11 @@ int vmw_execbuf_process(struct drm_file *file_priv, | |||
1109 | void *kernel_commands, | 1109 | void *kernel_commands, |
1110 | uint32_t command_size, | 1110 | uint32_t command_size, |
1111 | uint64_t throttle_us, | 1111 | uint64_t throttle_us, |
1112 | struct drm_vmw_fence_rep __user *user_fence_rep) | 1112 | struct drm_vmw_fence_rep __user *user_fence_rep, |
1113 | struct vmw_fence_obj **out_fence) | ||
1113 | { | 1114 | { |
1114 | struct vmw_sw_context *sw_context = &dev_priv->ctx; | 1115 | struct vmw_sw_context *sw_context = &dev_priv->ctx; |
1115 | struct vmw_fence_obj *fence; | 1116 | struct vmw_fence_obj *fence = NULL; |
1116 | uint32_t handle; | 1117 | uint32_t handle; |
1117 | void *cmd; | 1118 | void *cmd; |
1118 | int ret; | 1119 | int ret; |
@@ -1208,8 +1209,13 @@ int vmw_execbuf_process(struct drm_file *file_priv, | |||
1208 | vmw_execbuf_copy_fence_user(dev_priv, vmw_fpriv(file_priv), ret, | 1209 | vmw_execbuf_copy_fence_user(dev_priv, vmw_fpriv(file_priv), ret, |
1209 | user_fence_rep, fence, handle); | 1210 | user_fence_rep, fence, handle); |
1210 | 1211 | ||
1211 | if (likely(fence != NULL)) | 1212 | /* Don't unreference when handing fence out */ |
1213 | if (unlikely(out_fence != NULL)) { | ||
1214 | *out_fence = fence; | ||
1215 | fence = NULL; | ||
1216 | } else if (likely(fence != NULL)) { | ||
1212 | vmw_fence_obj_unreference(&fence); | 1217 | vmw_fence_obj_unreference(&fence); |
1218 | } | ||
1213 | 1219 | ||
1214 | mutex_unlock(&dev_priv->cmdbuf_mutex); | 1220 | mutex_unlock(&dev_priv->cmdbuf_mutex); |
1215 | return 0; | 1221 | return 0; |
@@ -1362,7 +1368,8 @@ int vmw_execbuf_ioctl(struct drm_device *dev, void *data, | |||
1362 | ret = vmw_execbuf_process(file_priv, dev_priv, | 1368 | ret = vmw_execbuf_process(file_priv, dev_priv, |
1363 | (void __user *)(unsigned long)arg->commands, | 1369 | (void __user *)(unsigned long)arg->commands, |
1364 | NULL, arg->command_size, arg->throttle_us, | 1370 | NULL, arg->command_size, arg->throttle_us, |
1365 | (void __user *)(unsigned long)arg->fence_rep); | 1371 | (void __user *)(unsigned long)arg->fence_rep, |
1372 | NULL); | ||
1366 | 1373 | ||
1367 | if (unlikely(ret != 0)) | 1374 | if (unlikely(ret != 0)) |
1368 | goto out_unlock; | 1375 | goto out_unlock; |