diff --git a/.pick_status.json b/.pick_status.json index 50a252dda8c..ed58f7a1d76 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -934,7 +934,7 @@ "description": "panfrost: add can_discard flag to pan_legalize_afbc_format", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "33b48a55857b15f7e7b892a89cad2f0ad2399ba6", "notes": null diff --git a/src/gallium/drivers/panfrost/pan_blit.c b/src/gallium/drivers/panfrost/pan_blit.c index fcb3aa32160..dee8d741757 100644 --- a/src/gallium/drivers/panfrost/pan_blit.c +++ b/src/gallium/drivers/panfrost/pan_blit.c @@ -92,7 +92,7 @@ panfrost_blit(struct pipe_context *pipe, const struct pipe_blit_info *info) /* Legalize here because it could trigger a recursive blit otherwise */ pan_legalize_afbc_format(ctx, pan_resource(info->dst.resource), - info->dst.format, true); + info->dst.format, true, false); panfrost_blitter_save(ctx, info->render_condition_enable ? PAN_RENDER_BLIT_COND diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 58c38ed0d22..a728f4a5e68 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -4224,7 +4224,7 @@ panfrost_create_sampler_view(struct pipe_context *pctx, struct panfrost_sampler_view *so = rzalloc(pctx, struct panfrost_sampler_view); - pan_legalize_afbc_format(ctx, pan_resource(texture), template->format, + pan_legalize_afbc_format(ctx, pan_resource(texture), template->format, false, false); pipe_reference(NULL, &texture->reference); diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index 5471d39e50f..319eac8e505 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -68,7 +68,7 @@ panfrost_batch_add_surface(struct panfrost_batch *batch, { if (surf) { struct panfrost_resource *rsrc = pan_resource(surf->texture); - pan_legalize_afbc_format(batch->ctx, rsrc, surf->format, true); + pan_legalize_afbc_format(batch->ctx, rsrc, surf->format, true, false); panfrost_batch_write_rsrc(batch, rsrc, PIPE_SHADER_FRAGMENT); } } diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index 9d31d18f716..422bb376d6a 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -1363,7 +1363,7 @@ pan_resource_modifier_convert(struct panfrost_context *ctx, void pan_legalize_afbc_format(struct panfrost_context *ctx, struct panfrost_resource *rsrc, - enum pipe_format format, bool write) + enum pipe_format format, bool write, bool discard) { struct panfrost_device *dev = pan_device(ctx->base.screen); @@ -1373,7 +1373,7 @@ pan_legalize_afbc_format(struct panfrost_context *ctx, if (panfrost_afbc_format(dev->arch, rsrc->base.format) != panfrost_afbc_format(dev->arch, format)) { pan_resource_modifier_convert( - ctx, rsrc, DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED, true, + ctx, rsrc, DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED, !discard, "Reinterpreting AFBC surface as incompatible format"); return; } @@ -1381,7 +1381,7 @@ pan_legalize_afbc_format(struct panfrost_context *ctx, if (write && (rsrc->image.layout.modifier & AFBC_FORMAT_MOD_SPARSE) == 0) pan_resource_modifier_convert( ctx, rsrc, rsrc->image.layout.modifier | AFBC_FORMAT_MOD_SPARSE, - true, "Legalizing resource to allow writing"); + !discard, "Legalizing resource to allow writing"); } static bool diff --git a/src/gallium/drivers/panfrost/pan_resource.h b/src/gallium/drivers/panfrost/pan_resource.h index 5c71bbeb355..2b2bfc1f988 100644 --- a/src/gallium/drivers/panfrost/pan_resource.h +++ b/src/gallium/drivers/panfrost/pan_resource.h @@ -194,7 +194,8 @@ void pan_resource_modifier_convert(struct panfrost_context *ctx, void pan_legalize_afbc_format(struct panfrost_context *ctx, struct panfrost_resource *rsrc, - enum pipe_format format, bool write); + enum pipe_format format, bool write, + bool discard); void pan_dump_resource(struct panfrost_context *ctx, struct panfrost_resource *rsc);