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: f68c6951b8 8efaae3e19

Signed-off-by: Alejandro Tafalla <atafalla@dnyon.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18925>
(cherry picked from commit afe4b534b52af41ba3265c7150e012f8577d03b7)
This commit is contained in:
Alejandro Tafalla 2022-09-27 10:33:56 +02:00 committed by Dylan Baker
parent c66624f59b
commit 52eac47f75
3 changed files with 17 additions and 1 deletions

View File

@ -1282,7 +1282,7 @@
"description": "freedreno: Fix graphic glitches on a4xx and a5xx", "description": "freedreno: Fix graphic glitches on a4xx and a5xx",
"nominated": true, "nominated": true,
"nomination_type": 1, "nomination_type": 1,
"resolution": 0, "resolution": 1,
"main_sha": null, "main_sha": null,
"because_sha": "f68c6951b86ac38ebdb89bc6b5a6285433e684a6" "because_sha": "f68c6951b86ac38ebdb89bc6b5a6285433e684a6"
}, },

View File

@ -146,6 +146,14 @@ use_hw_binning(struct fd_batch *batch)
{ {
const struct fd_gmem_stateobj *gmem = batch->gmem_state; 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) if ((gmem->maxpw * gmem->maxph) > 32)
return false; return false;

View File

@ -263,6 +263,14 @@ use_hw_binning(struct fd_batch *batch)
{ {
const struct fd_gmem_stateobj *gmem = batch->gmem_state; 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) if ((gmem->maxpw * gmem->maxph) > 32)
return false; return false;