Suballocated heap BOs will bypass the rest of bo_new() (as they skip the
BO cache, don't get an entry in the handle table, etc). So move more of
the initialization into fd_bo_init_common().
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
/* Backend should have initialized these: */
assert(bo->size);
assert(bo->handle);
+ assert(bo->funcs);
bo->dev = dev;
bo->iova = bo->funcs->iova(bo);
p_atomic_set(&bo->refcnt, 1);
list_inithead(&bo->node);
+
+ bo->max_fences = 1;
+ bo->fences = &bo->_inline_fence;
+
+ VG_BO_ALLOC(bo);
}
/* allocate a new buffer object, call w/ table_lock held */
simple_mtx_unlock(&table_lock);
bo->alloc_flags = flags;
- bo->max_fences = 1;
- bo->fences = &bo->_inline_fence;
-
- VG_BO_ALLOC(bo);
return bo;
}