From: Alyssa Rosenzweig Date: Fri, 17 Jun 2022 03:30:29 +0000 (-0400) Subject: asahi: Label batch flush reasons X-Git-Tag: upstream/22.3.5~3557 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=99a5b11af54a754dbb4cc4ca8a07446a527b4c25;p=platform%2Fupstream%2Fmesa.git asahi: Label batch flush reasons This was helpful in identifying the bottleneck in Inochi2D (the clears). Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index 7edcfd1..4a35eb5 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -265,9 +265,9 @@ agx_transfer_map(struct pipe_context *pctx, return NULL; if (ctx->batch->cbufs[0] && resource == ctx->batch->cbufs[0]->texture) - pctx->flush(pctx, NULL, 0); + agx_flush_all(ctx, "Transfer to colour buffer"); if (ctx->batch->zsbuf && resource == ctx->batch->zsbuf->texture) - pctx->flush(pctx, NULL, 0); + agx_flush_all(ctx, "Transfer to depth buffer"); struct agx_transfer *transfer = CALLOC_STRUCT(agx_transfer); transfer->base.level = level; diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index 0335be6..c1bf2cf 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -726,7 +726,7 @@ agx_set_framebuffer_state(struct pipe_context *pctx, return; /* XXX: eliminate this flush with batch tracking logic */ - pctx->flush(pctx, NULL, 0); + agx_flush_all(ctx, "Framebuffer switch"); util_copy_framebuffer_state(&ctx->framebuffer, state); ctx->batch->width = state->width; diff --git a/src/gallium/drivers/asahi/agx_state.h b/src/gallium/drivers/asahi/agx_state.h index f027f75..b94ff47 100644 --- a/src/gallium/drivers/asahi/agx_state.h +++ b/src/gallium/drivers/asahi/agx_state.h @@ -333,4 +333,12 @@ void agx_blit(struct pipe_context *pipe, void agx_internal_shaders(struct agx_device *dev); +/* Batch logic */ +static void +agx_flush_all(struct agx_context *ctx, const char *reason) +{ + //printf("Flushing due to: %s\n", reason); + ctx->base.flush(&ctx->base, NULL, 0); +} + #endif