From f9b14ec2d143a3e86f49db12bad4f6ffeb236b98 Mon Sep 17 00:00:00 2001 From: Utku Iseri Date: Thu, 4 Dec 2025 21:28:29 +0100 Subject: [PATCH] panfrost: add earlyzs FPK condition for v6- While v7+ checks this on HW, older architectures depend on SW to do it. Fixes: c43882ad544 ("panfrost: Allow pixels using discard to be killed") Reviewed-by: Lars-Ivar Hesselberg Simonsen Reviewed-by: Faith Ekstrand Reviewed-by: Boris Brezillon Reviewed-by: Yiwei Zhang (cherry picked from commit 5c63446b94e20fa6eb07143ca5177f8ca0fc7aec) Part-of: --- .pick_status.json | 2 +- src/gallium/drivers/panfrost/pan_jm.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 4d5cf56201e..cc7176ffd99 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -354,7 +354,7 @@ "description": "panfrost: add earlyzs FPK condition for v6-", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "c43882ad544af3cddd55278212f11cbd4686da63", "notes": null diff --git a/src/gallium/drivers/panfrost/pan_jm.c b/src/gallium/drivers/panfrost/pan_jm.c index cb75d0dfbb5..e798e47f378 100644 --- a/src/gallium/drivers/panfrost/pan_jm.c +++ b/src/gallium/drivers/panfrost/pan_jm.c @@ -587,7 +587,11 @@ jm_emit_tiler_draw(struct mali_draw_packed *out, struct panfrost_batch *batch, cfg.flags_0.allow_forward_pixel_to_kill = pan_allow_forward_pixel_to_kill(ctx, fs); - cfg.flags_0.allow_forward_pixel_to_be_killed = !fs->info.writes_global; + + /* early ZS check for FPK is performed by HW on v7+ */ + cfg.flags_0.allow_forward_pixel_to_be_killed = + !fs->info.writes_global && + ((PAN_ARCH > 6) || earlyzs.kill != MALI_PIXEL_KILL_FORCE_LATE); /* Mask of render targets that may be written. A render * target may be written if the fragment shader writes