Module: Mesa
Branch: main
Commit: 3bd1401075b1ea69df3f8feb8efe8ce817e309aa
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3bd1401075b1ea69df3f8feb8efe8ce817e309aa

Author: Alyssa Rosenzweig <[email protected]>
Date:   Sun Mar 13 13:51:20 2022 -0400

pan/va: Handle uniforms from page 1

Like Bifrost, Valhall can access 2x as many fast acess uniforms as previously
thought. However, on Valhall this requires using the pagination mechanism.
Support this in the dis/assembler.

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15364>

---

 src/panfrost/bifrost/valhall/asm.py                   | 4 ++--
 src/panfrost/bifrost/valhall/disasm.py                | 2 +-
 src/panfrost/bifrost/valhall/test/assembler-cases.txt | 2 ++
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/panfrost/bifrost/valhall/asm.py 
b/src/panfrost/bifrost/valhall/asm.py
index 413932bee77..256b7aa46b3 100644
--- a/src/panfrost/bifrost/valhall/asm.py
+++ b/src/panfrost/bifrost/valhall/asm.py
@@ -111,9 +111,9 @@ def encode_source(op, fau):
     elif op[0] == 'r':
         return parse_int(op[1:], 0, 63)
     elif op[0] == 'u':
-        val = parse_int(op[1:], 0, 63)
+        val = parse_int(op[1:], 0, 127)
         fau.set_page(val >> 6)
-        return val | 0x80
+        return (val & 0x3F) | 0x80
     elif op[0] == 'i':
         return int(op[3:]) | 0xC0
     elif op in enums['thread_storage_pointers'].bare_values:
diff --git a/src/panfrost/bifrost/valhall/disasm.py 
b/src/panfrost/bifrost/valhall/disasm.py
index a05c6b8b657..2ff679e6d32 100644
--- a/src/panfrost/bifrost/valhall/disasm.py
+++ b/src/panfrost/bifrost/valhall/disasm.py
@@ -102,7 +102,7 @@ va_print_src(FILE *fp, uint8_t src, unsigned imm_mode)
             fprintf(fp, "0x%X", va_immediates[value]);
         }
        } else if (type == VA_SRC_UNIFORM_TYPE) {
-               fprintf(fp, "u%u", value);
+               fprintf(fp, "u%u", value | (imm_mode << 6));
        } else {
                bool discard = (type & 1);
                fprintf(fp, "%sr%u", discard ? "`" : "", value);
diff --git a/src/panfrost/bifrost/valhall/test/assembler-cases.txt 
b/src/panfrost/bifrost/valhall/test/assembler-cases.txt
index dc79559bbff..c83d88f12af 100644
--- a/src/panfrost/bifrost/valhall/test/assembler-cases.txt
+++ b/src/panfrost/bifrost/valhall/test/assembler-cases.txt
@@ -214,3 +214,5 @@ f0 00 3c 32 08 40 7f 78    BLEND.slot0.v4.f32.return 
@r0:r1:r2:r3, blend_descrip
 c0 00 00 00 00 f6 10 01    IADD_IMM.i32 r54, 0x0, #0x0
 c0 f1 00 00 10 c1 2f 08    BRANCHZI.eq.absolute.wait0 0x0, blend_descriptor_0_y
 80 00 c0 17 34 7c 25 01    TEX_FETCH.slot0.f.32.2d @r0:r1:r2:r3, @r60:r61, u0
+80 00 00 00 00 c1 91 02    MOV.i32 r1, u64
+81 00 00 00 00 c1 91 02    MOV.i32 r1, u65

Reply via email to