From 05c2d45c3ce8d732310b3a2532d8c48aeef6ad54 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Wed, 10 Sep 2025 13:17:46 +0200 Subject: [PATCH] panfrost: Explicitly reject AFBC(Z32) We are about to extend pan_afbc_format() to support AFBC(Z32), but the the AFBC(Z32) + S8 combination doesn't work on v7-, so we need to filter AFBC(Z32) out in panfrost_should_afbc() on v7-. Signed-off-by: Boris Brezillon Reviewed-by: Christoph Pillmayer Part-of: --- src/gallium/drivers/panfrost/pan_resource.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index 615ead9d22a..894c78d8155 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -606,6 +606,13 @@ panfrost_should_afbc(struct panfrost_device *dev, if (pres->base.bind & PIPE_BIND_CONST_BW) return false; + /* We can't do AFBC(Z32)+S8 on v7- because the AFBC ZS target layout overlaps + * the S target layout. Since we don't know at this point if the Z32 buffer + * will be attached an S8 buffer, we have to reject AFBC(Z32) + * unconditionally. */ + if (dev->arch <= 7 && fmt == PIPE_FORMAT_Z32_FLOAT) + return false; + /* Only a small selection of formats are AFBC'able */ if (!pan_afbc_supports_format(dev->arch, fmt)) return false;