v3d: Stop doing pretty-printed colorful booleans in CLIF output.
authorEric Anholt <eric@anholt.net>
Mon, 25 Jun 2018 22:18:51 +0000 (15:18 -0700)
committerEric Anholt <eric@anholt.net>
Sat, 28 Jul 2018 00:55:57 +0000 (17:55 -0700)
The parser wants to see a 1 or 0.  We can put "true" and "false" in a
comment to clarify that it's a boolean and the parser will skip it.

src/broadcom/cle/v3d_decoder.c
src/broadcom/cle/v3d_decoder.h
src/broadcom/clif/clif_dump.c
src/broadcom/clif/v3dx_dump.c
src/gallium/drivers/vc4/vc4_cl_dump.c

index de57e5f5acbed0a8b9005d4632fb895b4d50c0b9..f97aa6604cb1a5218b8d93959e273332f7707e6e 100644 (file)
@@ -742,14 +742,12 @@ v3d_group_get_length(struct v3d_group *group)
 void
 v3d_field_iterator_init(struct v3d_field_iterator *iter,
                         struct v3d_group *group,
-                        const uint8_t *p,
-                        bool print_colors)
+                        const uint8_t *p)
 {
         memset(iter, 0, sizeof(*iter));
 
         iter->group = group;
         iter->p = p;
-        iter->print_colors = print_colors;
 }
 
 static const char *
@@ -865,14 +863,11 @@ v3d_field_iterator_next(struct v3d_field_iterator *iter)
                 enum_name = v3d_get_enum_name(&iter->field->inline_enum, value);
                 break;
         }
-        case V3D_TYPE_BOOL: {
-                const char *true_string =
-                        iter->print_colors ? "\e[0;35mtrue\e[0m" : "true";
+        case V3D_TYPE_BOOL:
                 snprintf(iter->value, sizeof(iter->value), "%s",
                          __gen_unpack_uint(iter->p, s, e) ?
-                         true_string : "false");
+                         "1 /* true */" : "0 /* false */");
                 break;
-        }
         case V3D_TYPE_FLOAT:
                 snprintf(iter->value, sizeof(iter->value), "%f",
                          __gen_unpack_float(iter->p, s, e));
@@ -926,18 +921,18 @@ v3d_field_iterator_next(struct v3d_field_iterator *iter)
 
 void
 v3d_print_group(struct clif_dump *clif, struct v3d_group *group,
-                uint64_t offset, const uint8_t *p, bool color)
+                uint64_t offset, const uint8_t *p)
 {
         struct v3d_field_iterator iter;
 
-        v3d_field_iterator_init(&iter, group, p, color);
+        v3d_field_iterator_init(&iter, group, p);
         while (v3d_field_iterator_next(&iter)) {
                 fprintf(clif->out, "    %s: %s\n", iter.name, iter.value);
                 if (iter.struct_desc) {
                         uint64_t struct_offset = offset + iter.offset;
                         v3d_print_group(clif, iter.struct_desc,
                                         struct_offset,
-                                        &p[iter.offset], color);
+                                        &p[iter.offset]);
                 }
         }
 }
index 2987f3920a190ada5ad8c4c5dd79e3e0b2427fa3..e147b1ea703f827adccafaf2b20cdb96d7f046a5 100644 (file)
@@ -58,7 +58,6 @@ struct v3d_field_iterator {
         int group_iter;
 
         struct v3d_field *field;
-        bool print_colors;
 };
 
 struct v3d_group {
@@ -135,14 +134,12 @@ struct v3d_field {
 
 void v3d_field_iterator_init(struct v3d_field_iterator *iter,
                              struct v3d_group *group,
-                             const uint8_t *p,
-                             bool print_colors);
+                             const uint8_t *p);
 
 bool v3d_field_iterator_next(struct v3d_field_iterator *iter);
 
 void v3d_print_group(struct clif_dump *clif,
                      struct v3d_group *group,
-                     uint64_t offset, const uint8_t *p,
-                     bool color);
+                     uint64_t offset, const uint8_t *p);
 
 #endif /* V3D_DECODER_H */
index b48a156c5fa62a95153a9e80cfbc4c1f0416cc93..f297c774b5a68980dedba096626aa920fb849212 100644 (file)
@@ -143,12 +143,12 @@ clif_dump_gl_shader_state_record(struct clif_dump *clif,
         assert(attr);
 
         out(clif, "GL Shader State Record at 0x%08x\n", reloc->addr);
-        v3d_print_group(clif, state, 0, vaddr, "");
+        v3d_print_group(clif, state, 0, vaddr);
         vaddr += v3d_group_get_length(state);
 
         for (int i = 0; i < reloc->shader_state.num_attrs; i++) {
                 out(clif, "  Attribute %d\n", i);
-                v3d_print_group(clif, attr, 0, vaddr, "");
+                v3d_print_group(clif, attr, 0, vaddr);
                 vaddr += v3d_group_get_length(attr);
         }
 }
index 2229fe9d25c03e9df8febf6d5bf8deee4fc2bb05..1d1e0b87a9a7b276cc5207b338dac0fb2ba97ce4 100644 (file)
@@ -47,7 +47,7 @@ v3dX(clif_dump_packet)(struct clif_dump *clif, uint32_t offset,
         *size = v3d_group_get_length(inst);
 
         out(clif, "%s\n", v3d_group_get_name(inst));
-        v3d_print_group(clif, inst, 0, cl, "");
+        v3d_print_group(clif, inst, 0, cl);
 
         switch (*cl) {
         case V3DX(GL_SHADER_STATE_opcode): {
@@ -87,7 +87,7 @@ v3dX(clif_dump_packet)(struct clif_dump *clif, uint32_t offset,
                 cl += *size;
 
                 for (int i = 0; i < values.number_of_16_bit_output_data_specs_following; i++) {
-                        v3d_print_group(clif, spec, 0, cl, "");
+                        v3d_print_group(clif, spec, 0, cl);
                         cl += v3d_group_get_length(spec);
                         *size += v3d_group_get_length(spec);
                 }
@@ -107,13 +107,13 @@ v3dX(clif_dump_packet)(struct clif_dump *clif, uint32_t offset,
                 cl += *size;
 
                 for (int i = 0; i < values.number_of_16_bit_output_data_specs_following; i++) {
-                        v3d_print_group(clif, spec, 0, cl, "");
+                        v3d_print_group(clif, spec, 0, cl);
                         cl += v3d_group_get_length(spec);
                         *size += v3d_group_get_length(spec);
                 }
 
                 for (int i = 0; i < values.number_of_32_bit_output_buffer_address_following; i++) {
-                        v3d_print_group(clif, addr, 0, cl, "");
+                        v3d_print_group(clif, addr, 0, cl);
                         cl += v3d_group_get_length(addr);
                         *size += v3d_group_get_length(addr);
                 }
index bd2d7137c582da1551d4637b990cd9882f08ae76..bb26b057a447609ef88cabe3d6410478052a0f7a 100644 (file)
@@ -63,7 +63,7 @@ vc4_dump_cl(void *cl, uint32_t size, bool is_render)
                 fprintf(stderr, "0x%08x 0x%08x: 0x%02x %s\n",
                         offset, hw_offset, header, v3d_group_get_name(inst));
 
-                v3d_print_group(clif, inst, offset, p, "");
+                v3d_print_group(clif, inst, offset, p);
 
                 switch (header) {
                 case VC4_PACKET_HALT: