aboutsummaryrefslogtreecommitdiffstats
path: root/src/broadcom
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-06-25 15:18:51 -0700
committerEric Anholt <[email protected]>2018-07-27 17:55:57 -0700
commit3c02838d2956692101ae205f1aff362fa3a93c76 (patch)
tree29212902352d823cf674c5afb94fc3b3bb3cd5e5 /src/broadcom
parent422910d2e75063b80ffcc16aa4087880f20319c1 (diff)
v3d: Stop doing pretty-printed colorful booleans in CLIF output.
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.
Diffstat (limited to 'src/broadcom')
-rw-r--r--src/broadcom/cle/v3d_decoder.c17
-rw-r--r--src/broadcom/cle/v3d_decoder.h7
-rw-r--r--src/broadcom/clif/clif_dump.c4
-rw-r--r--src/broadcom/clif/v3dx_dump.c8
4 files changed, 14 insertions, 22 deletions
diff --git a/src/broadcom/cle/v3d_decoder.c b/src/broadcom/cle/v3d_decoder.c
index de57e5f5acb..f97aa6604cb 100644
--- a/src/broadcom/cle/v3d_decoder.c
+++ b/src/broadcom/cle/v3d_decoder.c
@@ -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]);
}
}
}
diff --git a/src/broadcom/cle/v3d_decoder.h b/src/broadcom/cle/v3d_decoder.h
index 2987f3920a1..e147b1ea703 100644
--- a/src/broadcom/cle/v3d_decoder.h
+++ b/src/broadcom/cle/v3d_decoder.h
@@ -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 */
diff --git a/src/broadcom/clif/clif_dump.c b/src/broadcom/clif/clif_dump.c
index b48a156c5fa..f297c774b5a 100644
--- a/src/broadcom/clif/clif_dump.c
+++ b/src/broadcom/clif/clif_dump.c
@@ -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);
}
}
diff --git a/src/broadcom/clif/v3dx_dump.c b/src/broadcom/clif/v3dx_dump.c
index 2229fe9d25c..1d1e0b87a9a 100644
--- a/src/broadcom/clif/v3dx_dump.c
+++ b/src/broadcom/clif/v3dx_dump.c
@@ -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);
}