From: Rob Clark Date: Tue, 28 Jul 2020 18:01:02 +0000 (-0700) Subject: freedreno/rnn: allow name to be optional in arrays X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=14a7ca577f4f8c655ca06cd7668a6fe33b4a7efc;p=mesa.git 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: --- 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;