diff options
author | Kenneth Graunke <[email protected]> | 2019-05-26 15:57:55 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-05-29 19:40:16 -0700 |
commit | 78003014d03e77ed48d33f32de5d940e81917b6b (patch) | |
tree | 4b138b13ae996eccf8f53c131df79396ef2121d6 /src/gallium/drivers/iris/iris_bufmgr.c | |
parent | 5fc11fd98853282b68e5f0a7bce23deb5a3d6beb (diff) |
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 <[email protected]>
Diffstat (limited to 'src/gallium/drivers/iris/iris_bufmgr.c')
-rw-r--r-- | src/gallium/drivers/iris/iris_bufmgr.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c index d89351043df..1845e9898a0 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.c +++ b/src/gallium/drivers/iris/iris_bufmgr.c @@ -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; |