diff options
author | Jordan Justen <[email protected]> | 2017-03-28 12:03:37 -0700 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2017-04-06 13:26:08 -0700 |
commit | d5bd0e411ede67f5c56f95ae4d905d8d94c9be2f (patch) | |
tree | 10be56421c5957e546e47dbdcde8406a463a039f /src/intel/tools/aubinator.c | |
parent | 7c33372f82707d42293b1772d53ab50a2f56d6a3 (diff) |
intel/gen_decoder: return -1 for unknown command formats
Decoding with aubinator encountered a command of 0xffffffff. With the
previous code, it caused aubinator to jump 255 + 2 dwords to start
decoding again.
Instead we can attempt to detect the known instruction formats. If the
format is not recognized, then we can advance just 1 dword.
v2:
* Update aubinator_error_decode
* Actually convert the length variable returned into a *signed* integer
in aubinator.c, intel_batchbuffer.c and aubinator_error_decode.c.
Signed-off-by: Jordan Justen <[email protected]>
Acked-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel/tools/aubinator.c')
-rw-r--r-- | src/intel/tools/aubinator.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c index cae578babac..05d932ea6c7 100644 --- a/src/intel/tools/aubinator.c +++ b/src/intel/tools/aubinator.c @@ -682,17 +682,18 @@ static void parse_commands(struct gen_spec *spec, uint32_t *cmds, int size, int engine) { uint32_t *p, *end = cmds + size / 4; - unsigned int length, i; + int length, i; struct gen_group *inst; for (p = cmds; p < end; p += length) { inst = gen_spec_find_instruction(spec, p); + length = gen_group_get_length(inst, p); + assert(inst == NULL || length > 0); + length = MAX2(1, length); if (inst == NULL) { fprintf(outfile, "unknown instruction %08x\n", p[0]); - length = (p[0] & 0xff) + 2; continue; } - length = gen_group_get_length(inst, p); const char *color, *reset_color = NORMAL; uint64_t offset; |