panfrost: Warn on get_fresh_batch_for_fbo
authorAlyssa Rosenzweig <alyssa@collabora.com>
Mon, 12 Jul 2021 18:08:10 +0000 (14:08 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 14 Jul 2021 17:41:27 +0000 (17:41 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11830>

src/gallium/drivers/panfrost/pan_cmdstream.c
src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_job.c
src/gallium/drivers/panfrost/pan_job.h

index 2033188..8b66cc0 100644 (file)
@@ -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;
index 66f98e6..c64652e 100644 (file)
@@ -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);
 }
 
index 18462aa..fc9c23d 100644 (file)
@@ -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;
index 707245d..eba0273 100644 (file)
@@ -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,