From 14a7ca577f4f8c655ca06cd7668a6fe33b4a7efc Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Tue, 28 Jul 2020 11:01:02 -0700 Subject: [PATCH] freedreno/rnn: allow name to be optional in arrays We are using unnamed arrays to describe repeating portions of a pm4 packet. So allow the name to be optional. Instead of just using the empty-string hack, drop the attribute. Signed-off-by: Rob Clark Part-of: --- src/freedreno/registers/adreno/adreno_pm4.xml | 4 ++-- src/freedreno/registers/gen_header.py | 5 ++++- src/freedreno/registers/rules-ng.xsd | 2 +- src/freedreno/rnn/rnn.c | 2 ++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/freedreno/registers/adreno/adreno_pm4.xml b/src/freedreno/registers/adreno/adreno_pm4.xml index b3ccff223ca..24c95ee9d32 100644 --- a/src/freedreno/registers/adreno/adreno_pm4.xml +++ b/src/freedreno/registers/adreno/adreno_pm4.xml @@ -833,7 +833,7 @@ opcode: CP_LOAD_STATE4 (30) (4 dwords) - + @@ -1497,7 +1497,7 @@ opcode: CP_LOAD_STATE4 (30) (4 dwords) - + diff --git a/src/freedreno/registers/gen_header.py b/src/freedreno/registers/gen_header.py index 291f7e9d299..c0fc47fd8b4 100644 --- a/src/freedreno/registers/gen_header.py +++ b/src/freedreno/registers/gen_header.py @@ -227,7 +227,10 @@ class Bitset(object): class Array(object): def __init__(self, attrs, domain): - self.name = attrs["name"] + if "name" in attrs: + self.name = attrs["name"] + else: + self.name = "" self.domain = domain self.offset = int(attrs["offset"], 0) self.stride = int(attrs["stride"], 0) diff --git a/src/freedreno/registers/rules-ng.xsd b/src/freedreno/registers/rules-ng.xsd index 4e3651d6f32..3a8094f91b1 100644 --- a/src/freedreno/registers/rules-ng.xsd +++ b/src/freedreno/registers/rules-ng.xsd @@ -148,7 +148,7 @@ - + diff --git a/src/freedreno/rnn/rnn.c b/src/freedreno/rnn/rnn.c index 17abf79715c..1a1103706d9 100644 --- a/src/freedreno/rnn/rnn.c +++ b/src/freedreno/rnn/rnn.c @@ -481,6 +481,8 @@ static struct rnndelem *trydelem(struct rnndb *db, char *file, xmlNode *node) { return res; } else if (!strcmp(node->name, "stripe") || !strcmp(node->name, "array")) { struct rnndelem *res = calloc(sizeof *res, 1); + if (!strcmp(node->name, "array")) + res->name = ""; res->type = (strcmp(node->name, "stripe")?RNN_ETYPE_ARRAY:RNN_ETYPE_STRIPE); res->length = 1; res->file = file; -- 2.30.2