From 69ddbc4341160ab2ac8cd76fa4a030ccebb80d4e Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 15 Nov 2021 18:15:42 -0500 Subject: [PATCH] pan/bi: Suppress uniform validation for LD_BUFFER Seems to be ok and used by the DDK... Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/valhall/asm.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/panfrost/bifrost/valhall/asm.py b/src/panfrost/bifrost/valhall/asm.py index 7ad678767b6..c088eb66eb8 100644 --- a/src/panfrost/bifrost/valhall/asm.py +++ b/src/panfrost/bifrost/valhall/asm.py @@ -33,8 +33,9 @@ class ParseError(Exception): self.error = error class FAUState: - def __init__(self, mode): + def __init__(self, mode, single_uniform_slot = True): self.mode = mode + self.single_uniform_slot = single_uniform_slot self.uniform_slot = None self.special = None self.buffer = set() @@ -60,7 +61,10 @@ class FAUState: 'Expected uniform with default immediate mode') die_if(self.uniform_slot is not None and self.uniform_slot != slot, 'Overflowed uniform slots') - self.uniform_slot = slot + + if self.single_uniform_slot: + self.uniform_slot = slot + self.push(f'uniform{v}') def id(self, s): @@ -240,7 +244,10 @@ def parse_asm(line): # Set a placeholder writemask to prevent encoding faults encoded |= (0xC0 << 40) - fau = FAUState(immediate_mode) + # TODO: Determine which instructions can only have address a single uniform + single_uniform_slot = not ins.name.startswith('LD_BUFFER') + + fau = FAUState(immediate_mode, single_uniform_slot = single_uniform_slot) for i, (op, src) in enumerate(zip(operands, ins.srcs)): parts = op.split('.')