aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2011-08-31 03:42:54 -0400
committerDave Airlie <airlied@redhat.com>2011-09-01 04:37:55 -0400
commitbe38ab6ea7b0de0542a0ff78690d63bb22f66a4d (patch)
tree10fa0d9106caca66d67229e47e0037d453274461 /drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
parent0bef23f9180b43e805ce4dabb90b24a0b558721c (diff)
vmwgfx: Fix potential execbuf deadlocks
Perform all command stream validation in a bounce buffer separate from the fifo. This makes the fifo available to all validation-generated commands, which would otherwise attempt to grab the fifo recursively, causing a deadlock. This is in preparation for GMR2 and swappable surfaces. Also maintain references to all surfaces in the command stream until the command stream has been fired in order to avoid racing with surface destruction taking place after validation but before submission. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_resource.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_resource.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
index bfe1bcce7f8a..dc8904a1c1e1 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
@@ -364,7 +364,8 @@ out_err:
364 364
365int vmw_context_check(struct vmw_private *dev_priv, 365int vmw_context_check(struct vmw_private *dev_priv,
366 struct ttm_object_file *tfile, 366 struct ttm_object_file *tfile,
367 int id) 367 int id,
368 struct vmw_resource **p_res)
368{ 369{
369 struct vmw_resource *res; 370 struct vmw_resource *res;
370 int ret = 0; 371 int ret = 0;
@@ -376,6 +377,8 @@ int vmw_context_check(struct vmw_private *dev_priv,
376 container_of(res, struct vmw_user_context, res); 377 container_of(res, struct vmw_user_context, res);
377 if (ctx->base.tfile != tfile && !ctx->base.shareable) 378 if (ctx->base.tfile != tfile && !ctx->base.shareable)
378 ret = -EPERM; 379 ret = -EPERM;
380 if (p_res)
381 *p_res = vmw_resource_reference(res);
379 } else 382 } else
380 ret = -EINVAL; 383 ret = -EINVAL;
381 read_unlock(&dev_priv->resource_lock); 384 read_unlock(&dev_priv->resource_lock);