iris: Fix locking around vma_alloc in iris_bo_create_userptr

util_vma needs to be protected by a lock.  All other callers of
vma_alloc and vma_free appear to be holding a lock already.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
This commit is contained in:
Kenneth Graunke 2019-05-26 15:57:55 -07:00
parent 5fc11fd988
commit 78003014d0
1 changed files with 4 additions and 0 deletions

View File

@ -581,7 +581,11 @@ iris_bo_create_userptr(struct iris_bufmgr *bufmgr, const char *name,
bo->bufmgr = bufmgr;
bo->kflags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS | EXEC_OBJECT_PINNED;
mtx_lock(&bufmgr->lock);
bo->gtt_offset = vma_alloc(bufmgr, memzone, size, 1);
mtx_unlock(&bufmgr->lock);
if (bo->gtt_offset == 0ull)
goto err_close;