summaryrefslogtreecommitdiffstats
path: root/src/intel/common/gen_decoder.c
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2017-04-02 01:07:37 +0100
committerLionel Landwerlin <[email protected]>2017-04-03 20:45:34 +0100
commit471c1bc7ccd33caa38bbf7124691ccf6884ac5f8 (patch)
tree35d1265e38c80b617608dc3838d6e8c1f524ce47 /src/intel/common/gen_decoder.c
parent04f2e802576b914b913137cd1f47f23c93884733 (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/common/gen_decoder.c')
-rw-r--r--src/intel/common/gen_decoder.c21
1 files changed, 17 insertions, 4 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);
}
}
}