aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/tools
Commit message (Collapse)AuthorAgeFilesLines
* intel/aub_viewer: fix access to freed memoryLionel Landwerlin2020-04-031-1/+1
| | | | | | | | | | Windows closed while we're displaying them might lead to invalid memory accessed, so use the safe iterators on the list of windows. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4430> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4430>
* intel: drop unused include directoriesEric Engestrom2020-03-282-10/+10
| | | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4360> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4360>
* meson: inline `inc_common`Eric Engestrom2020-03-282-10/+10
| | | | | | | | | Let's make it clear what includes are being added everywhere, so that they can be cleaned up. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4360>
* intel/aub_viewer: Fix format specifier for uint64_tDanylo Piliaiev2020-03-261-7/+7
| | | | | | | | | | Use PRIx64 instead of lx for uint64_t Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2692 Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Sagar Ghuge <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4331> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4331>
* intel/dump_gpu: Handle a bunch of getparam in the no-HW caseJason Ekstrand2020-03-241-2/+47
| | | | | | Reviewed-by: Lionel Landwerlin <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4250> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4250>
* intel/dump_gpu: Add an ensure_device_info helperJason Ekstrand2020-03-241-9/+17
| | | | | Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4250>
* intel/tools/aubinator_error_decode: Decode ring buffers from HEAD to TAILD Scott Phillips2020-03-231-5/+43
| | | | | | | | | | | | | | | Capture the HEAD and TAIL register values from the dump and properly index the ring buffer using those. Previously we would decode the ring buffer from the beginning, printing out whatever happened to be there. Also, properly pass the `from_ring` parameter to gen_print_batch() so that decoding doesn't stop once MI_BATCH_BUFFER_END is encoutered. Reviewed-by: Lionel Landwerlin <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4261> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4261>
* intel/tools/aubinator_error_decode: read HW Context before other batchesD Scott Phillips2020-03-231-0/+18
| | | | | | | | | | | The hardware context buffer has state that was set before the batch started. By decoding it first, references to things like Dynamic State Base Address are decodable in the command batches. Reviewed-by: Rafael Antognolli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4246> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4246>
* intel/tools: Fix compilation with UBSanDanylo Piliaiev2020-03-101-1/+1
| | | | | | | | | | | | Compilation failed with several similar errors: ../src/intel/tools/aub_read.c:322:4: error: case label does not reduce to an integer constant 322 | case MAKE_HEADER(TYPE_AUB, OPCODE_AUB, SUBOPCODE_HEADER): Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4132> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4132>
* intel/tools/dump_gpu: fix getparam valuesLionel Landwerlin2020-03-021-1/+8
| | | | | | | | | Don't return the pci_id for all params Fixes: 76bf38eaf0b6 ("intel/tools/aub_dump: move aub file initialization to maybe_init()") Reviewed-by: Tapani Pälli <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3994> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3994>
* intel/tools: Do not print type/qualifiers/name for c_literalMatt Turner2020-02-251-1/+1
| | | | | | | | External tools may wish to choose their own type, qualifiers, and name, so do not emit our own. Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3952> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3952>
* intel/tools: Allow i965_disasm to disassemble c_literal input typeSagar Ghuge2020-02-251-36/+103
| | | | | | | | | | | | | | | | Added extra argument named 'type' which can be 'bin' (default if ommited) or 'c_literal' for input type. Change 'binary-path' argument name to 'input-path'. v2: - Use util_dynarray for assembly (Matt Turner) - Read data in 8 bytes chunk (Matt Turner) - Fix help option (Akeem Abodunrin) Signed-off-by: Sagar Ghuge <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3952>
* intel/tools: Print c_literals 4 byte wideSagar Ghuge2020-02-251-4/+12
| | | | | | | | | | | | We already print hex value a byte wide, instead of printing c_literal byte wide, we can print it 4 byte wide, which gives us 2 different combinations. v2: Fix the aliasing issue (Matt Turner) Signed-off-by: Sagar Ghuge <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3952>
* intel/tools: Add test for state register as sourceSagar Ghuge2020-02-252-0/+2
| | | | | | Signed-off-by: Sagar Ghuge <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3952>
* intel/tools: Add test for address register as sourceSagar Ghuge2020-02-252-0/+2
| | | | | | Signed-off-by: Sagar Ghuge <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3952>
* intel/tools: Set correct address register file and number in i965_asmSagar Ghuge2020-02-251-1/+3
| | | | | | | | | We need to use already created brw_reg and set correct file type, register number and sub register number. Signed-off-by: Sagar Ghuge <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3952>
* intel/tools: Handle STATE_REG in typed source operandSagar Ghuge2020-02-251-2/+4
| | | | | | | | | | Also stop using brw_sr0_reg function as it return new brw_reg, we already created register, all we have to is just set file, register number and subnr. Signed-off-by: Sagar Ghuge <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3952>
* intel/tools: Handle illegal instructionSagar Ghuge2020-02-251-0/+10
| | | | | | | | | Allow assembler to handle illegal instruction even though mesa doesn't use it but might be required at some point in future. Signed-off-by: Sagar Ghuge <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3952>
* intel/aub_dump: stub the waits when overriding the deviceLionel Landwerlin2020-02-251-0/+19
| | | | | | | | | | We don't actually want to wait on anything, just complete submitting the commands as fast as possible. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3705> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3705>
* intel/tools/aub_dump: fix crash when using the default legacy contextLionel Landwerlin2020-02-251-4/+5
| | | | | | | | | When execbuffer->rsvd1 == 0, the legacy context is used. Ensure we have context created for this. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3705>
* intel/tools/aub_dump: move aub file initialization to maybe_init()Lionel Landwerlin2020-02-251-38/+33
| | | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3705>
* intel/tools: Update aubinator_error_decode.Rafael Antognolli2020-02-131-0/+2
| | | | | | | | | | "ringbuffer" is now called only "ring" in the error state. v2: Keep compatible with old error state (Lionel). v3: Also update "gtt_offset" -> "batch". Closes: https://gitlab.freedesktop.org/drm/intel/issues/1206 Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/dump_gpu: handle context create extended ioctlLionel Landwerlin2019-10-301-0/+15
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]>
* intel/eu: Split brw_inst ex_desc accessors for SEND(C) vs. SENDS(C).Francisco Jerez2019-10-111-2/+2
| | | | | | | | | | | | | | The brw_inst opcode accessors are going away in one of the following commits. We could potentially replace them with the new helpers that do opcode remapping, but that would lead to a circular dependency between brw_inst.h and brw_eu.h. This way we also avoid ordering issues that can cause the semantics of the ex_desc accessors to change depending on whether the ex_desc field is set after or before the opcode instruction field. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel/tools: Support multiple contexts in intel_dump_gpu.Rafael Antognolli2019-10-104-31/+62
| | | | | | | | | | | Create basic aub_context on GEM_CONTEXT_CREATE. Set it up and submit a context + ring + pphwsp during execbuf submission, if it has not been initialized yet. v2: Write the HWSP only once per engine (Lionel). Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/tools: Add basic aub_context code and helpers.Rafael Antognolli2019-10-103-0/+115
| | | | | | | | | | v2: - Only dump context if there were no erros (Lionel). - Store counter for context handles in aub_file (Lionel). v3: - Add a comment about aub_context -> GEM context (Lionel). Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/tools: Use common code for GGTT address allocation.Rafael Antognolli2019-10-102-20/+22
| | | | | | | We want to be able to create contexts on demand, and increase the GGTT as needed for that. Use the aub_map_ggtt() function for that. Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/tools: Factor out GGTT allocation.Rafael Antognolli2019-10-101-63/+63
| | | | | | | | | We want to reuse it in execlists_setup(). v2: Rename it to write_ggtt_ptes() (Lionel). v3: Rename it to aub_map_ggtt() (Lionel). Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/error2aub: add support for platforms without PPGTTLionel Landwerlin2019-10-041-15/+24
| | | | | | | | Not much to do to enable this, just make sure to always write to the GGTT :) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel/tools: Fix aubinator usage of rb_tree.Rafael Antognolli2019-09-301-2/+2
| | | | | | | | | The order of comparison has changed, so we need to invert the logic of "insert_left" when using rb_tree_insert_at(). Fixes: dae33052dbf (util/rb_tree: Reverse the order of comparison functions). Reviewed-by: Jason Ekstrand <[email protected]>
* util/rb_tree: Reverse the order of comparison functionsJason Ekstrand2019-09-201-2/+2
| | | | | | | | | | | The new order matches that of the comparison functions accepted by the C standard library qsort() functions. Being consistent with qsort will hopefully help avoid developer confusion. The only current user of the red-black tree is aub_mem.c which is pretty easy to fix up. Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/decoders: Avoid uninitialized variable warningsCaio Marcelo de Oliveira Filho2019-08-231-2/+2
| | | | | | | | | Initialize `next_batch_addr` and `second_level`. If the batch is well formed, those values will be overriden, if not, they are as good as uninitialized garbage. Acked-by: Eric Engestrom <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* intel/tools: Fix aub_file initialization in intel_dump_gpuCaio Marcelo de Oliveira Filho2019-08-121-0/+6
| | | | | | | | | | | | | | | | | | The `device` can be set earlier either by a command line or a by intercepting an ioctl call to get the I915_PARAM_CHIPSET_ID done by the application early. In both cases `aub_file` and `devinfo` would not be initialized. Fix by splitting the conditions - `device == 0`: use the FD to get both device and devinfo. - Or `devinfo.gen == 0`: use `device` to initialize it. And separatedly, initialize aub_file the first time it is needed. Fixes: d594d2a0524 ("intel/tools: use device info initializer") Acked-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* util: add anon_file.h for all memfd/temp file usageGreg V2019-08-071-11/+2
| | | | | | | | | Move the Weston os_create_anonymous_file code from egl/wayland into util, add support for Linux memfd and FreeBSD SHM_ANON, use that code in anv/aubinator instead of explicit memfd calls for portability. Acked-by: Lionel Landwerlin <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* intel/tools: add binary output type to i965_asmDanylo Piliaiev2019-08-052-17/+47
| | | | | | | | Add '-t,--type' command line option to specify the output type which can be 'bin', 'c_literal' or 'hex'. Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Sagar Ghuge <[email protected]>
* meson: replace libmesa_util with idep_mesautilEric Engestrom2019-08-031-13/+14
| | | | | | | | | | | This automates the include_directories and dependencies tracking so that all users of libmesa_util don't need to add them manually. Next commit will remove the ones that were only added for that reason. Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Eric Anholt <[email protected]> Tested-by: Vinson Lee <[email protected]>
* intel/tools: Fix aubinator_viewer build.Kenneth Graunke2019-08-011-1/+1
| | | | | | This functions was recently renamed and not all callers were updated. Fixes: 086c486a75f ("intel/device: rename gen_get_device_info")
* intel/device: rename gen_get_device_infoMark Janes2019-08-016-7/+7
| | | | | | | | | | | | | | | | | | Rename the original device info initialization routine so callers don't mistakenly call the wrong one: gen_get_device_info_from_fd: Queries kernel for full device info, including topology details. gen_get_device_info_from_pci_id: Partially initializes device info based on PCI ID lookup, when the kernel is not available. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/tools: use device info initializerMark Janes2019-08-011-22/+3
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* tree-wide: replace MAYBE_UNUSED with ASSERTEDEric Engestrom2019-07-313-5/+5
| | | | | | Suggested-by: Jason Ekstrand <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* intel/tools: Add assembler unit tests for ROL/ROR instructionsSagar Ghuge2019-07-015-0/+5
| | | | | Signed-off-by: Sagar Ghuge <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* intel/tools: Add ROL/ROR support in assemblerSagar Ghuge2019-07-012-0/+10
| | | | | Signed-off-by: Sagar Ghuge <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* intel/dump: fix segfault when the app hasn't accessed the deviceLionel Landwerlin2019-06-121-3/+5
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* intel/gpu_dump: fix argument passingLionel Landwerlin2019-06-092-3/+3
| | | | | | | | | | | We were dropping "/' around arguments grouped together. This was triggering failures with : $ ./framemetrics -g "Memory Writes Distribution Gen9" -o /tmp/output.csv -f ./my.trace 10 11 Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* intel/tools: use C99 print conversion specifier for 32 bit buildsMark Janes2019-06-053-4/+4
| | | | | | | | | | Fixes formatting errors for 32 bit compilations, eg: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint64_t’ {aka ‘long long unsigned int’} [-Werror=format=] Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/tools: Fix build with glibc < 2.27.Vinson Lee2019-05-131-0/+3
| | | | | | | | | | | | | | | | | | | | | glibc < 2.27 defines OVERFLOW in /usr/include/math.h. This patch fixes this build error. In file included from ../include/c99_math.h:37:0, from ../src/util/u_math.h:44, from ../src/mesa/main/macros.h:35, from ../src/intel/compiler/brw_reg.h:47, from ../src/intel/tools/i965_asm.h:32, from ../src/intel/tools/i965_gram.y:29: src/intel/tools/i965_gram.tab.c:562:5: error: expected identifier before numeric constant OVERFLOW = 412, ^ Fixes: 70308a5a8a80 ("intel/tools: New i965 instruction assembler tool") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110656 Signed-off-by: Vinson Lee <[email protected]> Acked-by: Eric Engestrom <[email protected]>
* i965_asm: avoid free()ing uninitialized pointersEric Engestrom2019-05-091-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* i965_asm: fix memleakEric Engestrom2019-05-091-0/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* intel/tools: Add unit tests for assemblerSagar Ghuge2019-05-07594-0/+28756
| | | | | | | | | v1: Pass executable object from meson to test(Dylan Baker) v2: Ignore generated output files from git status(Matt Turner) Signed-off-by: Sagar Ghuge <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* intel/tools: Initialize offset correctly for i965_asmMika Kuoppala2019-05-071-10/+7
| | | | | | | | | | If we leave offset uninitialized, access to store will be random depending on stack value and can segfault. Signed-off-by: Mika Kuoppala <[email protected]> Reviewed-by: Sagar Ghuge <[email protected]> Reviewed-by: Matt Turner <[email protected]>