panfrost: Use the enum values for counter description generation

Using the enum definitions prevents the category indices to get
out of sync from the block types specified in the XML.

Signed-off-by: Lukas Zapolskas <lukas.zapolskas@arm.com>
This commit is contained in:
Lukas Zapolskas 2025-03-19 15:21:07 +00:00 committed by Christoph Pillmayer
parent 1749999200
commit 23d265928e

View file

@ -26,6 +26,14 @@ class SourceFile:
def outdent(self, n):
self._indent -= n
CATEGORY_IDX_REMAP = {
"Job Manager": "PAN_PERF_COUNTER_CAT_FRONTEND",
"CSF": "PAN_PERF_COUNTER_CAT_FRONTEND",
"Tiler": "PAN_PERF_COUNTER_CAT_TILER",
"Memory System" : "PAN_PERF_COUNTER_CAT_MEMSYS",
"L2 Cache": "PAN_PERF_COUNTER_CAT_MEMSYS",
"Shader Core": "PAN_PERF_COUNTER_CAT_SHADER",
}
class Counter:
# category Category owning the counter
@ -165,7 +173,7 @@ def main():
c.write(".symbol_name = \"%s\"," % (counter.underscore_name))
c.write(".units = PAN_PERF_COUNTER_UNITS_%s," % (counter.units.upper()))
c.write(".offset = %u," % (counter.offset))
c.write(".category_index = %u," % i)
c.write(".category_index = %s," % CATEGORY_IDX_REMAP[category.name])
c.outdent(tab_size)
c.write("}, // counter")