v3d: CLIF-dump the "Vec size" field as 0 == maximum value.
authorEric Anholt <eric@anholt.net>
Wed, 27 Jun 2018 23:34:50 +0000 (16:34 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 27 Jul 2018 19:56:36 +0000 (12:56 -0700)
That's what a user should want to see, and what the CLIF parser wants.
This should maybe be generalized.

src/broadcom/cle/v3d_decoder.c

index 832ff3c7089329b371bdea5ebaefcf974f5d4f79..e1ce2f65e892f882ed4a31018e04dc89b56e095e 100644 (file)
@@ -858,6 +858,8 @@ v3d_field_iterator_next(struct v3d_field_iterator *iter)
                 uint32_t value = __gen_unpack_uint(iter->p, s, e);
                 if (iter->field->minus_one)
                         value++;
+                if (strcmp(iter->field->name, "Vec size") == 0 && value == 0)
+                        value = 1 << (e - s);
                 snprintf(iter->value, sizeof(iter->value), "%u", value);
                 enum_name = v3d_get_enum_name(&iter->field->inline_enum, value);
                 break;