From: Alyssa Rosenzweig Date: Mon, 12 Jul 2021 18:08:10 +0000 (-0400) Subject: panfrost: Warn on get_fresh_batch_for_fbo X-Git-Tag: upstream/22.3.5~20215 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f2e3ac5c6277f8bd18277a311e8ee7c2d43589e3;p=platform%2Fupstream%2Fmesa.git panfrost: Warn on get_fresh_batch_for_fbo Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 2033188..8b66cc0 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 66f98e6..c64652e 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 18462aa..fc9c23d 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 707245d..eba0273 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,