From: Rob Clark Date: Sat, 10 Dec 2022 17:33:51 +0000 (-0800) Subject: freedreno/drm: Shuffle around BO init X-Git-Tag: upstream/23.3.3~15360 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84f44137ff71fa122305659c82297c371ca7f2f6;p=platform%2Fupstream%2Fmesa.git freedreno/drm: Shuffle around BO init 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 Part-of: --- diff --git a/src/freedreno/drm/freedreno_bo.c b/src/freedreno/drm/freedreno_bo.c index ad45833..cc2f6b6 100644 --- a/src/freedreno/drm/freedreno_bo.c +++ b/src/freedreno/drm/freedreno_bo.c @@ -68,6 +68,7 @@ fd_bo_init_common(struct fd_bo *bo, struct fd_device *dev) /* Backend should have initialized these: */ assert(bo->size); assert(bo->handle); + assert(bo->funcs); bo->dev = dev; bo->iova = bo->funcs->iova(bo); @@ -75,6 +76,11 @@ fd_bo_init_common(struct fd_bo *bo, struct fd_device *dev) 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 */ @@ -124,10 +130,6 @@ bo_new(struct fd_device *dev, uint32_t size, uint32_t flags, simple_mtx_unlock(&table_lock); bo->alloc_flags = flags; - bo->max_fences = 1; - bo->fences = &bo->_inline_fence; - - VG_BO_ALLOC(bo); return bo; }