Module: Mesa
Branch: master
Commit: 73b70b4952a1c9aee65c7c81b675d3ab5076c205
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=73b70b4952a1c9aee65c7c81b675d3ab5076c205

Author: Kenneth Graunke <[email protected]>
Date:   Tue Sep 10 23:57:57 2019 -0700

iris: Set bo->reusable = false in iris_bo_make_external_locked

This fixes a missing bo->reusable = false in iris_bo_export_gem_handle.

Reviewed-by: Chris Wilson <[email protected]>

---

 src/gallium/drivers/iris/iris_bufmgr.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_bufmgr.c 
b/src/gallium/drivers/iris/iris_bufmgr.c
index dfaba84b499..992bbd90b3a 100644
--- a/src/gallium/drivers/iris/iris_bufmgr.c
+++ b/src/gallium/drivers/iris/iris_bufmgr.c
@@ -1337,6 +1337,7 @@ iris_bo_make_external_locked(struct iris_bo *bo)
    if (!bo->external) {
       _mesa_hash_table_insert(bo->bufmgr->handle_table, &bo->gem_handle, bo);
       bo->external = true;
+      bo->reusable = false;
    }
 }
 
@@ -1345,8 +1346,10 @@ iris_bo_make_external(struct iris_bo *bo)
 {
    struct iris_bufmgr *bufmgr = bo->bufmgr;
 
-   if (bo->external)
+   if (bo->external) {
+      assert(!bo->reusable);
       return;
+   }
 
    mtx_lock(&bufmgr->lock);
    iris_bo_make_external_locked(bo);
@@ -1364,8 +1367,6 @@ iris_bo_export_dmabuf(struct iris_bo *bo, int *prime_fd)
                           DRM_CLOEXEC, prime_fd) != 0)
       return -errno;
 
-   bo->reusable = false;
-
    return 0;
 }
 
@@ -1395,8 +1396,6 @@ iris_bo_flink(struct iris_bo *bo, uint32_t *name)
          _mesa_hash_table_insert(bufmgr->name_table, &bo->global_name, bo);
       }
       mtx_unlock(&bufmgr->lock);
-
-      bo->reusable = false;
    }
 
    *name = bo->global_name;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to