summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2016-04-05tools/intel_reg: Add extra pipe B registers for CHVVille Syrjälä2-0/+241
CHV pipe B has some extra features (programmable sprite CSC, primary plane windowing, primary plane scaler, fancier blending). Add all the relevant registers to the "quickdump" register list. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-04-05tools/intel_reg: Fix builtin register spec for gen4Ville Syrjälä1-1/+1
Actually use the builtin register spec on gen4. Makes intel_reg dump actually do something on gen4. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2016-03-24lib: Add a GPU error detectorChris Wilson1-1/+1
If we listen to the uevents from the kernel, we can detect when the GPU hangs. This requires us to fork a helper process to do so and send a signal back to the parent. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19lib/igt_aux: Divert ioctls for signal injectionChris Wilson1-1/+1
To simplify and speed up running interruptible tests, use a custom ioctl() function that control the signaling and detect when we need no more iterations to trigger an interruption. We use a realtime timer to inject the signal after a certain delay, increasing the delay on every loop to try and exercise different code paths within the function. The first delay is very short such that we hopefully enter the kernel with a pending signal. Clients should use struct igt_sigiter iter = {}; while (igt_sigiter_repeat(&iter, enable_interrupts=true)) do_test() to automatically repeat the test until we can inject no more signals into the ioctls. This is condensed into a macro igt_interruptible(enable_interrupts=true) do_test(); for convenience. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-03tests: fix CRTC assignment for a few testsPaulo Zanoni1-7/+8
All the tests I wrote always assumed that every connector supported CRTC 0. This is not the case for BSW and possibly others, so fix the tests before the CI reports more failures. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-02-13aubdump: Add a get_bo() lookup functionKristian Høgsberg Kristensen1-5/+17
We'll use this instead of accessing the bo array directly and add a few sanity checks.
2016-02-13aubdump: Don't use .so constructors for initializingKristian Høgsberg Kristensen1-3/+27
This doesn't seem to work when mixed with constructors in other shared objects or other creative uses of the linker. Let's stick with a simpler mechanism, where we look up the libc functions when our hooks are called for the first time.
2016-02-13aubdump: Raise SIGTRAP on failureKristian Høgsberg Kristensen1-1/+2
2016-01-29tools/intel_residency: use setitimer instead of {,u}alarmPaulo Zanoni1-10/+15
It seems that Android doesn't have ualarm(). Let's use setitimer() instead. The tool still won't compile on Android due to igt_fb requiring Cairo, but we're supposed to solve this in another patch since our igt_fb calls don't actually require Cairo. Reported-by: Derek Morton <derek.j.morton@intel.com> Tested-by: Derek Morton <derek.j.morton@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-26tests/Android.mk: Make intel_residency CAIRO dependantDerek Morton1-0/+1
intel_residency has a cairo dependency through igt_fb.c. Remove it if ANDROID_HAS_CAIRO is not defined. Signed-off-by: Derek Morton <derek.j.morton@intel.com> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-25tools: add intel_residencyPaulo Zanoni3-0/+710
After the recent discussions regarding the effects of the vblank disabling policies on PC state residencies, I started running some experiments to reevaluate some non-intuitive conclusions I had reached. In order to help me do this, I decided to write this tool. The idea is very simple: the tool puts the system on an screen-on idle state, checks which PC state residency is the deepest we can reach, measures its residency, then does some not-so-idle tests and measures the residencies. You can use the tool to compare different Kernel trees and you can also use the tool to compare enabled vs disabled features. It's obvious that these cases do not represent real-world use cases of our driver, but they are already enough to highlight differences between the many patches I wrote. I was even able to catch a bug in one of my patches by spotting an unexpected regression in the residencies. I've been using this tool for FBC, but I expect it to also be useful for PSR, DRRS and similar features. I've been measuring the effects of different optimizations I wrote, and I've also been measuring the FBC vs no-FBC cases. It is also important to highlight that if your system is not properly configured for efficient power savings the tool may not be able to show differences between the results. On my Broadwell machine, for example, if I don't run "powertop --auto-tune" before running the tool, I get PC2 as the deepest state, and 90%+ residency for every workload. After properly configuring the machine, I get PC7 as the deepest state, which is the expected. So far I only tested this tool on BDW and SKL, and it may hit some unexpected assertions for older platforms. I only implemented the cases that are immediately useful for me, but we may also expand the tool in the future. We can add more important workloads. We can add support for screen-off cases, so we can compare the effects of runtime PM and other screen-off features. There's a lot we can do, but none of this is on my current priority list. And remember: /usr/bin/paste is your friend when comparing results. v2: - Be more idle at setup_idle(). - Improve printing for /usr/bin/paste usage. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-15tools/Android.mk: Add zlib supportDerek Morton1-0/+5
IGT does not build for Android due to a zlib dependency being added to intel_error_decode.c in a recent patch. This patch fixes the error by updating the Android makefile to add the path to the zlib library and using any LDFLAGS specified in Makefile.sources. Signed-off-by: Derek Morton <derek.j.morton@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2016-01-15tools/intel_bios_reader: Fix typo on dump infoMika Kahola1-1/+1
Fix typo on intel_bios_reader.c Signed-off-by: Mika Kahola <mika.kahola@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-14intel_bios_reader: dump MIPI sequence block v3Jani Nikula1-24/+23
Similar to what's done in kernel. It's a bit artificial that the parsing and dumping are two separate steps in the userspace tool, but it's easier to follow and debug the code when both the kernel and userspace are similar. v2: don't segfault so much on dumping null pointers Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-14intel_bios_reader: port the sequence block parsing from kernelJani Nikula1-1/+140
Reuse the same code as kernel. Also parses v3, although does not actually dump that stuff yet. Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-14intel_bios_reader: port find_panel_sequence_block from kernelJani Nikula1-29/+52
No need to reinvent wheels, reuse the code from kernel. Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-14intel_bios_reader: make the VBT pointers more constJani Nikula1-28/+28
In const we trust. Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-14intel_bios_reader: fix size handling for 32-bit block sizeJani Nikula1-21/+25
The MIPI DSI sequence block v3+ has a separate block size field. Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-14intel_bios_reader: pass bdb pointer around instead of having as globalJani Nikula1-36/+52
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-08Fix a bunch of printf typesVille Syrjälä3-3/+4
igt_kms.c: In function ‘igt_crtc_set_background’: igt_kms.c:1940:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint64_t’ [-Wformat=] LOG(display, "%s.%d: crtc_set_background(%lu)\n", ^ intel_firmware_decode.c: In function ‘csr_open’: intel_firmware_decode.c:169:2: warning: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 3 has type ‘__off_t’ [-Wformat=] printf("Firmware: %s (%zd bytes)\n", filename, st.st_size); ^ intel_gpu_top.c: In function ‘main’: intel_gpu_top.c:683:10: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Wformat=] stats[i] - last_stats[i]); ^ hsw_compute_wrpll.c: In function ‘main’: hsw_compute_wrpll.c:644:3: warning: format ‘%li’ expects argument of type ‘long int’, but argument 7 has type ‘long long int’ [-Wformat=] igt_fail_on_f(ref->r2 != r2 || ref->n2 != n2 || ref->p != p, ^ gem_gtt_hog.c: In function ‘__real_main155’: gem_gtt_hog.c:177:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=] igt_info("Time to execute %lu children: %7.3fms\n", ^ kms_flip.c: In function ‘run_test_step’: kms_flip.c:985:3: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 10 has type ‘__time_t’ [-Wformat=] igt_assert_f(end - start > 0.9 * frame_time(o) && ^ kms_flip.c:985:3: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 11 has type ‘__suseconds_t’ [-Wformat=] kms_frontbuffer_tracking.c: In function ‘setup_sink_crc’: kms_frontbuffer_tracking.c:1364:3: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘ssize_t’ [-Wformat=] igt_info("Unexpected sink CRC error, rc=:%ld errno:%d %s\n", ^ Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-12-31intel_error_decode: Update address parsing for 64bit offsetsChris Wilson1-13/+36
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-31intel_error_decode: Fix decode headers for HW contextChris Wilson1-27/+56
As we didn't recognise the different buffer type, we confused it with whatever we last decoded (i.e. the render ring buffer). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-31intel_error_decode: Inflate compressed error stateChris Wilson2-0/+94
Recent kernels compress the active objects using zlib + ascii85 encoding. This adapts the tool to decompress those inplace. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-22intel_bios_reader: add dumping of i2c element in mipi sequenceJani Nikula1-0/+23
Due to the clever way the whole sequence block is specified without forward compatibility, it's not possible to dump most blocks without this. Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-22intel_bios_reader: improve element dumpersJani Nikula1-19/+24
Try to print something useful and helpful for the user. Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-22intel_bios_reader: rewrite the mipi sequence block dumpingJani Nikula2-165/+78
Simplify things a lot, make it correct, don't pass random pointers to free() on errors, etc. Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-22intel_bios_reader: check mipi sequence block versionJani Nikula1-0/+5
Bail out on v3+, we don't support that just yet. Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-22intel_opregion_decode: add new ASLE fieldsJani Nikula1-1/+5
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-02tools: fix intel_gpu_abrt to use intel_regJani Nikula1-1/+1
intel_reg_dumper is gone, replaced by 'intel_reg dump'. Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-11-24tools/aubdump: Link with -ldl.Matt Turner1-1/+1
aubdump.c uses dlsym(), so it needs to link with -ldl. Otherwise: /bin/sh: symbol lookup error: /usr/lib64/intel_aubdump.so: undefined symbol: dlsym Signed-off-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11Add missing noreturn attribute to various functionsThomas Wood2-2/+2
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-09lib: Make instdone initialisation fail gracefullyChris Wilson1-1/+2
Just report that we don't recognise the chipset rather than explode. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-06igt/intel_aubdump: Use the right ringBen Widawsky1-1/+1
This prevents the simulator from barfing when it sees commands from another ring. I've been using this locally for a very long time. Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2015-10-14tools/intel_audio_dump: add support for BroxtonLu, Han1-6/+7
This patch adds support for dumping audio registers of Broxton. Signed-off-by: Lu, Han <han.lu@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-10-02benchmarks: Fix build errors on Android M-DessertDerek Morton1-0/+1
Android M-Dessert treats implicit declaration of function warnings as errors resulting in igt failing to build. This patch fixes the errors by including missing header files as required. Mostly this involved including igt.h in the benchmarks. Signed-off-by: Derek Morton <derek.j.morton@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-11convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocciMicah Fedke4-4/+4
Apply the new API to all call sites within the test suite using the following semantic patch: // Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls @@ identifier i =~ "\bdrm_open_any\b"; @@ - i() + drm_open_driver(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_master\b"; @@ - i() + drm_open_driver_master(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_render\b"; @@ - i() + drm_open_driver_render(DRIVER_INTEL) @@ identifier i =~ "\b__drm_open_any\b"; @@ - i() + __drm_open_driver(DRIVER_INTEL) Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11tools/Android.mk: Fix compile error in intel_reg.cDerek Morton1-0/+12
The patch "tools: install the register definition files" caused a build error on android as it added 'PKGDATADIR' which was not defined in the Android build environment. This patch adds that define to tools/Android.mk. It also copies the files it points to so they are actually in the target file system. v2: Added local variable for tool path Signed-off-by: Derek Morton <derek.j.morton@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11null_state_gen: add const to intel_batch_state_copy dataThomas Wood2-4/+4
The data is not modified by the function and is often declared const. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11tools/aubdump: remove void pointer arithmeticThomas Wood1-2/+2
A gcc extension allows void pointer arithmetic by treating the size of void as 1, but this generates a warning when -Wpointer-arith is used. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11tools/intel_bios_reader: Add MIPI device typeVille Syrjälä2-0/+2
Decode the MIPI [sic] device type. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-09-11tools/intel_bios_reader: Decode the device type bitsVille Syrjälä2-0/+50
Each bit in the device type is supposed to mean something. Decode their meaning. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-09-11tools/intel_bios_reader: Print the child dev handleVille Syrjälä2-0/+36
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-09-11intel_bios_reader: Don't explode looking for the devidVille Syrjälä1-2/+5
Check that the offset where expect to find the device id is withing the BIOS image, instead of accessing whatever (if anything) happens to be there. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-09-11intel_bios_reader: Read the child device size from VBTVille Syrjälä2-4/+5
New stuff has been added to the end of the child device block at various times, so using a hardcoded size for the block is a bad idea. Fortunately the size of the block is listed in the VBT just before the blocks themselves, so grab it from there. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-09-11tools/intel_display_poller: Align DSPSURF to 128k to appease gen4/vlv/chvVille Syrjälä1-3/+3
gen4/vlv/chv require DSPSURF to be 128k aligned. Try to respect that in order to avoid ugly glitches. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-09-11tools/intel_display_poller: Make pipe name alphabeticVille Syrjälä1-1/+11
Instead of raw numbers the user can now specify the pipe as 'a',b'... or 'A','B'... Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-09-11tools/intel_display_poller: Try to fix pipe<->plane handling on gen2/3Ville Syrjälä1-9/+17
Check the pipe assignment for each plane (excluding plane C since the kernel doesn't use that one) and pick the first one that's assigned to the target pipe. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-09-11tools/intel_display_poller: Add CHV supportVille Syrjälä1-229/+49
Add CHV support by adding a pipe_offset[] thingy (like we have in the kernel) to deal with the wonky register offsets. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-09-11tools/intel_reg: Print the potential port names in the help textVille Syrjälä3-0/+14
v2: Repaint with Jani's favorite color Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-09-09tools/intel_reg: Set register stride to 1 for VGA registersVille Syrjälä1-2/+2
VGA registers are generally 8 bits long, so set the stride to 1 byte. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>