From 6d01c1780569fb2fe50e2f1620e15b8ec1ae3785 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sun, 13 Jun 2021 13:37:16 -0700 Subject: [PATCH] freedreno: Add debugging for blitter fallback recursion Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/freedreno_context.h | 3 +++ src/gallium/drivers/freedreno/freedreno_resource.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/gallium/drivers/freedreno/freedreno_context.h b/src/gallium/drivers/freedreno/freedreno_context.h index f685a3b..dc2a978 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.h +++ b/src/gallium/drivers/freedreno/freedreno_context.h @@ -350,6 +350,9 @@ struct fd_context { */ bool in_discard_blit : 1 dt; + /* For catching recursion problems with blit fallback: */ + bool in_blit : 1 dt; + /* points to either scissor or disabled_scissor depending on rast state: */ struct pipe_scissor_state *current_scissor dt; diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index 309be61..4d1c96c 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -232,6 +232,9 @@ do_blit(struct fd_context *ctx, const struct pipe_blit_info *blit, { struct pipe_context *pctx = &ctx->base; + assert(!ctx->in_blit); + ctx->in_blit = true; + /* TODO size threshold too?? */ if (fallback || !fd_blit(pctx, blit)) { /* do blit on cpu: */ @@ -240,6 +243,8 @@ do_blit(struct fd_context *ctx, const struct pipe_blit_info *blit, blit->dst.box.z, blit->src.resource, blit->src.level, &blit->src.box); } + + ctx->in_blit = false; } /** -- 2.7.4