Mesa (master): pan/bi: Fix constant slot selection

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jan 11 19:12:41 UTC 2021


Module: Mesa
Branch: master
Commit: 556a5cb5751ce048d9b64443198bd65593694e7d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=556a5cb5751ce048d9b64443198bd65593694e7d

Author: Boris Brezillon <boris.brezillon at collabora.com>
Date:   Mon Nov 23 23:03:59 2020 +0100

pan/bi: Fix constant slot selection

The fau_index field contains the lower 4 bits of the 64bit constant,
which allows one to reuse the same clause constant slot from different
bundles if the upper 60 bits match. That doesn't work for constants
referenced from the same instruction or for constants referenced from
two instructions that are part of the same bundle though, since the
fau_index is shared in that case.

Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8418>

---

 src/panfrost/bifrost/bi_pack.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/panfrost/bifrost/bi_pack.c b/src/panfrost/bifrost/bi_pack.c
index 5758c2bbe8e..9ff6b82d304 100644
--- a/src/panfrost/bifrost/bi_pack.c
+++ b/src/panfrost/bifrost/bi_pack.c
@@ -70,7 +70,13 @@ bi_lookup_constant(bi_clause *clause, uint32_t cons, bool *hi)
                 /* Try to apply to top or to bottom */
                 uint64_t top = clause->constants[i];
 
-                if (cons == ((uint32_t) top | (cons & 0xF)))
+                /* Constant slots can actually be used by a different
+                 * tuples if the 60 upper bits match since the 4 LSB are
+                 * encoded in the tuple itself. Let's not bother about this
+                 * case until we start scheduling more than one tuple per
+                 * clause.
+                 */
+                if (cons == (uint32_t) top)
                         return i;
 
                 if (cons == (top >> 32ul)) {



More information about the mesa-commit mailing list