asahi: label individual pools

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32434>
This commit is contained in:
Alyssa Rosenzweig 2024-11-29 09:58:14 -05:00 committed by Marge Bot
parent 09c8520293
commit e7b3dcb9f7
4 changed files with 12 additions and 6 deletions

View file

@ -217,7 +217,8 @@ DERIVE_HASH_TABLE(agx_bg_eot_key);
void
agx_bg_eot_init(struct agx_bg_eot_cache *cache, struct agx_device *dev)
{
agx_pool_init(&cache->pool, dev, AGX_BO_EXEC | AGX_BO_LOW_VA, true);
agx_pool_init(&cache->pool, dev, "Internal programs",
AGX_BO_EXEC | AGX_BO_LOW_VA, true);
simple_mtx_init(&cache->lock, mtx_plain);
cache->ht = agx_bg_eot_key_table_create(NULL);
cache->dev = dev;

View file

@ -19,7 +19,7 @@ static struct agx_bo *
agx_pool_alloc_backing(struct agx_pool *pool, size_t bo_sz)
{
struct agx_bo *bo =
agx_bo_create(pool->dev, bo_sz, 0, pool->create_flags, "Pool");
agx_bo_create(pool->dev, bo_sz, 0, pool->create_flags, pool->label);
util_dynarray_append(&pool->bos, struct agx_bo *, bo);
pool->transient_bo = bo;
@ -29,12 +29,13 @@ agx_pool_alloc_backing(struct agx_pool *pool, size_t bo_sz)
}
void
agx_pool_init(struct agx_pool *pool, struct agx_device *dev,
agx_pool_init(struct agx_pool *pool, struct agx_device *dev, const char *label,
unsigned create_flags, bool prealloc)
{
memset(pool, 0, sizeof(*pool));
pool->dev = dev;
pool->create_flags = create_flags;
pool->label = label;
util_dynarray_init(&pool->bos, NULL);
if (prealloc)

View file

@ -31,10 +31,13 @@ struct agx_pool {
/* BO flags to use in the pool */
unsigned create_flags;
/* Label for pool allocations */
const char *label;
};
void agx_pool_init(struct agx_pool *pool, struct agx_device *dev,
unsigned create_flags, bool prealloc);
const char *label, unsigned create_flags, bool prealloc);
void agx_pool_cleanup(struct agx_pool *pool);

View file

@ -101,8 +101,9 @@ agx_batch_init(struct agx_context *ctx,
batch->seqnum = ++ctx->batches.seqnum;
agx_bo_reference(screen->rodata);
agx_pool_init(&batch->pool, dev, 0, true);
agx_pool_init(&batch->pipeline_pool, dev, AGX_BO_LOW_VA, true);
agx_pool_init(&batch->pool, dev, "Batch pool", 0, true);
agx_pool_init(&batch->pipeline_pool, dev, "Batch low VA pool", AGX_BO_LOW_VA,
true);
/* These allocations can happen only once and will just be zeroed (not freed)
* during batch clean up. The memory is owned by the context.