diff options
author | Lionel Landwerlin <[email protected]> | 2017-04-02 01:07:37 +0100 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2017-04-03 20:45:34 +0100 |
commit | 471c1bc7ccd33caa38bbf7124691ccf6884ac5f8 (patch) | |
tree | 35d1265e38c80b617608dc3838d6e8c1f524ce47 /src/intel | |
parent | 04f2e802576b914b913137cd1f47f23c93884733 (diff) |
aubinator/gen_decoder/i965: decode instructions from dword 0
Some packets like 3DSTATE_VF_STATISTICS, 3DSTATE_DRAWING_RECTANGLE,
3DPRIMITIVE, PIPELINE_SELECT, etc... have configurable fields in
dword0, we probably want to print those.
Signed-off-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/common/gen_decoder.c | 21 | ||||
-rw-r--r-- | src/intel/common/gen_decoder.h | 2 | ||||
-rw-r--r-- | src/intel/tools/aubinator.c | 5 |
3 files changed, 20 insertions, 8 deletions
diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c index 9b587c344de..6cc6896b057 100644 --- a/src/intel/common/gen_decoder.c +++ b/src/intel/common/gen_decoder.c @@ -817,10 +817,23 @@ print_dword_header(FILE *outfile, 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; @@ -831,13 +844,13 @@ gen_print_group(FILE *outfile, struct gen_group *group, 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); } } } diff --git a/src/intel/common/gen_decoder.h b/src/intel/common/gen_decoder.h index ab01d6dd8b5..be37e8a5424 100644 --- a/src/intel/common/gen_decoder.h +++ b/src/intel/common/gen_decoder.h @@ -134,6 +134,6 @@ bool gen_field_iterator_next(struct gen_field_iterator *iter); 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 */ diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c index 322f0df5232..cae578babac 100644 --- a/src/intel/tools/aubinator.c +++ b/src/intel/tools/aubinator.c @@ -99,8 +99,7 @@ static void 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 @@ -722,7 +721,7 @@ parse_commands(struct gen_spec *spec, uint32_t *cmds, int size, int engine) 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) |