Mesa (staging/22.1): pan/mdg: Keep min_bound at 16 when alignment requires it

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed May 11 04:23:24 UTC 2022


Module: Mesa
Branch: staging/22.1
Commit: 38ac16dbff2728eb5c59653edac2650e5f552284
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=38ac16dbff2728eb5c59653edac2650e5f552284

Author: Icecream95 <ixn at disroot.org>
Date:   Tue May 10 10:40:49 2022 +1200

pan/mdg: Keep min_bound at 16 when alignment requires it

Otherwise LCRA will try to divide by zero when calculating m_max.

Fixes: 553c2cf16b7 ("pan/mdg: Set RA bounds for fp16")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16382>
(cherry picked from commit b1ecb90941c9b3d9a9780b9dbb264e7b3b097fdb)

---

 .pick_status.json                 | 2 +-
 src/panfrost/midgard/midgard_ra.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 51c8d305099..cf01af23d63 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -697,7 +697,7 @@
         "description": "pan/mdg: Keep min_bound at 16 when alignment requires it",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "553c2cf16b7612d4a70bd96230dad63777ec867e"
     },
diff --git a/src/panfrost/midgard/midgard_ra.c b/src/panfrost/midgard/midgard_ra.c
index 8c9ef632542..e02fb743a55 100644
--- a/src/panfrost/midgard/midgard_ra.c
+++ b/src/panfrost/midgard/midgard_ra.c
@@ -543,7 +543,7 @@ allocate_registers(compiler_context *ctx, bool *spilled)
                         3; /* 8-bit todo */
 
                 /* We can't cross xy/zw boundaries. TODO: vec8 can */
-                if (size == 16)
+                if (size == 16 && min_alignment[dest] != 4)
                         min_bound[dest] = 8;
 
                 mir_foreach_src(ins, s) {



More information about the mesa-commit mailing list