summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2020-08-21i915/perf: 32bit printf cleanupChris Wilson1-1/+1
Use PRI[du]64 as necessary for 32bit builds. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2020-07-26tools: Use the gt number stored in the device infoChris Wilson2-2/+8
Don't use the encoded information within the PCI-ID for the GT value, as the rules keep changing. Use the device info instead. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-06-11tools/intel_gpu_top: Fix _open_pmu()Ayaz A Siddiqui1-7/+8
_open_pmu() was calling perf_igfx_open_group() which in turn was calling igt_perf_type_id("i915") each time. By making _open_pmu() take type as a parameter and call igt_perf_open_group() we achieve two things: * we use the correct type for engines->device instead of the hardcoded "i915" * optimization - we call igt_perf_type_id() once - it's reading sysfs Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Signed-off-by: Ayaz A Siddiqui <ayaz.siddiqui@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2020-06-08tools/intel_gpu_top: Add support of discrete GPU and card selectionAyaz A Siddiqui3-18/+116
In intel_gpu_top device path was hard coded for integrated GPU. With this patch we: * use igt_device_scan library for device scanning, * make discrete GPU the default one, * provided options for card selection. v2: * explicitly set ret to EXIT_SUCCESS after all the other uses * fix use after free of opt_device (Tvrtko) * use EXIT_FAILURE instead of "1" (Tvrtko) Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Signed-off-by: Ayaz A Siddiqui <ayaz.siddiqui@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2020-04-17Add eDP support in Link Layer Compliance ToolNidhi Gupta1-1/+2
Adding eDP support for Link Layer Compliance tool of DP-PHY test automation. Current Implementation of this compliance tool can be used for dp and eDP both. Hence extending to eDP too. Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com> Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Animesh Manna <animesh.manna@intel.com> Link: https://patchwork.freedesktop.org/series/72783/#rev2
2020-04-16tools/registers/tgl: Fix tigerlake_delta file decodeJosé Roberto de Souza1-1/+1
It was missing a ")" to be properly parsed. Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2020-04-01tools/i915-perf-recorder: fix topology alignment issueLionel Landwerlin1-9/+2
The additional alignment added when writing into the output was not accounted in the header. This is preventing reading the recorded data. Instead of adding the alignment when writing, just account for it when querying the topology. v2: Use calloc Drop unused var Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Fixes: f08865e58cd3 ("tools: add i915 perf recorder tool") Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-03-27tools: Allow user to set poll delay in i915 perf recorderUmesh Nerlige Ramappa1-3/+35
Add poll delay parameter to the i915-perf-recorder tool so that the user can set the frequency of the poll timer that checks for available reports in the OA buffer. v2: - Change poll period parameter type to match kernel interface (Lionel) - Update to use poll period in the code (Ashutosh) v3: - Change command line paramter to poll-period (Ashutosh) - Fix the version check for the feature (Ashutosh) Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2020-02-26tools/i915-perf: Fix compiler warningPetri Latvala3-10/+19
Remove the _dump half of the pair of recorder command structs and use a plain array of uint8_ts instead. Leave the struct in a comment to act as documentation. As a drive-by fix, add include guards to i915_perf_recorder_commands.h Signed-off-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2020-02-19tools: add i915-perf-readerLionel Landwerlin3-1/+296
Reading & printing out data recorded with i915-perf-recorder. v2: Autotools support Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Petri Latvala <petri.latvala@intel.com>
2020-02-19tools: add i915 perf recorder toolLionel Landwerlin5-1/+1246
A tool recording i915-perf data along with device description & timestamp correlation points for mapping data to CPU tracepoints. The format is mostly described in perf_data.h. v2: Autotools support Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Petri Latvala <petri.latvala@intel.com>
2020-02-19lib: Add i915_perf libraryLionel Landwerlin5-1/+298
This library contains the database of performance metrics for each supported generation as well as its associated programming. It also allow for the user to get human readable data out of HW generated data. v2: Switch a few python scripts to python3 v3: Fix some python2-ism s/lkf/ehl/ Autotools support v4: set soversion on i915_perf.so Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Petri Latvala <petri.latvala@intel.com>
2020-02-11intel_error_decode: Recognise NULL context once moreChris Wilson1-0/+1
If we don't recognise a buffer in the state, we claim it is a "batch buffer" and so confuse the user. Reported-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-02-10tools: Delete aubdumpMatt Turner5-1451/+0
Superseded by intel_dump_gpu in Mesa. Signed-off-by: Matt Turner <mattst88@gmail.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2020-02-10tests/intel_dp_compliance: use device coherent mapping instead of mmap_gttRamalingam C1-6/+6
As tiling is not used we use the device coherent mapping instead of mmap_gtt. v2: instead of skipping device coherent mapping is used. [Ashutosh] Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2020-01-23intel_reg: Use static iteratorPetri Latvala1-2/+2
Convert open-coded for loops to __for_each_static_engine. That takes care of the last direct user of intel_execution_engines2. More work is needed to make intel_reg support dynamically queried engines but this restores the old functionality. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2020-01-21Add TigerLake Registers fileJohn Machado2-0/+321
Added the TigerLake register spec file and a register delta file that contain additional registers corresponding to TigerLake. The spec file uses the icelake file along with the newly added register file for TGL register definations. Suggested-by: Swati Sharma <swati2.sharma@intel.com> Signed-off-by: John Machado <john.machado@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2020-01-16tools/intel_panel_fitter: Fix abs(unsigned)Ville Syrjälä1-7/+7
../tools/intel_panel_fitter.c: In function ‘change_screen_size’: ../tools/intel_panel_fitter.c:183:10: warning: taking the absolute value of unsigned type ‘uint32_t’ {aka ‘unsigned int’} has no effect [-Wabsolute-value] 183 | pos_x = abs((info.tot_width - dst_width)) / 2; | ^~~ ../tools/intel_panel_fitter.c:184:10: warning: taking the absolute value of unsigned type ‘uint32_t’ {aka ‘unsigned int’} has no effect [-Wabsolute-value] 184 | pos_y = abs((info.tot_height - dst_height)) / 2; | ^~~ Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-01-16tools/cnl_compute_wrpll: Fix abs(unsigned)Ville Syrjälä1-14/+14
../tools/cnl_compute_wrpll.c: In function ‘cnl_ddi_calculate_wrpll2’: ../tools/cnl_compute_wrpll.c:216:21: warning: taking the absolute value of unsigned type ‘uint32_t’ {aka ‘unsigned int’} has no effect [-Wabsolute-value] 216 | dco_centrality = abs(dco - dco_mid); | ^~~ ../tools/cnl_compute_wrpll.c: In function ‘test_multipliers’: ../tools/cnl_compute_wrpll.c:258:21: warning: taking the absolute value of unsigned type ‘unsigned int’ has no effect [-Wabsolute-value] 258 | dco_centrality = abs(dco - dco_mid); | ^~~ Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-01-14i915/perf: Find the associated perf-type for a particular deviceChris Wilson1-1/+1
Since with multiple devices, we may have multiple different perf_pmu each with their own type, we want to find the right one for the job. The tests are run with a specific fd, from which we can extract the appropriate bus-id and find the associated perf-type. The performance monitoring tools are a little more general and not yet ready to probe all device or bind to one in particular, so we just assume the default igfx for the time being. v2: Extract the bus address from out of sysfs v3: A new name for a new decade! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: "Robert M. Fosha" <robert.m.fosha@intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: "Robert M. Fosha" <robert.m.fosha@intel.com> #v2 Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2020-01-10tools/intel_error_decode: Add secondary name for batchChris Wilson1-0/+2
A batch is now known as the batch, not a plain old gtt_offset which could be anyone! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Andi Shyti <andi.shyti@intel.com>
2019-12-04Introduce device selection lsgpu toolZbigniew Kempczyński3-0/+252
Tool uses device selection API to scan and display GPU devices. It can be used to check filter correctness as well as order of applying the filters (.igtrc, IGT_DEVICE and --device argument). v2 (Arek): * don't print chip as it's no longer there * make it a second patch, before any alterations to igt_core or drmtest * use only a single filter v3 (Arek): * use igt_load_igtrc() (Petri) * add usage example (Chris) * general logic cleanup LONG EXAMPLE: $ ./build/tools/lsgpu --help usage: lsgpu [options] Options: -p, --print-details Print devices with details -v, --list-vendors List recognized vendors -l, --list-filter-types List registered device filters types -d, --device filter Device filter, can be given multiple times -h, --help Show this help message and exit $ ./build/tools/lsgpu sys:/sys/devices/pci0000:00/0000:00:02.0/drm/card0 subsystem : drm drm card : /dev/dri/card0 parent : sys:/sys/devices/pci0000:00/0000:00:02.0 sys:/sys/devices/pci0000:00/0000:00:02.0/drm/renderD128 subsystem : drm drm render : /dev/dri/renderD128 parent : sys:/sys/devices/pci0000:00/0000:00:02.0 sys:/sys/devices/platform/vgem/drm/card1 subsystem : drm drm card : /dev/dri/card1 parent : sys:/sys/devices/platform/vgem sys:/sys/devices/platform/vgem/drm/renderD129 subsystem : drm drm render : /dev/dri/renderD129 parent : sys:/sys/devices/platform/vgem sys:/sys/devices/pci0000:00/0000:00:02.0 subsystem : pci drm card : /dev/dri/card0 drm render : /dev/dri/renderD128 vendor : 8086 device : 5927 sys:/sys/devices/platform/vgem subsystem : platform drm card : /dev/dri/card1 drm render : /dev/dri/renderD129 $ ./build/tools/lsgpu -l Filter types: --- filter syntax --- sys sys:/sys/devices/pci0000:00/0000:00:02.0 find device by its sysfs path drm drm:/dev/dri/* path find drm device by /dev/dri/* node pci pci:[vendor=%04x/name][,device=%04x][,card=%d] vendor is hex number or vendor name $ ./build/tools/lsgpu -d pci:vendor=Intel Notice: Using --device filters === Device filter === pci:vendor=Intel === Testing device open === Device detail: subsystem : pci drm card : /dev/dri/card0 drm render : /dev/dri/renderD128 Device /dev/dri/card0 successfully opened Device /dev/dri/renderD128 successfully opened ------------------------------------------- $ ./build/tools/lsgpu -d pci:vendor=intel Notice: Using --device filters === Device filter === pci:vendor=intel === Testing device open === Device detail: subsystem : pci drm card : /dev/dri/card0 drm render : /dev/dri/renderD128 Device /dev/dri/card0 successfully opened Device /dev/dri/renderD128 successfully opened ------------------------------------------- $ ./build/tools/lsgpu -d pci:vendor=intel -p Notice: Using --device filters === Device filter === pci:vendor=intel === Testing device open === Device detail: subsystem : pci drm card : /dev/dri/card0 drm render : /dev/dri/renderD128 Device /dev/dri/card0 successfully opened Device /dev/dri/renderD128 successfully opened ========== pci:/sys/devices/pci0000:00/0000:00:02.0 ========== card device : /dev/dri/card0 render device : /dev/dri/renderD128 [properties] DEVPATH : /devices/pci0000:00/0000:00:02.0 DRIVER : i915 FWUPD_GUID : 0x8086:0x5927 ID_MODEL_FROM_DATABASE : Iris Plus Graphics 650 ID_PCI_CLASS_FROM_DATABASE : Display controller ID_PCI_INTERFACE_FROM_DATABASE : VGA controller ID_PCI_SUBCLASS_FROM_DATABASE : VGA compatible controller ID_VENDOR_FROM_DATABASE : Intel Corporation MODALIAS : pci:v00008086d00005927sv00008086sd00002068bc03sc00i00 PCI_CLASS : 30000 PCI_ID : 8086:5927 PCI_SLOT_NAME : 0000:00:02.0 PCI_SUBSYS_ID : 8086:2068 SUBSYSTEM : pci USEC_INITIALIZED : 22881171 [attributes] ari_enabled : 0 boot_vga : 1 broken_parity_status : 0 class : 0x030000 consistent_dma_mask_bits : 39 current_link_speed : Unknown speed current_link_width : 0 d3cold_allowed : 1 device : 0x5927 dma_mask_bits : 39 driver_override : (null) enable : 1 firmware_node : LNXVIDEO:00 index : 1 irq : 129 label : CPU local_cpulist : 0-3 local_cpus : f max_link_speed : Unknown speed max_link_width : 255 msi_bus : 1 numa_node : -1 revision : 0x06 subsystem : pci subsystem_device : 0x2068 subsystem_vendor : 0x8086 vendor : 0x8086 ------------------------------------------- Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-12-03tools: remove igt_skip_on_simulation()Swati Sharma1-2/+0
Removing igt_skip_on_simulation() from tools since this feature is not supported anymore. v2: Rebase Signed-off-by: Swati Sharma <swati2.sharma@intel.com> Signed-off-by: Karthik B S <karthik.b.s@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-10-29tools/intel_vbt_decode: add decoding of the compression parameters blockJani Nikula1-0/+87
Decode block 56. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2019-10-29tools/intel_vbt_decode: update vbt defsJani Nikula1-0/+58
Update intel_vbt_defs.h from kernel commit 96815f3d8b50 ("drm/i915/bios: add compression parameter block definition"). Also includes other changes that weren't synced before. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2019-09-16tools/amd_hdmi_compliance: Test 4K video modes with YUV encodingStylon Wang4-0/+211
HDMI 2.0 compliance tests needs 4K modes with YUV encoding. This test selects 4K modes based on specified VIC. v2: - rename to amd_hdmi_compliance - replace fprintf with igt_info/warn - use EXIT_SUCCESS/FAILURE in exit() Signed-off-by: Stylon Wang <stylon.wang@amd.com> Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
2019-09-09tools/l3_parity: Unnest exit handlersChris Wilson1-21/+29
The curse of using libigt where it is not wanted; in this case calling drop-caches while we hold the forcewake is a recipe for a long wait. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-08-29lib/intel_mmio: add additional api for multiple devicesDaniel Mrzyglod13-56/+78
Library was limited for reading registers for only one device at a time in igt tests. Changes in this patch give as oportunity to test multiple devices in the same time. v8: pack and rename structure, remove unnecessary field v7: remove unnecessary code v6: Reword patch. Cosmetic changes. Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Spurio Ceraolo <daniele.ceraolospurio@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Daniel Mrzyglod <daniel.t.mrzyglod@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-08-23tools/intel_vbt_decode: dump all backlight dataJani Nikula1-1/+8
We were missing the level and control method. Reviewed-by: Simon Ser <simon.ser@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2019-08-23tools/intel_vbt_decode: dump backlight data for all panelsJani Nikula1-5/+15
Similar to other panel type indexed arrays. Reviewed-by: Simon Ser <simon.ser@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2019-08-22tools/intel_reg: fix use-after-free bug in register spec readJani Nikula1-1/+1
e points into the buffer pointed to by p. Fixes: dfda0b6aecce ("intel_reg: introduce one intel_reg tool to rule them all") Reviewed-by: Simon Ser <simon.ser@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2019-07-19tools/vbt_decode: Print PSR2 training pattern durationDhinakaran Pandiyan1-0/+11
There is a new field for PSR2 training pattern duration in VBT versions >= 226, decode that. v2: Changed to fixed-width types(Ville) Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-07-19tools/vbt_decode: Fix VBT parsing for the PSR sectionDhinakaran Pandiyan1-3/+3
A single 32-bit PSR2 training pattern field follows the sixteen element array of PSR table entries as per VBT spec. But, we incorrectly define this PSR2 field for each of PSR table entries. The result of this is that the PSR1 training pattern duration for any panel_type != 0 will be parsed incorrectly. Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-07-12intel_l3_parity: Restore support for IvybridgeChris Wilson1-0/+12
With the fancy second slice of Haswell, we lost support for Ivybridge with its paltry single slice. Fixes: 8ddcfd6882a9 ("intel_l3_parity: slice support") Testcase: igt/tools_test/sysfs_l3_parity Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-07-04tools/intel_dump_audion: Rename BIT macros to REG_BITLukasz Kalamarz1-572/+572
In kernel macro BIT is used to set value 1 on a given BIT, while in this tool it was checking value of given bit in register. So it was renamed. Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Zhenyu Wang <zhenyu.z.wang@intel.com> Cc: Wu Fengguang <fengguang.wu@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Michal Winiarski <michal.winiarski@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2019-06-05tools/intel_vbt_decode: update vbt defs from kernelJani Nikula2-383/+280
Sync up to commit f41c615310d2 ("drm/i915/bios: add an enum for BDB block IDs") in kernel intel_vbt_defs.h, and update the tool with the struct renames. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2019-06-05tools/meson: Build igt_statsArkadiusz Hiler1-2/+1
Since upgrade to Meson 0.46.0 we can have multiple binaries with the same name. Let's re-enable build of igt_stats! Cc: Petri Latvala <petri.latvala@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-05-23i915: Improve static engine map for legacyChris Wilson1-3/+1
We need to keep igt working on linus and dif, or Joonas gets very upset. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Andi Shyti <andi.shyti@intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Andi Shyti <andi.shyti@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2019-05-07meson: Add .so versioningLyude Paul1-1/+2
While I'm pretty confident that no one cares to use libigt.so or lib_aubdump.so anywhere outside of igt, many distributions including Fedora and Debian strongly suggest that packages have some sort of so versioning, even if it's just '0'. So, let's fulfill that minimum requirement to make this easier to package. Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Lyude Paul <lyude@redhat.com>
2019-03-29Revert "lib/igt_device: Move intel_get_pci_device under igt_device"Ville Syrjälä14-95/+40
One significant usecase for intel_reg/etc. is to be able to examine the hardware state *before* loading the driver. If the tool forces the driver to load we've totally lost that capability. This reverts commit 8ae86621d6fff60b6e20c6b0f9b336785c935b0f. Cc: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Michał Winiarski <michal.winiarski@intel.com>
2019-03-26tools/intel-gpu-top: Only link against igt_perf.laChris Wilson1-1/+1
Fix the meson build to not link intel-gpu-top against the whole test infrastructure; it's a tool not a test! Reported-by: Eero Tamminen <eero.t.tamminen@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110249 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2019-03-20lib/igt_device: Move intel_get_pci_device under igt_deviceMichał Winiarski14-40/+95
It allows us to make things a little bit more generic. Also, we now require fd rather than doing guesswork when it comes to pci address. v2: Use readlinkat rather than string concat, move stuff around, provide a version that does not assert. (Chris) v3: Print addr on failure, avoid assignment in conditionals. (Chris) Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-20lib/igt_sysfs: Remove idx from sysfs_openMichał Winiarski1-1/+1
Similar to sysfs_path - more explicit more better. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-20lib: Kill drm_get_card()Michał Winiarski1-3/+6
It's not operating on FD, and we've provided a nice reimplementation that does. Let's use it instead. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-03-08tools/intel_vbt_decode: check inconsistent sequence element sizeJani Nikula1-0/+6
Cross check against the element dumper return value to catch inconsistencies. Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2019-03-08tools/intel_vbt_decode: Dump the GPIO value/config/flag as a raw hex byteVille Syrjälä1-4/+4
The spec is totally confused when it comes to the GPIO flags byte. To allow us to inspect that the decoded result at least seems sensible let's also dump the raw byte. Should at least show if some bits are set which we're not expecting. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-03-08tools/intel_vbt_decode: Correctly decode v3 GPIO sequenceVille Syrjälä1-13/+20
The v3 GPIO seq is three bytes, not two. Decode it correctly. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-02-25tools/intel_gpu_top: Add file output capabilityTvrtko Ursulin1-22/+41
A new -o command switch enables logging to a file. v2: * Support "-o -" for explicit stdout selection. (Chris Wilson) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=108689 Cc: Eero Tamminen <eero.t.tamminen@intel.com> Cc: 3.14pi@ukr.net Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-02-25tools/intel_gpu_top: Add support for stdout loggingTvrtko Ursulin1-124/+639
Two new output modes are added: listing of text data to standard out (-l on the command line), and dumping of JSON formatted records (-J), also to standard out. The first mode is selected automatically when non-interactive standard out is detected. Example of text output: Freq MHz IRQ RC6 Power IMC MiB/s RCS/0 BCS/0 VCS/0 VCS/1 VECS/0 req act /s % W rd wr % se wa % se wa % se wa % se wa % se wa 0 0 0 0 0.00 360 0 0.00 0 0 0.00 0 0 0.00 0 0 0.00 0 0 0.00 0 0 350 350 0 100 0.00 35 2 0.00 0 0 0.00 0 0 0.00 0 0 0.00 0 0 0.00 0 0 350 350 0 100 0.00 34 2 0.00 0 0 0.00 0 0 0.00 0 0 0.00 0 0 0.00 0 0 350 350 0 100 0.00 143 6 0.00 0 0 0.00 0 0 0.00 0 0 0.00 0 0 0.00 0 0 350 350 0 100 0.00 169 7 0.00 0 0 0.00 0 0 0.00 0 0 0.00 0 0 0.00 0 0 350 350 0 100 0.00 169 7 0.00 0 0 0.00 0 0 0.00 0 0 0.00 0 0 0.00 0 0 Example of JSON output: { "period": { "duration": 1002.525224, "unit": "ms" }, "frequency": { "requested": 349.118398, "actual": 349.118398, "unit": "MHz" }, "interrupts": { "count": 0.000000, "unit": "irq/s" }, "rc6": { "value": 99.897752, "unit": "%" }, "power": { "value": 0.000000, "unit": "W" }, "imc-bandwidth": { "reads": 149.683843, "writes": 6.104093, "unit": "MiB/s" }, "engines": { "Render/3D/0": { "busy": 0.000000, "sema": 0.000000, "wait": 0.000000, "unit": "%" }, "Blitter/0": { "busy": 0.000000, "sema": 0.000000, "wait": 0.000000, "unit": "%" }, "Video/0": { "busy": 0.000000, "sema": 0.000000, "wait": 0.000000, "unit": "%" }, "Video/1": { "busy": 0.000000, "sema": 0.000000, "wait": 0.000000, "unit": "%" }, "VideoEnhance/0": { "busy": 0.000000, "sema": 0.000000, "wait": 0.000000, "unit": "%" } } } v2: * Show example output in commit message. * Install signal handler to complete output on SIGINT. (Chris Wilson) v3: * Use asprintf where possible. (Chris Wilson) v4: * Check asprintf return value, not the pointer. * Rename fmt_d/dd to fmt_width/precision. (Chris Wilson) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> References: https://bugs.freedesktop.org/show_bug.cgi?id=108689 Cc: Eero Tamminen <eero.t.tamminen@intel.com> Cc: 3.14pi@ukr.net Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-02-20tools: Add dpcd_reg binary to gitignoreArkadiusz Hiler1-0/+1
Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>