summaryrefslogtreecommitdiffstats
path: root/src/intel/tools
Commit message (Collapse)AuthorAgeFilesLines
* 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 <lionel.g.landwerlin@intel.com> Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
* aubinator: replace pragma once with ifndef guardEmil Velikov2016-10-141-1/+4
| | | | | | Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Sirisha Gandikota<sirisha.gandikota@intel.com> Reviewed-by: Chad Versace <chadversary@chromium.org>
* 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 <lionel.g.landwerlin@intel.com> Reviewed-by: Sirisha Gandikota <Sirisha.Gandikota@intel.com>
* 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 <lionel.g.landwerlin@intel.com> Reviewed-by: Sirisha Gandikota <Sirisha.Gandikota@intel.com>
* 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 <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* intel: aubinator: use getopt to parse argumentsLionel Landwerlin2016-10-071-57/+33
| | | | | Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Sirisha Gandikota <sirisha.gandikota@intel.com>
* intel: aubinator: add missing return charactersLionel Landwerlin2016-10-061-5/+5
| | | | | Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* intel: aubinator: pack supported generations into an arrayLionel Landwerlin2016-10-051-53/+35
| | | | | Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* aubinator: use the correct format specifier for printing ptrdiff_t.Kenneth Graunke2016-10-041-1/+1
| | | | | | | | Fixes more warnings in 32-bit builds. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
* aubinator: Use less -RS instead of -r for the implicit pager.Kenneth Graunke2016-10-041-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the less man page: "Warning: when the -r option is used, less cannot keep track of the actual appearance of the screen (since this depends on how the screen responds to each type of control character). Thus, various display problems may result, such as long lines being split in the wrong place." Lines which are too long to fit in the terminal would be word wrapped, but unfortunately less would get confused about which line it was on, and text would be drawn on top of other text. The most noticable case was shader assembly, which is frequently too wide for an 80 character terminal, and thus would be drawn on top of the following state packets, making them completely unreadable. Using -R instead of -r fixes this problem by only allowing color escape sequences. (Notably, Git's implicit pager invocation uses -R.) Unfortunately, it means our "clear to the end of the line" hack for extending the blue bar headers won't work anymore. Word wrapping usually isn't terribly readable, anyway, so we also add the -S option (chop long lines) to restrict it to the terminal width. (You can hit the left and right arrow keys to scroll sideways.) Then, for a new blue bar hack, we can use a printf specifier to pad the command packet names to be 80 characters long (arbitrarily), which extends them "far enough" to look good, and doesn't require us to use ioctls to determine the terminal width. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Sirisha Gandikota <sirisha.gandikota@intel.com>
* intel: use the correct format specifier for printing uint64_tTimothy Arceri2016-10-042-11/+13
| | | | | | Fixes a bunch of warnings in 32-bit builds. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
* aubinator: Fix the decoding of values that span two DwordsSirisha Gandikota2016-09-261-13/+37
| | | | | | | | | | | | | | | | | | | | | | Fixed the way the values that span two Dwords are decoded. Based on the start and end indices of the field, the Dwords are fetched and decoded accordingly. v2: rename dw to qw in gen_field_iterator_next and remove extra white space (Anuj) v3: change all instances of dw to qw (Anuj) Earlier, 64-bit fields (such as most pointers on Gen8+) weren't decoded correctly. gen_field_iterator_next seemed to walk one DWord at a time, sets v.dw, and then passes it to field(). So, even though field() takes a uint64_t, we're passing it a uint32_t (which gets promoted, so the top 32 bits will always be zero). This seems pretty bogus... (Ken) Signed-off-by: Sirisha Gandikota <Sirisha.Gandikota@intel.com> Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* aubinator: fix resource leakNayan Deshmukh2016-09-251-1/+3
| | | | | | | CovID: 1373370 Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* intel/i965: make gen_device_info mutableLionel Landwerlin2016-09-231-1/+3
| | | | | | | | | | | | Make gen_device_info a mutable structure so we can update the fields that can be refined by querying the kernel (like subslices and EU numbers). This patch does not make any functional change, it just makes gen_get_device_info() fill a structure rather than returning a const pointer. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* aubinator: add a custom handler for immediate register loadLionel Landwerlin2016-09-203-3/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Transforming this : 0x00c77084: 0x11000001: MI_LOAD_REGISTER_IMM 0x00c77088: 0x0000b020 : Dword 1 Register Offset: 0x0000b020 0x00c7708c: 0x00880038 : Dword 2 Data DWord: 8912952 Into this: 0x007880f0: 0x11000001: MI_LOAD_REGISTER_IMM 0x007880f4: 0x0000b020 : Dword 1 Register Offset: 0x0000b020 0x007880f8: 0x00080040 : Dword 2 Data DWord: 524352 register L3CNTLREG2 (0xb020) : 0x80040 SLM Enable: 0 URB Allocation: 32 URB Low Bandwidth: 0 RO Allocation: 32 RO Low Bandwidth: 0 DC Allocation: 0 DC Low Bandwidth: 0 v2: Drop unused arguments (Sirisha) Print out register name Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
* aubinator: Remove bogus "end" parameter in gen_disasm_disassemble()Sirisha Gandikota2016-09-133-10/+12
| | | | | | | | | Earlier, the loop pretends to loop over instructions from "start" to "end", but the callers always pass 8192 for end, which is some huge bogus value. The real loop termination condition is send-with-EOT or 0. (Ken) Signed-off-by: Sirisha Gandikota <Sirisha.Gandikota@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* aubinator: Make gen_disasm_disassemble handle split sendsSirisha Gandikota2016-09-131-7/+12
| | | | | | | | | | | | Skylake adds new SENDS and SENDSC opcodes, which should be handled in the send-with-EOT check. Make an is_send() helper that checks if the opcode is SEND/SENDC/SENDS/SENDSC (Ken) v2: Make is_send() much more crispier, Mix declaration and code to make the code compact (Ken) Signed-off-by: Sirisha Gandikota <Sirisha.Gandikota@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* aubinator: Simplify print_dword_val() methodSirisha Gandikota2016-09-131-8/+4
| | | | | | | | | | Remove the float/dword union and use the iter->p[f->start / 32] directly as printf formatter %08x expects uint32_t (Ken) v2: Make the cleanup much more crispier (Ken) Signed-off-by: Sirisha Gandikota <Sirisha.Gandikota@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* aubinator: Simplify gen_disasm_create()'s devinfo handlingSirisha Gandikota2016-09-121-7/+1
| | | | | | | | | | Copy the whole devinfo structure instead of just few fields (Ken) Earlier, copied only couple of fields which added more code. So, simplify code by copying the whole structure. Signed-off-by: Sirisha Gandikota <Sirisha.Gandikota@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* aubinator: Fix compiler warningSirisha Gandikota2016-09-121-1/+1
| | | | | | | Add 'const' qualifier to gen_field_iterator::p pointer (Ken) Signed-off-by: Sirisha Gandikota <Sirisha.Gandikota@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* aubinator: rework print_help()Emil Velikov2016-09-121-12/+5
| | | | | | | | | | | | | | | | Rather than using platform specific methods to retrieve the program name pass it explicitly. The function is called directly from main(). Similarly - basename comes in two versions POSIX (can modify string, always pass a copy) and GNU (never modifies the string). Just printout the complete program name, esp. since the program is not meant to be installed. Thus using $basename is unlikely to work, not to mention it is misleading. Reported-by: Timothy Arceri <timothy.arceri@collabora.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jonathan Gray <jsg@jsg.id.au>
* aubinator: only use program_invocation_short_name with glibc/cygwinJonathan Gray2016-09-081-1/+7
| | | | | | | | | | program_invocation_short_name is a gnu extension. Limit use of it to glibc and cygwin and otherwise use getprogname() which is available on BSD and OS X. Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* aubinator: include libgen.h for basename(3)Jonathan Gray2016-09-081-0/+1
| | | | | | | | | | Include libgen.h for basename as required by posix. The definition is not found on at least OpenBSD otherwise. Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* aubinator: stop using non portable error() functionJonathan Gray2016-09-081-16/+30
| | | | | | | | | | | | | error() is a gnu extension and is not present on OpenBSD and likely other systems. Convert use of error to fprintf/strerror/exit. Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* intel: Rename brw_get_device_name/info to gen_get_device_name/infoJason Ekstrand2016-09-031-1/+1
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* intel: s/brw_device_info/gen_device_info/Jason Ekstrand2016-09-031-3/+3
| | | | | | | | | | | | | Generated by: sed -i -e 's/brw_device_info/gen_device_info/g' src/intel/**/*.c sed -i -e 's/brw_device_info/gen_device_info/g' src/intel/**/*.h sed -i -e 's/brw_device_info/gen_device_info/g' **/i965/*.c sed -i -e 's/brw_device_info/gen_device_info/g' **/i965/*.cpp sed -i -e 's/brw_device_info/gen_device_info/g' **/i965/*.h Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* intel: Add a new "common" library for more code sharingJason Ekstrand2016-09-031-0/+1
| | | | | | | The first thing to go in this new library is brw_device_info. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* mesa: Add some more .gitignoreJason Ekstrand2016-08-311-0/+1
|
* aubinator: fix if indentation and add brackets to multiline bodyTimothy Arceri2016-08-311-3/+4
| | | | | | Fixes misleading indentation warning in gcc. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* aubinator: Style fixes.Kenneth Graunke2016-08-234-34/+45
| | | | Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
* aubinator: Fix the tool to correctly decode the DWordsSirisha Gandikota2016-08-233-53/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several fixes have been added as part of this as listed below: 1) Fix the mask and add disassembler handling for STATE_DS, STATE_HS as the mask returned wrong values of the fields. 2) Fix the GEN_TYPE_ADDRESS/GEN_TYPE_OFFSET decoding - the address/ offset were handled the same way as the other fields and that gives the wrong values for the address/offset. 3) Decode nested/recurssive structures - Many packets contain nested structures, ex: 3DSATE_SO_BUFFER, STATE_BASE_ADDRESS, etc contain MOC structures. Previously, the aubinator printed 1 if there was a MOC structure. Now we decode the entire structure and print out its fields. 4) Print out the DWord address along with its hex value - For a better clarity of information, it is helpful to print both the address and hex value of the DWord along with the DWord count. Since the DWord0 contains the instruction code and the instruction length, it is unnecessary to print the decoded values for DWord0. This information is already available from the DWord hex value. 5) Decode the <group> and the corresponding fields in the group- The <group> tag can have fields of several types including structures. A group can contain one or more number of fields and this has be correctly decoded. Previously, aubinator did not decode the groups or the fields/structures inside them. Now we decode the <group> in the instructions and structures where the fields in it repeat for any number of times specified. v2: Fix the formatting (per Matt) Make the start and end pos calculation to extract fields from a DWord more appropriate by moving %32 away from mask() method Signed-off-by: Sirisha Gandikota <Sirisha.Gandikota@intel.com> Acked-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Ben Widawsky <ben@bwidawsk.net>
* aubinator: Add a new tool called Aubinator to the src/intel/tools folder.Kristian Høgsberg Kristensen2016-08-236-0/+1851
The Aubinator tool is designed to help the driver developers in debugging the driver functionality by decoding the data in the .aub files. Primary Authors of this tool are Damien Lespiau <damien.lespiau at intel.com> and Kristian Høgsberg Kristensen <krh at bitplanet.net>. v2: Review comments are incorporated by Sirisha Gandikota as below: 1) Make Makefile.am more crisp, reuse intel_aub.h from libdrm (per Emil) 2) Aubinator will use platform name instead of GEN number (per Matt) 3) Disassmebler gets created based on pciid rather then GEN number (per Matt) 4) Other formatting comments (per Ken, Matt and Emil) Signed-off-by: Sirisha Gandikota <Sirisha.Gandikota@intel.com> Acked-by: Kenneth Graunke <kenneth@whitecape.org> Acked-by: Ben Widawsky <ben@bwidawsk.net>