summaryrefslogtreecommitdiff
path: root/src/intel/tools/aubinator.c
AgeCommit message (Collapse)AuthorFilesLines
2018-08-06intel: aubinator: fix read the context/ringLionel Landwerlin1-2/+2
Up to now we've been lucky that the buffer returned was always exactly at the address we requested. Fixes: 144b40db5411 ("intel: aubinator: drop the 1Tb GTT mapping") Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com> (cherry picked from commit 35955afa7aa49906fad772b44d3e6357203430ae)
2018-07-05intel/tools/aubinator: aubinate ppgtt aubsScott D Phillips1-1/+72
v2: by Lionel Fix memfd_create compilation issue Fix pml4 address stored on 32 instead of 64bits Return no buffer if first ppgtt page is not mapped v3: Drop additional memfd_create() (Rafael) Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2018-07-05intel: aubinator: handle GGTT mappingsLionel Landwerlin1-13/+244
We use memfd to store physical pages as they get read/written to and the GGTT entries translating virtual address to physical pages. Based on a commit by Scott Phillips. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2018-07-05intel: aubinator: drop the 1Tb GTT mappingLionel Landwerlin1-55/+75
Now that we're softpinning the address of our BOs in anv & i965, the addresses selected start at the top of the addressing space. This is a problem for the current implementation of aubinator which uses only a 40bit mmapped address space. This change keeps track of all the memory writes from the aub file and fetch them on request by the batch decoder. As a result we can get rid of the 1<<40 mmapped address space and only rely on the mmap aub file \o/ Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2018-07-05intel: aubinator: rework register writes handlingLionel Landwerlin1-28/+54
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2018-07-05intel: aubinator: remove standard input processing optionLionel Landwerlin1-90/+12
On a follow up commit in this series, we stop copying the data from the mmap'ed file into our big gtt mmap, and start referencing data in it directly. So reallocating the read buffer and adding more data from stdin wouldn't work. For that reason, let's stop supporting stdin process. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2018-07-05intel: aubinator: remove unused variablesLionel Landwerlin1-5/+0
These memory offsets are stored in the gen_batch_decode_ctx. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2018-06-20intel/aubinator: drop unused functionsEric Engestrom1-16/+0
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2018-06-15intel/aubinator: Use int to store getopt_long flags.Rafael Antognolli1-2/+2
getopt_long flag parameter is an int pointer, so if we use bool to store those values, when getopt_long writes to one of them, it might end up overwriting the next one. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2018-05-02intel: aubinator: add an option to limit the number of decoded VBO linesLionel Landwerlin1-16/+23
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2018-05-02intel: fix aubinator includeLionel Landwerlin1-1/+1
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Fixes: 7c22c150c40b3 ("intel: Move batch decoder/disassembler from tools/ to common/") Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2018-05-02intel: Give the batch decoder a callback to ask about state size.Kenneth Graunke1-1/+1
Given an arbitrary batch, we don't always know what the size of certain things are, such as how many entries are in a binding table. But it's easy for the driver to track that information, so with a simple callback we can calculate this correctly for INTEL_DEBUG=bat. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2018-03-22intel/tools/aubinator: Drop platform list from print_help()Matt Turner1-1/+1
We all know the platform names, and I don't want to update this list continually. Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2018-03-21intel/tools: aubinator: Catch gen11 "enhanced execlist" submissionScott D Phillips1-6/+20
Different registers are used for execlist submission in gen11, so also watch those. This code only watches element zero of the submit queue, which is all aubdump currently writes. Tested-by: Rafael Antognolli <rafael.antognolli@intel.com> Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2018-02-27intel/tools: Use gen_device_name_to_pci_device_id in aubinatorJordan Justen1-24/+6
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
2018-01-08aubinator: add support for aubinating memtrace aubsScott D Phillips1-35/+83
Memtrace aubs are similar to classic aubs, with the major difference being how command submission is serialized (as register writes instead of a high-level submit message). Some internal tools generate or consume only memtrace aubs. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2018-01-08aubinator: extract aubinator_init() out of the header handler functionScott D Phillips1-16/+23
A later patch will use the aubinator_init() function from the memtrace aub header handler. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2018-01-08aubinator: honor --color option when printing the headerScott D Phillips1-1/+5
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2017-12-14intel/tools: Convert aubinator over to the common frameworkJason Ekstrand1-689/+30
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-12-14intel/disasm: Take a devinfo in gen_disasm_createJason Ekstrand1-1/+1
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-12-14intel/decoder: Take a bit offset in gen_print_groupJason Ekstrand1-1/+1
Previously, if a group was nested in another group such that it didn't start on a dword boundary, we would decode it as if it started at the start of its first dword. This changes things to work even more in terms of bits so that we can properly decode these structs. This affects MOCS, attribute swizzles, and several other things. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-07-13aubinator: don't leak fd of opened aubfileLionel Landwerlin1-0/+2
CID: 1373563 Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
2017-06-22aubinator: Dump sampler state pointers on gen6 too.Rafael Antognolli1-0/+11
We already have a function to dump sampler states, so do that for gen6 too. Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-06-09i965/cnl: Add cnl bits in aubinatorAnuj Phogat1-3/+5
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-06-06intel: gen-decoder: rework how we handle groupsLionel Landwerlin1-18/+0
The current way of handling groups doesn't seem to be able to handle MI_LOAD_REGISTER_* with more than one register. This change reworks the way we handle groups by building a traversal list on loading the GENXML files. Let's say you have Instruction { Field0 Field1 Field2 Group0 (count=2) { Field0-0 Field0-1 } Group1 (count=4) { Field1-0 Field1-1 } } We build of linked on load that goes : Instruction -> Group0 -> Group1 All of those are gen_group structures, making the traversal trivial. We just need to iterate groups for the right number of timers (count field in genxml). The more fancy case is when you have only a single group of unknown size (count=0). In that case we keep on reading that group for as long as we're within the DWordLength of that instruction. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2017-04-24intel/aubinator: Correctly read variable length structs.Rafael Antognolli1-0/+19
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>
2017-04-06intel/aubinator: Stop searching after a custom handler is foundJordan Justen1-1/+3
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-04-06intel/gen_decoder: return -1 for unknown command formatsJordan Justen1-3/+4
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>
2017-04-03aubinator/gen_decoder/i965: decode instructions from dword 0Lionel Landwerlin1-3/+2
Some packets like 3DSTATE_VF_STATISTICS, 3DSTATE_DRAWING_RECTANGLE, 3DPRIMITIVE, PIPELINE_SELECT, etc... have configurable fields in dword0, we probably want to print those. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
2017-03-31aubinator: enable snb/ilk through --genLionel Landwerlin1-0/+2
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2017-03-21intel: Move tools/decoder.[ch] to common/gen_decoder.[ch].Kenneth Graunke1-1/+1
This way they become part of libintel_common.la so I can use them in the i965 driver. Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-03-20aubinator: Move the guts of decode_group() to decoder.c.Kenneth Graunke1-31/+3
This lets us use it outside of the aubinator binary itself. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-03-20aubinator: Drop spec parameter to decode_group().Kenneth Graunke1-13/+12
No longer necessary - the iterator gets it from the group. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-03-20aubinator: Make the iterator store a pointer to structure descriptions.Kenneth Graunke1-26/+6
When the iterator encounters a structure field, it now looks up the gen_group for that structure definition and saves a pointer to it. This lets us drop a lot of ridiculous code in the caller, which looked at item->value (<struct NAME dword>), strtok'd the structure name back out, and looked it up itself. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-03-20aubinator: Track the current field's starting dword offset.Kenneth Graunke1-22/+13
The iterator code already computed this value, then we stored it in the structure name, strtok'd it back out, and also manually computed it when printing dword headers. Just put the value in the struct and use it. Way simpler. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-03-20aubinator: Drop decode_structure() helper.Kenneth Graunke1-16/+9
It made more sense when decode_group() took a bunch of extra options, but now that there's only one...we may as well pass 0 and call it a day. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-03-20aubinator: Drop unused print_dword_headers flag.Kenneth Graunke1-5/+4
I added this flag in 65a9d5eabb05e4925c1c9a17836cad57304210d6 but it was completely unused. Both callers appear to have printed dword headers, so we can just drop the flag and continue doing it unconditionally. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-03-20aubinator: Store enum textual name in iter->value.Kenneth Graunke1-6/+1
gen_field_iterator_next() produces a string representing the value of the field. For enum values, it also produced a separate "description" string containing the textual name of the enum. The only caller of this function combines the two, printing enums as "<numeric value> (<texture enum name>)". We may as well just store that in item->value directly, eliminating the description field, and a layer of wrapping. v2: Use non-overlapping source and destination strings in snprintf. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-03-16aubinator: Use fprintf for output.Kenneth Graunke1-69/+73
This will make it easier to choose an output file. For now, it remains stdout. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-03-16aubinator: Reuse decode_structure code for handling commandsKenneth Graunke1-23/+16
The code for decoding structures and commands was almost identical. The only differences are: we print dword headers for commands, and we skip the first one (with the command opcode and lengths). So, generalize decode_structure to add a starting DWord, and a flag for printing the DWord headers, and reuse it. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-03-16aubinator: Delete redundant NULL check.Kenneth Graunke1-10/+3
handle_struct_decode() is just a wrapper around decode_structure() with a NULL check. But the only caller already does that NULL check. So, just use decode_structure() directly. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-03-16aubinator: Fix indentation.Kenneth Graunke1-7/+6
Three space, not four. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2016-12-11intel/aubinator: fix 32bit shift overflow warningGrazvydas Ignotas1-1/+1
Doesn't look like this can work on 32bit, just rids of annoying warning. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
2016-11-28intel/aubinator: Pull useful information from the AUB headerJason Ekstrand1-2/+32
This commit does two things. One is to pull useful and/or interesting information from the AUB file header and display it as a header above your decoded batches. Second, it is now capable of pulling the PCI ID from the AUB file comment left by intel_aubdump. This removes the need to use the --gen flag all the time. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-11-28intel/aubinator: Wait to setup decoders until we parse the aub headerJason Ekstrand1-23/+28
This requires that a few more state bits become global. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-11-28intel/aubinator: Rework handling of the --gen flagJason Ekstrand1-20/+16
This makes it just store the pci_id instead of a struct pointer Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-11-28intel/aubinator: Trust the packet size in the header for SUBOPCODE_HEADERJason Ekstrand1-14/+4
We were reading from the "comment size" dword and incrementing by that amount. This never caused a problem because that field was always zero. However, experimenting with actual aub file comments indicates, the simulator seems to include the comment size in the packet size provided in the header. We should do the same. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-11-28intel/aubinator: Add a get_offset helperJason Ekstrand1-10/+19
The helper automatically handles masking for us so we don't have to worry about whether or not something is in the bottom bits. Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2016-11-28intel/aubinator: Fix the kernel start pointer for 3DSTATE_HSJason Ekstrand1-2/+2
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2016-11-28intel/aubinator: Add a get_address helperJason Ekstrand1-16/+31
This new helper is automatically handles 32 vs. 48-bit GTT issues. It also handles 48-bit canonical addresses on Broadwell and above. Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>