Mesa (master): freedreno/cffdec: Stop open-coding enum parsing

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Aug 1 18:01:07 UTC 2020


Module: Mesa
Branch: master
Commit: 8d0e5e062667fa995779575ce1015fb8d34eef9a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8d0e5e062667fa995779575ce1015fb8d34eef9a

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Fri Jul 31 11:45:09 2020 +0200

freedreno/cffdec: Stop open-coding enum parsing

Now that rnndec_decode_enum() has been fixed, it does the same thing as
this function.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6140>

---

 src/freedreno/decode/rnnutil.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/src/freedreno/decode/rnnutil.c b/src/freedreno/decode/rnnutil.c
index ae5fe826834..74e06ac6289 100644
--- a/src/freedreno/decode/rnnutil.c
+++ b/src/freedreno/decode/rnnutil.c
@@ -143,19 +143,7 @@ struct rnndecaddrinfo *rnn_reginfo(struct rnn *rnn, uint32_t regbase)
 
 const char *rnn_enumname(struct rnn *rnn, const char *name, uint32_t val)
 {
-	struct rnndeccontext *ctx = rnn->vc;
-	struct rnnenum *en = rnn_findenum(ctx->db, name);
-	if (en) {
-		int i;
-		for (i = 0; i < en->valsnum; i++) {
-			struct rnnvalue *eval = en->vals[i];
-			if (eval->valvalid && eval->value == val &&
-					rnndec_varmatch(ctx, &eval->varinfo)) {
-				return en->vals[i]->name;
-			}
-		}
-	}
-	return NULL;
+	return rnndec_decode_enum(rnn->vc, name, val);
 }
 
 static struct rnndelem *regelem(struct rnndomain *domain, const char *name)



More information about the mesa-commit mailing list