aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/tools/aubinator.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-03-19 22:11:52 -0700
committerKenneth Graunke <[email protected]>2017-03-20 11:20:51 -0700
commit40840831244e3d7e46411119b9013d83eef0b6b7 (patch)
tree718e0275ddee21cd9872abafcd5fcebdf438caae /src/intel/tools/aubinator.c
parentaa1ef0b9842834ae6a497c3e34249a9b7b274ca7 (diff)
aubinator: Move the guts of decode_group() to decoder.c.
This lets us use it outside of the aubinator binary itself. Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel/tools/aubinator.c')
-rw-r--r--src/intel/tools/aubinator.c34
1 files changed, 3 insertions, 31 deletions
diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
index 739e95493b6..42cff8c4dc5 100644
--- a/src/intel/tools/aubinator.c
+++ b/src/intel/tools/aubinator.c
@@ -96,39 +96,11 @@ valid_offset(uint32_t offset)
}
static void
-print_dword_header(struct gen_field_iterator *iter, uint64_t offset)
-{
- fprintf(outfile, "0x%08"PRIx64": 0x%08x : Dword %d\n",
- offset + 4 * iter->dword, iter->p[iter->dword], iter->dword);
-}
-
-static void
decode_group(struct gen_group *strct, const uint32_t *p, int starting_dword)
{
- struct gen_field_iterator iter;
- int last_dword = 0;
- uint64_t offset = 0;
-
- if (option_print_offsets)
- offset = (void *) p - gtt;
- else
- offset = 0;
-
- gen_field_iterator_init(&iter, strct, p,
- option_color == COLOR_ALWAYS);
- while (gen_field_iterator_next(&iter)) {
- if (last_dword != iter.dword) {
- print_dword_header(&iter, offset);
- last_dword = iter.dword;
- }
- if (iter.dword >= starting_dword) {
- fprintf(outfile, " %s: %s\n", iter.name, iter.value);
- if (iter.struct_desc) {
- print_dword_header(&iter, offset + 4 * iter.dword);
- decode_group(iter.struct_desc, &p[iter.dword], 0);
- }
- }
- }
+ uint64_t offset = option_print_offsets ? (void *) p - gtt : 0;
+ gen_print_group(outfile, strct, offset, p, starting_dword,
+ option_color == COLOR_ALWAYS);
}
static void