offset + 4 * iter->dword, iter->p[iter->dword], iter->dword);
}
+static bool
+is_header_field(struct gen_group *group, struct gen_field *field)
+{
+ uint32_t bits;
+
+ if (field->start > 32)
+ return false;
+
+ bits = (1U << (field->end - field->start + 1)) - 1;
+ bits <<= field->start;
+
+ return (group->opcode_mask & bits) != 0;
+}
+
void
gen_print_group(FILE *outfile, struct gen_group *group,
- uint64_t offset, const uint32_t *p,
- int starting_dword, bool color)
+ uint64_t offset, const uint32_t *p, bool color)
{
struct gen_field_iterator iter;
int last_dword = 0;
print_dword_header(outfile, &iter, offset);
last_dword = iter.dword;
}
- if (iter.dword >= starting_dword) {
+ if (!is_header_field(group, iter.field)) {
fprintf(outfile, " %s: %s\n", iter.name, iter.value);
if (iter.struct_desc) {
uint64_t struct_offset = offset + 4 * iter.dword;
print_dword_header(outfile, &iter, struct_offset);
gen_print_group(outfile, iter.struct_desc, struct_offset,
- &p[iter.dword], 0, color);
+ &p[iter.dword], color);
}
}
}
void gen_print_group(FILE *out,
struct gen_group *group,
uint64_t offset, const uint32_t *p,
- int starting_dword, bool color);
+ bool color);
#endif /* GEN_DECODER_H */
decode_group(struct gen_group *strct, const uint32_t *p, int starting_dword)
{
uint64_t offset = option_print_offsets ? (void *) p - gtt : 0;
- gen_print_group(outfile, strct, offset, p, starting_dword,
- option_color == COLOR_ALWAYS);
+ gen_print_group(outfile, strct, offset, p, option_color == COLOR_ALWAYS);
}
static void
gen_group_get_name(inst), reset_color);
if (option_full_decode) {
- decode_group(inst, p, 1);
+ decode_group(inst, p, 0);
for (i = 0; i < ARRAY_LENGTH(custom_handlers); i++) {
if (gen_group_get_opcode(inst) == custom_handlers[i].opcode)
fprintf(stderr, "%s\n", struct_name);
gen_print_group(stderr, group, gtt_offset + offset,
- &data[offset / 4], 0, color);
+ &data[offset / 4], color);
}
static void
for (int i = 0; i < entries; i++) {
fprintf(stderr, "%s %d\n", struct_name, i);
gen_print_group(stderr, group, gtt_offset + offset,
- &data[(offset + i * struct_size) / 4], 0, color);
+ &data[(offset + i * struct_size) / 4], color);
}
}
fprintf(stderr, "%s0x%08"PRIx64": 0x%08x: %-80s%s\n", header_color,
offset, p[0], gen_group_get_name(inst), reset_color);
- gen_print_group(stderr, inst, offset, p, 1, color);
+ gen_print_group(stderr, inst, offset, p, color);
switch (gen_group_get_opcode(inst) >> 16) {
case _3DSTATE_PIPELINED_POINTERS:
for (int i = 0; i < bt_entries; i++) {
fprintf(stderr, "SURFACE_STATE - BTI = %d\n", i);
gen_print_group(stderr, group, gtt_offset + bt_pointers[i],
- &data[bt_pointers[i] / 4], 0, color);
+ &data[bt_pointers[i] / 4], color);
}
break;
}