• Home
  • Raw
  • Download

Lines Matching full:pool

32  * In "owned" mode, a single parent owns the entire pool, and the pool owns all
34 * panfrost_pool_get_bo_handles. Freeing occurs at the level of an entire pool.
35 * This is useful for streaming uploads, where the batch owns the pool.
37 * In "unowned" mode, the pool is freestanding. It does not track created BOs
44 panfrost_pool_alloc_backing(struct panfrost_pool *pool, size_t bo_sz) in panfrost_pool_alloc_backing() argument
52 struct panfrost_bo *bo = panfrost_bo_create(pool->base.dev, bo_sz, in panfrost_pool_alloc_backing()
53 pool->base.create_flags, pool->base.label); in panfrost_pool_alloc_backing()
55 if (pool->owned) in panfrost_pool_alloc_backing()
56 util_dynarray_append(&pool->bos, struct panfrost_bo *, bo); in panfrost_pool_alloc_backing()
58 panfrost_bo_unreference(pool->transient_bo); in panfrost_pool_alloc_backing()
60 pool->transient_bo = bo; in panfrost_pool_alloc_backing()
61 pool->transient_offset = 0; in panfrost_pool_alloc_backing()
67 panfrost_pool_init(struct panfrost_pool *pool, void *memctx, in panfrost_pool_init() argument
72 memset(pool, 0, sizeof(*pool)); in panfrost_pool_init()
73 pan_pool_init(&pool->base, dev, create_flags, slab_size, label); in panfrost_pool_init()
74 pool->owned = owned; in panfrost_pool_init()
77 util_dynarray_init(&pool->bos, memctx); in panfrost_pool_init()
80 panfrost_pool_alloc_backing(pool, pool->base.slab_size); in panfrost_pool_init()
84 panfrost_pool_cleanup(struct panfrost_pool *pool) in panfrost_pool_cleanup() argument
86 if (!pool->owned) { in panfrost_pool_cleanup()
87 panfrost_bo_unreference(pool->transient_bo); in panfrost_pool_cleanup()
91 util_dynarray_foreach(&pool->bos, struct panfrost_bo *, bo) in panfrost_pool_cleanup()
94 util_dynarray_fini(&pool->bos); in panfrost_pool_cleanup()
98 panfrost_pool_get_bo_handles(struct panfrost_pool *pool, uint32_t *handles) in panfrost_pool_get_bo_handles() argument
100 assert(pool->owned && "pool does not track BOs in unowned mode"); in panfrost_pool_get_bo_handles()
103 util_dynarray_foreach(&pool->bos, struct panfrost_bo *, bo) { in panfrost_pool_get_bo_handles()
119 panfrost_pool_alloc_aligned(struct panfrost_pool *pool, size_t sz, unsigned alignment) in panfrost_pool_alloc_aligned() argument
124 struct panfrost_bo *bo = pool->transient_bo; in panfrost_pool_alloc_aligned()
125 unsigned offset = ALIGN_POT(pool->transient_offset, alignment); in panfrost_pool_alloc_aligned()
128 if (unlikely(bo == NULL || (offset + sz) >= pool->base.slab_size)) { in panfrost_pool_alloc_aligned()
129 bo = panfrost_pool_alloc_backing(pool, in panfrost_pool_alloc_aligned()
130 ALIGN_POT(MAX2(pool->base.slab_size, sz), 4096)); in panfrost_pool_alloc_aligned()
134 pool->transient_offset = offset + sz; in panfrost_pool_alloc_aligned()