From afe4b534b52af41ba3265c7150e012f8577d03b7 Mon Sep 17 00:00:00 2001 From: Alejandro Tafalla Date: Tue, 27 Sep 2022 10:33:56 +0200 Subject: [PATCH] freedreno: Fix graphic glitches on a4xx and a5xx Like on adreno 3xx, hw binning and scissor optimizations don't work correctly together on a4xx and a5xx GPUs. Disable binning as a workaround if scissor optimizations are being used. Fixes: f68c6951b86a 8efaae3e1969 Signed-off-by: Alejandro Tafalla Reviewed-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/a4xx/fd4_gmem.c | 8 ++++++++ src/gallium/drivers/freedreno/a5xx/fd5_gmem.c | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/gallium/drivers/freedreno/a4xx/fd4_gmem.c b/src/gallium/drivers/freedreno/a4xx/fd4_gmem.c index e8e812e2fc1..394c4ba9f0a 100644 --- a/src/gallium/drivers/freedreno/a4xx/fd4_gmem.c +++ b/src/gallium/drivers/freedreno/a4xx/fd4_gmem.c @@ -146,6 +146,14 @@ use_hw_binning(struct fd_batch *batch) { const struct fd_gmem_stateobj *gmem = batch->gmem_state; + /* workaround: Like on a3xx, hw binning and scissor optimization + * don't play nice together. + * + * Disable binning if scissor optimization is used. + */ + if (gmem->minx || gmem->miny) + return false; + if ((gmem->maxpw * gmem->maxph) > 32) return false; diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c b/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c index b2aa4bff4e4..95847056bd9 100644 --- a/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c +++ b/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c @@ -263,6 +263,14 @@ use_hw_binning(struct fd_batch *batch) { const struct fd_gmem_stateobj *gmem = batch->gmem_state; + /* workaround: Like on a3xx, hw binning and scissor optimization + * don't play nice together. + * + * Disable binning if scissor optimization is used. + */ + if (gmem->minx || gmem->miny) + return false; + if ((gmem->maxpw * gmem->maxph) > 32) return false;