From 78003014d03e77ed48d33f32de5d940e81917b6b Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sun, 26 May 2019 15:57:55 -0700 Subject: [PATCH] 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 --- src/gallium/drivers/iris/iris_bufmgr.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c index d893510..1845e98 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; -- 2.7.4