intel/gen_decoder: return -1 for unknown command formats
authorJordan Justen <jordan.l.justen@intel.com>
Tue, 28 Mar 2017 19:03:37 +0000 (12:03 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Thu, 6 Apr 2017 20:26:08 +0000 (13:26 -0700)
commitd5bd0e411ede67f5c56f95ae4d905d8d94c9be2f
tree10be56421c5957e546e47dbdcde8406a463a039f
parent7c33372f82707d42293b1772d53ab50a2f56d6a3
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 <jordan.l.justen@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/common/gen_decoder.c
src/intel/tools/aubinator.c
src/intel/tools/aubinator_error_decode.c
src/mesa/drivers/dri/i965/intel_batchbuffer.c