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>
This commit is contained in:
committed by
Dave Airlie
parent
0bef23f918
commit
be38ab6ea7
@@ -364,7 +364,8 @@ out_err:
|
||||
|
||||
int vmw_context_check(struct vmw_private *dev_priv,
|
||||
struct ttm_object_file *tfile,
|
||||
int id)
|
||||
int id,
|
||||
struct vmw_resource **p_res)
|
||||
{
|
||||
struct vmw_resource *res;
|
||||
int ret = 0;
|
||||
@@ -376,6 +377,8 @@ int vmw_context_check(struct vmw_private *dev_priv,
|
||||
container_of(res, struct vmw_user_context, res);
|
||||
if (ctx->base.tfile != tfile && !ctx->base.shareable)
|
||||
ret = -EPERM;
|
||||
if (p_res)
|
||||
*p_res = vmw_resource_reference(res);
|
||||
} else
|
||||
ret = -EINVAL;
|
||||
read_unlock(&dev_priv->resource_lock);
|
||||
|
Reference in New Issue
Block a user