Mesa (main): pan/va: Parse units from the XML

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 18 16:13:55 UTC 2022


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

Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date:   Mon Aug  2 15:34:32 2021 -0400

pan/va: Parse units from the XML

We need this information for cycle counting in Valhall.

Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15069>

---

 src/panfrost/bifrost/valhall/valhall.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/panfrost/bifrost/valhall/valhall.py b/src/panfrost/bifrost/valhall/valhall.py
index b90841cf910..c583244797b 100644
--- a/src/panfrost/bifrost/valhall/valhall.py
+++ b/src/panfrost/bifrost/valhall/valhall.py
@@ -170,7 +170,7 @@ class Immediate:
         self.signed = signed
 
 class Instruction:
-    def __init__(self, name, opcode, opcode2, srcs = [], dests = [], immediates = [], modifiers = [], staging = None):
+    def __init__(self, name, opcode, opcode2, srcs = [], dests = [], immediates = [], modifiers = [], staging = None, unit = None):
         self.name = name
         self.srcs = srcs
         self.dests = dests
@@ -179,6 +179,7 @@ class Instruction:
         self.immediates = immediates
         self.modifiers = modifiers
         self.staging = staging
+        self.unit = unit
 
         self.secondary_shift = max(len(self.srcs) * 8, 16)
         self.secondary_mask = 0xF if opcode2 is not None else 0x0
@@ -244,6 +245,7 @@ def build_instr(el, overrides = {}):
     name = overrides.get('name') or el.attrib.get('name')
     opcode = overrides.get('opcode') or el.attrib.get('opcode')
     opcode2 = overrides.get('opcode2') or el.attrib.get('opcode2')
+    unit = overrides.get('unit') or el.attrib.get('unit')
     opcode = int(opcode, base=0)
     opcode2 = int(opcode2, base=0) if opcode2 else None
 
@@ -269,7 +271,7 @@ def build_instr(el, overrides = {}):
         elif mod.tag =='mod':
             modifiers.append(build_modifier(mod))
 
-    instr = Instruction(name, opcode, opcode2, srcs = sources, dests = dests, immediates = imms, modifiers = modifiers, staging = staging)
+    instr = Instruction(name, opcode, opcode2, srcs = sources, dests = dests, immediates = imms, modifiers = modifiers, staging = staging, unit = unit)
 
     instructions.append(instr)
 
@@ -281,6 +283,7 @@ def build_group(el):
             'name': ins.attrib['name'],
             'opcode': ins.attrib.get('opcode'),
             'opcode2': ins.attrib.get('opcode2'),
+            'unit': ins.attrib.get('unit'),
         })
 
 def to_alphanum(name):



More information about the mesa-commit mailing list