panfrost: Label pools

Allows the allocated BOs to be labeled more intelligently.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10866>
This commit is contained in:
Alyssa Rosenzweig 2021-05-12 18:31:54 -04:00 committed by Marge Bot
parent 3fa1f93dac
commit ab859cfffe
5 changed files with 15 additions and 10 deletions

View File

@ -85,12 +85,13 @@ panfrost_batch_init(struct panfrost_context *ctx,
/* Preallocate the main pool, since every batch has at least one job
* structure so it will be used */
panfrost_pool_init(&batch->pool, NULL, dev, 0, true, true);
panfrost_pool_init(&batch->pool, NULL, dev, 0, "Batch pool", true, true);
/* Don't preallocate the invisible pool, since not every batch will use
* the pre-allocation, particularly if the varyings are larger than the
* preallocation and a reallocation is needed after anyway. */
panfrost_pool_init(&batch->invisible_pool, NULL, dev, PAN_BO_INVISIBLE, false, true);
panfrost_pool_init(&batch->invisible_pool, NULL, dev,
PAN_BO_INVISIBLE, "Varyings", false, true);
panfrost_batch_add_fbo_bos(batch);
}

View File

@ -1348,7 +1348,7 @@ pan_blit_ctx_init(struct panfrost_device *dev,
struct pan_blit_context *ctx)
{
memset(ctx, 0, sizeof(*ctx));
panfrost_pool_init(&ctx->pool, NULL, dev, 0, false, true);
panfrost_pool_init(&ctx->pool, NULL, dev, 0, "Blitter pool", false, true);
ctx->z_scale = (float)(info->dst.end.z - info->dst.start.z + 1) /
(info->src.end.z - info->src.start.z + 1);
@ -1599,11 +1599,11 @@ pan_blitter_init(struct panfrost_device *dev)
_mesa_hash_table_create(NULL, pan_blit_blend_shader_key_hash,
pan_blit_blend_shader_key_equal);
panfrost_pool_init(&dev->blitter.shaders.pool, NULL, dev,
PAN_BO_EXECUTE, false, true);
PAN_BO_EXECUTE, "Blitter shaders", false, true);
pthread_mutex_init(&dev->blitter.shaders.lock, NULL);
pan_blitter_prefill_blit_shader_cache(dev);
panfrost_pool_init(&dev->blitter.rsds.pool, NULL, dev, 0, false, true);
panfrost_pool_init(&dev->blitter.rsds.pool, NULL, dev, 0, "Blitter RSDs", false, true);
dev->blitter.rsds.rsds =
_mesa_hash_table_create(NULL, pan_blit_rsd_key_hash,
pan_blit_rsd_key_equal);

View File

@ -1372,7 +1372,7 @@ panfrost_init_indirect_draw_shaders(struct panfrost_device *dev)
*/
pthread_mutex_init(&dev->indirect_draw_shaders.lock, NULL);
panfrost_pool_init(&dev->indirect_draw_shaders.bin_pool, NULL, dev,
PAN_BO_EXECUTE, false, true);
PAN_BO_EXECUTE, "Indirect draw shaders", false, true);
}
void

View File

@ -51,7 +51,7 @@ panfrost_pool_alloc_backing(struct pan_pool *pool, size_t bo_sz)
* fragment/vertex+tiler pools separate.
*/
struct panfrost_bo *bo = panfrost_bo_create(pool->dev, bo_sz,
pool->create_flags, "Pool memory");
pool->create_flags, pool->label);
if (pool->owned)
util_dynarray_append(&pool->bos, struct panfrost_bo *, bo);
@ -67,13 +67,14 @@ panfrost_pool_alloc_backing(struct pan_pool *pool, size_t bo_sz)
void
panfrost_pool_init(struct pan_pool *pool, void *memctx,
struct panfrost_device *dev,
unsigned create_flags, bool prealloc,
bool owned)
unsigned create_flags, const char *label,
bool prealloc, bool owned)
{
memset(pool, 0, sizeof(*pool));
pool->dev = dev;
pool->create_flags = create_flags;
pool->owned = owned;
pool->label = label;
if (owned)
util_dynarray_init(&pool->bos, memctx);

View File

@ -47,6 +47,9 @@ struct pan_pool {
/* Within the topmost transient BO, how much has been used? */
unsigned transient_offset;
/* Label for created BOs */
const char *label;
/* BO flags to use in the pool */
unsigned create_flags;
@ -58,7 +61,7 @@ struct pan_pool {
void
panfrost_pool_init(struct pan_pool *pool, void *memctx,
struct panfrost_device *dev, unsigned create_flags,
bool prealloc, bool owned);
const char *label, bool prealloc, bool owned);
void
panfrost_pool_cleanup(struct pan_pool *pool);