freedreno: Add debugging for blitter fallback recursion
authorRob Clark <robdclark@chromium.org>
Sun, 13 Jun 2021 20:37:16 +0000 (13:37 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 15 Jun 2021 19:09:24 +0000 (19:09 +0000)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11371>

src/gallium/drivers/freedreno/freedreno_context.h
src/gallium/drivers/freedreno/freedreno_resource.c

index f685a3b..dc2a978 100644 (file)
@@ -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;
 
index 309be61..4d1c96c 100644 (file)
@@ -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;
 }
 
 /**