Mesa (main): panfrost: Warn on get_fresh_batch_for_fbo
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jul 14 18:05:14 UTC 2021
Module: Mesa
Branch: main
Commit: f2e3ac5c6277f8bd18277a311e8ee7c2d43589e3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f2e3ac5c6277f8bd18277a311e8ee7c2d43589e3
Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date: Mon Jul 12 14:08:10 2021 -0400
panfrost: Warn on get_fresh_batch_for_fbo
Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11830>
---
src/gallium/drivers/panfrost/pan_cmdstream.c | 2 +-
src/gallium/drivers/panfrost/pan_context.c | 2 +-
src/gallium/drivers/panfrost/pan_job.c | 3 ++-
src/gallium/drivers/panfrost/pan_job.h | 2 +-
4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index 20331881e39..8b66cc0f61e 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -3092,7 +3092,7 @@ panfrost_draw_vbo(struct pipe_context *pipe,
* of 65536 jobs, but we choose a smaller soft limit (arbitrary) to
* avoid the risk of timeouts. This might not be a good idea. */
if (unlikely(batch->scoreboard.job_index > 10000))
- batch = panfrost_get_fresh_batch_for_fbo(ctx);
+ batch = panfrost_get_fresh_batch_for_fbo(ctx, "Too many draws");
unsigned zs_draws = ctx->depth_stencil->draws;
batch->draws |= zs_draws;
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 66f98e61e91..c64652e9fa4 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -73,7 +73,7 @@ panfrost_clear(
* color/depth/stencil value, thus avoiding the generation of extra
* fragment jobs.
*/
- struct panfrost_batch *batch = panfrost_get_fresh_batch_for_fbo(ctx);
+ struct panfrost_batch *batch = panfrost_get_fresh_batch_for_fbo(ctx, "Clear");
panfrost_batch_clear(batch, buffers, color, depth, stencil);
}
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index 18462aa762d..fc9c23d0c7c 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -231,7 +231,7 @@ panfrost_get_batch_for_fbo(struct panfrost_context *ctx)
}
struct panfrost_batch *
-panfrost_get_fresh_batch_for_fbo(struct panfrost_context *ctx)
+panfrost_get_fresh_batch_for_fbo(struct panfrost_context *ctx, const char *reason)
{
struct panfrost_batch *batch;
@@ -250,6 +250,7 @@ panfrost_get_fresh_batch_for_fbo(struct panfrost_context *ctx)
/* Otherwise, we need to freeze the existing one and instantiate a new
* one.
*/
+ perf_debug_ctx(ctx, "Flushing the current FBO due to: %s", reason);
panfrost_batch_submit(batch, 0, 0);
batch = panfrost_get_batch(ctx, &ctx->pipe_framebuffer);
ctx->batch = batch;
diff --git a/src/gallium/drivers/panfrost/pan_job.h b/src/gallium/drivers/panfrost/pan_job.h
index 707245d9788..eba02735478 100644
--- a/src/gallium/drivers/panfrost/pan_job.h
+++ b/src/gallium/drivers/panfrost/pan_job.h
@@ -144,7 +144,7 @@ struct panfrost_batch *
panfrost_get_batch_for_fbo(struct panfrost_context *ctx);
struct panfrost_batch *
-panfrost_get_fresh_batch_for_fbo(struct panfrost_context *ctx);
+panfrost_get_fresh_batch_for_fbo(struct panfrost_context *ctx, const char *reason);
void
panfrost_batch_add_bo(struct panfrost_batch *batch,
More information about the mesa-commit
mailing list