summaryrefslogtreecommitdiffstats
path: root/src/intel/common/gen_decoder.c
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2018-04-03 11:45:24 +0100
committerLionel Landwerlin <[email protected]>2018-04-03 16:55:53 +0100
commit78c18d99dc3c53e1026744835b202f89e7f7dfb6 (patch)
tree1c1ed383b567d0e0506d378fe6cef97b9b75d34f /src/intel/common/gen_decoder.c
parent4d591272130c2d285b87e7925f620fcefdc2305e (diff)
intel: gen-decoder: print all dword a field belongs to
Prior to printing a decoded field, print out all dwords that field belongs to. In particular with address fields spanning multiple dwords, we want to have all the dwords presented before the field is decoded to make it easier to read. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Scott D Phillips <[email protected]>
Diffstat (limited to 'src/intel/common/gen_decoder.c')
-rw-r--r--src/intel/common/gen_decoder.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c
index 595fa29e43d..1b8123bf394 100644
--- a/src/intel/common/gen_decoder.c
+++ b/src/intel/common/gen_decoder.c
@@ -841,7 +841,8 @@ iter_advance_field(struct gen_field_iterator *iter)
int group_member_offset = iter_group_offset_bits(iter, iter->group_iter);
- iter->bit = group_member_offset + iter->field->start;
+ iter->start_bit = group_member_offset + iter->field->start;
+ iter->end_bit = group_member_offset + iter->field->end;
iter->struct_desc = NULL;
return true;
@@ -852,10 +853,10 @@ iter_decode_field_raw(struct gen_field_iterator *iter, uint64_t *qw)
{
*qw = 0;
- int field_start = iter->p_bit + iter->bit;
- int field_end = field_start + (iter->field->end - iter->field->start);
+ int field_start = iter->p_bit + iter->start_bit;
+ int field_end = iter->p_bit + iter->end_bit;
- const uint32_t *p = iter->p + (iter->bit / 32);
+ const uint32_t *p = iter->p + (iter->start_bit / 32);
if (iter->p_end && p >= iter->p_end)
return false;
@@ -1040,7 +1041,7 @@ gen_print_group(FILE *outfile, struct gen_group *group, uint64_t offset,
gen_field_iterator_init(&iter, group, p, p_bit, color);
do {
- int iter_dword = iter.bit / 32;
+ int iter_dword = iter.end_bit / 32;
if (last_dword != iter_dword) {
for (int i = last_dword + 1; i <= iter_dword; i++)
print_dword_header(outfile, &iter, offset, i);
@@ -1051,7 +1052,7 @@ gen_print_group(FILE *outfile, struct gen_group *group, uint64_t offset,
if (iter.struct_desc) {
uint64_t struct_offset = offset + 4 * iter_dword;
gen_print_group(outfile, iter.struct_desc, struct_offset,
- &p[iter_dword], iter.bit % 32, color);
+ &p[iter_dword], iter.start_bit % 32, color);
}
}
} while (gen_field_iterator_next(&iter));