intel/aubinator: Correctly read variable length structs.
authorRafael Antognolli <rafael.antognolli@intel.com>
Tue, 18 Apr 2017 16:41:40 +0000 (09:41 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 24 Apr 2017 22:13:51 +0000 (15:13 -0700)
commit1ea41163eb0657e7c6cd46c45bdbc3fd4e8e72f8
tree90a04709966e49edf6d5d4569aac84749dba3e73
parent50134cede1eee1222c1a28022b42b2177f7379c2
intel/aubinator: Correctly read variable length structs.

Before this commit, when a group with count="0" is found, only one field
is added to the struct representing the instruction. This causes only
one entry to be printed by aubinator, for variable length groups.

With this commit we "detect" that there's a variable length group
(count="0") and store the offset of the last entry added to the struct
when reading the xml. When finally reading the aubdump file, we check
the size of the group and whether we have variable number of elements,
and in that case, reuse the last field to add the remaining elements.

Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com>
Tested-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/common/gen_decoder.c
src/intel/common/gen_decoder.h
src/intel/tools/aubinator.c