summaryrefslogtreecommitdiffstats
path: root/src/intel/tools
Commit message (Collapse)AuthorAgeFilesLines
* intel/aubinator_error_decode: Disassemble shader programsMatt Turner2017-05-151-3/+181
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* intel/aubinator_error_decode: Stop decoding after MI_BATCH_BUFFER_ENDMatt Turner2017-05-151-0/+3
| | | | Reviewed-by: Topi Pohjolainen <[email protected]>
* intel/tools: Refactor gen_disasm_disassemble() to use annotationsMatt Turner2017-05-151-28/+43
| | | | | | | | Which will allow us to print validation errors found in shader assembly in GPU hang error states. Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* intel/aubinator: Correctly read variable length structs.Rafael Antognolli2017-04-241-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 <[email protected]> Tested-by: Jason Ekstrand <[email protected]> Acked-by: Kenneth Graunke <[email protected]>
* intel/aubinator: Stop searching after a custom handler is foundJordan Justen2017-04-061-1/+3
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/gen_decoder: return -1 for unknown command formatsJordan Justen2017-04-062-6/+8
| | | | | | | | | | | | | | | | | 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]>
* intel/aubinator_error_decode: Fix structure decode dataJordan Justen2017-04-061-1/+1
| | | | | | | | | | The call to gen_print_group should provide a pointer to the beginning of the the structure data, not the start of the batch data. Cc: Lionel Landwerlin <[email protected]> Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* intel: tools: add aubinator_error_decode toolLionel Landwerlin2017-04-042-0/+736
| | | | | | | | | | | | | | | | This is pretty much the same tool as what i-g-t has, only with a more fancy decoding of the instructions/registers. It also doesn't support anything before gen4. v2 (from Matt): Drop authors Remove undefined automake variable v3: Fix incorrect offsets for dword > 1 (Jordan) v4: Fix decompression error with large blobs (Jordan) Signed-off-by: Lionel Landwerlin <[email protected]> Acked-by: Matt Turner <[email protected]>
* aubinator/gen_decoder/i965: decode instructions from dword 0Lionel Landwerlin2017-04-031-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 <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* aubinator: enable snb/ilk through --genLionel Landwerlin2017-03-311-0/+2
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* intel: Move tools/decoder.[ch] to common/gen_decoder.[ch].Kenneth Graunke2017-03-213-1001/+1
| | | | | | | This way they become part of libintel_common.la so I can use them in the i965 driver. Reviewed-by: Emil Velikov <[email protected]>
* aubinator: Move the guts of decode_group() to decoder.c.Kenneth Graunke2017-03-203-31/+42
| | | | | | This lets us use it outside of the aubinator binary itself. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Drop spec parameter to decode_group().Kenneth Graunke2017-03-201-13/+12
| | | | | | No longer necessary - the iterator gets it from the group. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Make the iterator store a pointer to structure descriptions.Kenneth Graunke2017-03-203-27/+11
| | | | | | | | | | | 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 <[email protected]>
* aubinator: Track the current field's starting dword offset.Kenneth Graunke2017-03-203-26/+18
| | | | | | | | | | 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 <[email protected]>
* aubinator: Drop decode_structure() helper.Kenneth Graunke2017-03-201-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 <[email protected]>
* aubinator: Drop unused print_dword_headers flag.Kenneth Graunke2017-03-201-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 <[email protected]>
* aubinator: Store a pointer from gen_group back to gen_spec.Kenneth Graunke2017-03-202-0/+2
| | | | | | | When decoding a structure field within a group, we may want to look up that structure type. Having a gen_spec pointer makes it easy to do so. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Store enum textual name in iter->value.Kenneth Graunke2017-03-203-19/+15
| | | | | | | | | | | | | | | 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 <[email protected]>
* aubinator: Use fprintf for output.Kenneth Graunke2017-03-161-69/+73
| | | | | | | This will make it easier to choose an output file. For now, it remains stdout. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: Reuse decode_structure code for handling commandsKenneth Graunke2017-03-161-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 <[email protected]>
* aubinator: Delete redundant NULL check.Kenneth Graunke2017-03-161-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 <[email protected]>
* aubinator: Fix indentation.Kenneth Graunke2017-03-161-7/+6
| | | | | | Three space, not four. Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator/genxml: use gzipped files to store embedded genxmlLionel Landwerlin2017-03-131-7/+61
| | | | | | | | | | | | This reduces the size of the aubinator binary from ~1.4Mb to ~700Kb. With can now drop the checks on xxd in configure. v2: Fix incorrect makefile dependency (Lionel) v3: use $(PYTHON2) (Emil) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* intel/tools: Use a makefile included from intel/Makefile.amJason Ekstrand2017-03-131-63/+0
| | | | | | Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Move the back-end compiler to src/intel/compilerJason Ekstrand2017-03-132-5/+3
| | | | | | | | | | | | | | | | | | | | | | Mostly a dummy git mv with a couple of noticable parts: - With the earlier header cleanups, nothing in src/intel depends files from src/mesa/drivers/dri/i965/ - Both Autoconf and Android builds are addressed. Thanks to Mauro and Tapani for the fixups in the latter - brw_util.[ch] is not really compiler specific, so it's moved to i965. v2: - move brw_eu_defines.h instead of brw_defines.h - remove no-longer applicable includes - add missing vulkan/ prefix in the Android build (thanks Tapani) v3: - don't list brw_defines.h in src/intel/Makefile.sources (Jason) - rebase on top of the oa patches [Emil Velikov: commit message, various small fixes througout] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965: Reduce cross-pollination between the DRI driver and compilerJason Ekstrand2017-03-011-1/+0
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* intel/aubinator: fix 32bit shift overflow warningGrazvydas Ignotas2016-12-111-1/+1
| | | | | | | | Doesn't look like this can work on 32bit, just rids of annoying warning. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]>
* aubinator: Add support for enum typesKristian H. Kristensen2016-11-292-40/+93
| | | | | Signed-off-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* intel/aubinator: Pull useful information from the AUB headerJason Ekstrand2016-11-281-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 <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* intel/aubinator: Wait to setup decoders until we parse the aub headerJason Ekstrand2016-11-281-23/+28
| | | | | | | This requires that a few more state bits become global. Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* intel/aubinator: Rework handling of the --gen flagJason Ekstrand2016-11-281-20/+16
| | | | | | | This makes it just store the pci_id instead of a struct pointer Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* intel/aubinator: Trust the packet size in the header for SUBOPCODE_HEADERJason Ekstrand2016-11-281-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 <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* intel/aubinator: Add a get_offset helperJason Ekstrand2016-11-281-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 <[email protected]>
* intel/aubinator: Fix the kernel start pointer for 3DSTATE_HSJason Ekstrand2016-11-281-2/+2
| | | | Reviewed-by: Kristian H. Kristensen <[email protected]>
* intel/aubinator: Add a get_address helperJason Ekstrand2016-11-281-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 <[email protected]>
* intel/aubinator: Properly handle batch buffer chainingJason Ekstrand2016-11-281-1/+19
| | | | | | | | | | | | | The original aubinator that Kristian wrote had a bug in the handling of MI_BATCH_BUFFER_START that propagated into the version in upstream mesa. In particular, it ignored the "2nd level" bit which tells you whether this MI_BATCH_BUFFER_START is a subroutine call (2nd level) or a goto. Since the Vulkan driver uses batch chaining, this can lead to a very confusing interpretation of the batches. In some cases, depending on how things are laid out in the virtual GTT, you can even end up with infinite loops in batch processing. Reviewed-by: Kristian H. Kristensen <[email protected]>
* intel: aubinator: Fix resource leak in gen_spec_load_from_pathGwan-gyeong Mun2016-11-211-0/+1
| | | | | | | | | | This fixes resource leak in gen_spec_load_from_path XML_ParserCreate failure path CID 1373564 Signed-off-by: Mun Gwan-gyeong <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* intel: aubinator: print field values if availableLionel Landwerlin2016-11-013-5/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turning this : sampler state 0 Sampler Disable: false Texture Border Color Mode: 0 LOD PreClamp Enable: 1 Base Mip Level: 0.000000 Mip Mode Filter: 0 Mag Mode Filter: 1 Min Mode Filter: 1 Texture LOD Bias: foo Anisotropic Algorithm: 0 into this : sampler state 0 Sampler Disable: false Texture Border Color Mode: 0 (DX10/OGL) LOD PreClamp Enable: 1 (OGL) Base Mip Level: 0.000000 Mip Mode Filter: 0 (NONE) Mag Mode Filter: 1 (LINEAR) Min Mode Filter: 1 (LINEAR) Texture LOD Bias: foo Anisotropic Algorithm: 0 (LEGACY) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Sirisha Gandikota<[email protected]>
* intel: aubinator: load fields values from xml dataLionel Landwerlin2016-11-012-0/+40
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Sirisha Gandikota<[email protected]>
* intel: aubinator: print boolean fields to true with colorsLionel Landwerlin2016-11-013-6/+17
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Sirisha Gandikota<[email protected]>
* intel: aubinator: fix printing missing gen optionLionel Landwerlin2016-10-311-2/+2
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* intel: aubinator: fix assumptions on amount of required dataLionel Landwerlin2016-10-311-1/+5
| | | | | | | We require 12 bytes of headers but in some cases we just need 4. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* intel: aubinator: don't print out blocks twiceLionel Landwerlin2016-10-311-1/+0
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* intel: aubinator: use different colors to signal batch start/endLionel Landwerlin2016-10-171-5/+10
| | | | | | | | | | | This makes the stream of commands a bit easier to read. v2 (Ken): Use bold text on green headers for easier readability; swap the green and blue headers so the majority stay blue. Signed-off-by: Lionel Landwerlin <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* aubinator: replace pragma once with ifndef guardEmil Velikov2016-10-141-1/+4
| | | | | | Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Sirisha Gandikota<[email protected]> Reviewed-by: Chad Versace <[email protected]>
* intel: aubinator: enable loading dumps from standard inputLionel Landwerlin2016-10-081-36/+129
| | | | | | | | | | | | | | | In conjuction with an intel_aubdump change, you can now look at your application's output like this : $ intel_aubdump -c '/path/to/aubinator --gen=hsw' my_gl_app v2: Add print_help() comment about standard input handling (Eero) Remove shrinked gtt space debug workaround (Eero) v3: Use realloc rather than memcpy/free (Ben) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Sirisha Gandikota <[email protected]>
* intel: aubinator: enable loading xml files from a given directoryLionel Landwerlin2016-10-083-3/+81
| | | | | | | This might be useful for people who debug with out of tree descriptions. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Sirisha Gandikota <[email protected]>
* intel: aubinator: generate a standalone binaryLionel Landwerlin2016-10-083-51/+84
| | | | | | | | | | | | | | | | | | | | | Embed the xml files into the binary, so aubinator can be used from any location. v2: Split generation packing into another patch (Jason) Check for xxd (Jason) v3: Fix out of tree builds (Jason) Generate custom variable name rather than names generated by xxd (Lionel) v4: Move generated _xml.h files to genxml/ (Sirisha) v5: Remove newline from makefile (Jason) v6: Add comment on gen*_xml.h creation (Jason) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* intel: aubinator: use getopt to parse argumentsLionel Landwerlin2016-10-071-57/+33
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Sirisha Gandikota <[email protected]>