Lines Matching refs:pool

35  * In "owned" mode, a single parent owns the entire pool, and the pool owns all
37 * panfrost_pool_get_bo_handles. Freeing occurs at the level of an entire pool.
38 * This is useful for streaming uploads, where the batch owns the pool.
40 * In "unowned" mode, the pool is freestanding. It does not track created BOs
47 panfrost_pool_alloc_backing(struct panfrost_pool *pool, size_t bo_sz)
55 struct panfrost_bo *bo = panfrost_bo_create(pool->base.dev, bo_sz,
56 pool->base.create_flags, pool->base.label);
58 if (pool->owned)
59 util_dynarray_append(&pool->bos, struct panfrost_bo *, bo);
61 panfrost_bo_unreference(pool->transient_bo);
63 pool->transient_bo = bo;
64 pool->transient_offset = 0;
70 panfrost_pool_init(struct panfrost_pool *pool, void *memctx,
75 memset(pool, 0, sizeof(*pool));
76 pan_pool_init(&pool->base, dev, create_flags, slab_size, label);
77 pool->owned = owned;
80 util_dynarray_init(&pool->bos, memctx);
83 panfrost_pool_alloc_backing(pool, pool->base.slab_size);
87 panfrost_pool_cleanup(struct panfrost_pool *pool)
89 if (!pool->owned) {
90 panfrost_bo_unreference(pool->transient_bo);
94 util_dynarray_foreach(&pool->bos, struct panfrost_bo *, bo)
97 util_dynarray_fini(&pool->bos);
101 panfrost_pool_get_bo_handles(struct panfrost_pool *pool, uint32_t *handles)
103 assert(pool->owned && "pool does not track BOs in unowned mode");
106 util_dynarray_foreach(&pool->bos, struct panfrost_bo *, bo) {
124 panfrost_pool_alloc_aligned(struct panfrost_pool *pool, size_t sz, unsigned alignment)
129 struct panfrost_bo *bo = pool->transient_bo;
130 unsigned offset = ALIGN_POT(pool->transient_offset, alignment);
133 if (unlikely(pool->base.dev->debug & PAN_DBG_OVERFLOW) &&
134 !(pool->base.create_flags & PAN_BO_INVISIBLE)) {
138 bo = panfrost_pool_alloc_backing(pool, bo_size);
149 pool->transient_bo = NULL;
154 if (unlikely(bo == NULL || (offset + sz) >= pool->base.slab_size)) {
155 bo = panfrost_pool_alloc_backing(pool,
156 ALIGN_POT(MAX2(pool->base.slab_size, sz), 4096));
160 pool->transient_offset = offset + sz;