From: Rob Clark Date: Tue, 28 Jul 2020 16:47:38 +0000 (-0700) Subject: freedreno/rnn: add relaxed boolean type X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=61ae65a73d4a4ddba05c3531de94cf2974fb83a7;p=mesa.git freedreno/rnn: add relaxed boolean type In the schema, boolean means strictly "true" or "false". But rnn parsing code was looking for "yes"/"1"/"no"/"0". So split the difference, and add a relaxed boolean type, and update rnn to also accept "true" or "false". Signed-off-by: Rob Clark Part-of: --- diff --git a/src/freedreno/registers/rules-ng.xsd b/src/freedreno/registers/rules-ng.xsd index a5a33412aed..e5f80efaee5 100644 --- a/src/freedreno/registers/rules-ng.xsd +++ b/src/freedreno/registers/rules-ng.xsd @@ -80,7 +80,7 @@ - + @@ -166,8 +166,8 @@ - - + + @@ -200,8 +200,8 @@ - - + + @@ -315,6 +315,17 @@ + + + + + + + + + + + Access diff --git a/src/freedreno/rnn/rnn.c b/src/freedreno/rnn/rnn.c index d6ba6fa5005..17abf79715c 100644 --- a/src/freedreno/rnn/rnn.c +++ b/src/freedreno/rnn/rnn.c @@ -124,9 +124,9 @@ static char *getattrib (struct rnndb *db, char *file, int line, xmlAttr *attr) { static int getboolattrib (struct rnndb *db, char *file, int line, xmlAttr *attr) { char *c = getattrib(db, file, line, attr); - if (!strcmp(c, "yes") || !strcmp(c, "1")) + if (!strcmp(c, "yes") || !strcmp(c, "1") || !strcmp(c, "true")) return 1; - if (!strcmp(c, "no") || !strcmp(c, "0")) + if (!strcmp(c, "no") || !strcmp(c, "0") || !strcmp(c, "false")) return 0; rnn_err(db, "%s:%d: invalid boolean value \"%s\" in attribute \"%s\"\n", file, line, c, attr->name); return 0;