Needs to specify nondraw when creating a batch through
fd_bc_alloc_batch since it'd better create a batch through
it rather than fd_batch_create.
---
 src/gallium/drivers/freedreno/a6xx/fd6_blitter.c      | 2 +-
 src/gallium/drivers/freedreno/freedreno_batch_cache.c | 6 +++---
 src/gallium/drivers/freedreno/freedreno_batch_cache.h | 2 +-
 src/gallium/drivers/freedreno/freedreno_context.c     | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c 
b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
index bd37005d50..c962fe7997 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_blitter.c
@@ -486,7 +486,7 @@ fd6_blit(struct pipe_context *pctx, const struct 
pipe_blit_info *info)
                return;
        }
 
-       batch = fd_bc_alloc_batch(&ctx->screen->batch_cache, ctx);
+       batch = fd_bc_alloc_batch(&ctx->screen->batch_cache, ctx, true);
 
        fd6_emit_restore(batch, batch->draw);
        fd6_emit_lrz_flush(batch->draw);
diff --git a/src/gallium/drivers/freedreno/freedreno_batch_cache.c 
b/src/gallium/drivers/freedreno/freedreno_batch_cache.c
index 9d046f205b..a8b32d9bd0 100644
--- a/src/gallium/drivers/freedreno/freedreno_batch_cache.c
+++ b/src/gallium/drivers/freedreno/freedreno_batch_cache.c
@@ -270,7 +270,7 @@ fd_bc_invalidate_resource(struct fd_resource *rsc, bool 
destroy)
 }
 
 struct fd_batch *
-fd_bc_alloc_batch(struct fd_batch_cache *cache, struct fd_context *ctx)
+fd_bc_alloc_batch(struct fd_batch_cache *cache, struct fd_context *ctx, bool 
nondraw)
 {
        struct fd_batch *batch;
        uint32_t idx;
@@ -333,7 +333,7 @@ fd_bc_alloc_batch(struct fd_batch_cache *cache, struct 
fd_context *ctx)
 
        idx--;              /* bit zero returns 1 for ffs() */
 
-       batch = fd_batch_create(ctx, false);
+       batch = fd_batch_create(ctx, nondraw);
        if (!batch)
                goto out;
 
@@ -365,7 +365,7 @@ batch_from_key(struct fd_batch_cache *cache, struct key 
*key,
                return batch;
        }
 
-       batch = fd_bc_alloc_batch(cache, ctx);
+       batch = fd_bc_alloc_batch(cache, ctx, false);
 #ifdef DEBUG
        DBG("%p: hash=0x%08x, %ux%u, %u layers, %u samples", batch, hash,
                        key->width, key->height, key->layers, key->samples);
diff --git a/src/gallium/drivers/freedreno/freedreno_batch_cache.h 
b/src/gallium/drivers/freedreno/freedreno_batch_cache.h
index 348418e187..0f2c40ba8d 100644
--- a/src/gallium/drivers/freedreno/freedreno_batch_cache.h
+++ b/src/gallium/drivers/freedreno/freedreno_batch_cache.h
@@ -68,7 +68,7 @@ void fd_bc_flush_deferred(struct fd_batch_cache *cache, 
struct fd_context *ctx);
 void fd_bc_invalidate_context(struct fd_context *ctx);
 void fd_bc_invalidate_batch(struct fd_batch *batch, bool destroy);
 void fd_bc_invalidate_resource(struct fd_resource *rsc, bool destroy);
-struct fd_batch * fd_bc_alloc_batch(struct fd_batch_cache *cache, struct 
fd_context *ctx);
+struct fd_batch * fd_bc_alloc_batch(struct fd_batch_cache *cache, struct 
fd_context *ctx, bool nondraw);
 
 struct fd_batch * fd_batch_from_fb(struct fd_batch_cache *cache,
                struct fd_context *ctx, const struct pipe_framebuffer_state 
*pfb);
diff --git a/src/gallium/drivers/freedreno/freedreno_context.c 
b/src/gallium/drivers/freedreno/freedreno_context.c
index 55e978073a..c540d6d143 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.c
+++ b/src/gallium/drivers/freedreno/freedreno_context.c
@@ -316,7 +316,7 @@ fd_context_init(struct fd_context *ctx, struct pipe_screen 
*pscreen,
        pctx->const_uploader = pctx->stream_uploader;
 
        if (!ctx->screen->reorder)
-               ctx->batch = fd_bc_alloc_batch(&screen->batch_cache, ctx);
+               ctx->batch = fd_bc_alloc_batch(&screen->batch_cache, ctx, 
false);
 
        slab_create_child(&ctx->transfer_pool, &screen->transfer_pool);
 
-- 
2.17.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to