summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_bufmgr.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2019-05-26 16:11:46 -0700
committerKenneth Graunke <[email protected]>2019-05-29 19:42:04 -0700
commit7acc88a47cbe3c420e04f281adc0fc1728c4a438 (patch)
tree00e2f9e7f57d4255578ee0359d84ffa809d83bf0 /src/gallium/drivers/iris/iris_bufmgr.c
parent76c5a196681e2cbcc894582395ebe54e41f5c6ca (diff)
iris: Move some field setting after we drop the lock.
It's not much, but we may as well hold the lock for a bit less time. 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.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c
index c0e6e4efa84..43ac0a144f5 100644
--- a/src/gallium/drivers/iris/iris_bufmgr.c
+++ b/src/gallium/drivers/iris/iris_bufmgr.c
@@ -488,19 +488,6 @@ bo_alloc_internal(struct iris_bufmgr *bufmgr,
goto err;
}
- bo->name = name;
- p_atomic_set(&bo->refcount, 1);
- bo->reusable = bucket && bufmgr->bo_reuse;
- bo->cache_coherent = bufmgr->has_llc;
- bo->index = -1;
- bo->kflags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS | EXEC_OBJECT_PINNED;
-
- /* By default, capture all driver-internal buffers like shader kernels,
- * surface states, dynamic states, border colors, and so on.
- */
- if (memzone < IRIS_MEMZONE_OTHER)
- bo->kflags |= EXEC_OBJECT_CAPTURE;
-
if (bo->gtt_offset == 0ull) {
bo->gtt_offset = vma_alloc(bufmgr, memzone, bo->size, 1);
@@ -528,6 +515,19 @@ bo_alloc_internal(struct iris_bufmgr *bufmgr,
mtx_unlock(&bufmgr->lock);
+ bo->name = name;
+ p_atomic_set(&bo->refcount, 1);
+ bo->reusable = bucket && bufmgr->bo_reuse;
+ bo->cache_coherent = bufmgr->has_llc;
+ bo->index = -1;
+ bo->kflags = EXEC_OBJECT_SUPPORTS_48B_ADDRESS | EXEC_OBJECT_PINNED;
+
+ /* By default, capture all driver-internal buffers like shader kernels,
+ * surface states, dynamic states, border colors, and so on.
+ */
+ if (memzone < IRIS_MEMZONE_OTHER)
+ bo->kflags |= EXEC_OBJECT_CAPTURE;
+
if ((flags & BO_ALLOC_COHERENT) && !bo->cache_coherent) {
struct drm_i915_gem_caching arg = {
.handle = bo->gem_handle,