From cb058a89223295db91382fffc1f1d4ae24f1c076 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Fri, 23 Apr 2021 16:47:47 -0700 Subject: [PATCH] freedreno: Avoid staging blits with stencil on older gens This avoids infinite recursion with fallback to util_resource_copy_region() Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/freedreno_resource.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index f1752962c78..41523a83dd8 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -508,10 +508,18 @@ fd_resource_dump(struct fd_resource *rsc, const char *name) static struct fd_resource * fd_alloc_staging(struct fd_context *ctx, struct fd_resource *rsc, unsigned level, const struct pipe_box *box) + assert_dt { struct pipe_context *pctx = &ctx->base; struct pipe_resource tmpl = rsc->b.b; + /* We cannot currently do stencil export on earlier gens, and + * u_blitter cannot do blits involving stencil otherwise: + */ + if ((ctx->screen->gpu_id < 600) && !ctx->blit && + (util_format_get_mask(tmpl.format) & PIPE_MASK_S)) + return NULL; + tmpl.width0 = box->width; tmpl.height0 = box->height; /* for array textures, box->depth is the array_size, otherwise