649 Commits

Author SHA1 Message Date
Derek Morton
3598fff994 tests/Android.mk: Make intel_residency CAIRO dependant
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-26 15:45:44 -02:00
Paulo Zanoni
beb936f188 tools: add intel_residency
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-25 11:58:05 -02:00
Derek Morton
825482a25c tools/Android.mk: Add zlib support
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-15 15:56:59 +00:00
Mika Kahola
fe7a42bff6 tools/intel_bios_reader: Fix typo on dump info
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-15 15:22:55 +02:00
Jani Nikula
480479d7dc intel_bios_reader: dump MIPI sequence block v3
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-14 17:56:07 +02:00
Jani Nikula
70dc8c85f1 intel_bios_reader: port the sequence block parsing from kernel
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-14 17:40:42 +02:00
Jani Nikula
7d1a37282b intel_bios_reader: port find_panel_sequence_block from kernel
No need to reinvent wheels, reuse the code from kernel.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-14 17:36:33 +02:00
Jani Nikula
b26393489e intel_bios_reader: make the VBT pointers more const
In const we trust.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-14 17:35:08 +02:00
Jani Nikula
d9588c891d intel_bios_reader: fix size handling for 32-bit block size
The MIPI DSI sequence block v3+ has a separate block size field.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-14 17:33:34 +02:00
Jani Nikula
2e2fffa7a5 intel_bios_reader: pass bdb pointer around instead of having as global
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-01-14 17:32:21 +02:00
Ville Syrjälä
1ecd91a8c6 Fix a bunch of printf types
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>
2016-01-08 19:56:49 +02:00
Chris Wilson
bb35716d25 intel_error_decode: Update address parsing for 64bit offsets
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-31 22:10:11 +00:00
Chris Wilson
8f9df28a82 intel_error_decode: Fix decode headers for HW context
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-31 22:10:11 +00:00
Chris Wilson
d4c3cd4d04 intel_error_decode: Inflate compressed error state
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-31 22:10:11 +00:00
Jani Nikula
9764247dc5 intel_bios_reader: add dumping of i2c element in mipi sequence
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-22 14:21:22 +02:00
Jani Nikula
cb89add979 intel_bios_reader: improve element dumpers
Try to print something useful and helpful for the user.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-22 14:21:22 +02:00
Jani Nikula
9c4aa072f0 intel_bios_reader: rewrite the mipi sequence block dumping
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-22 14:21:22 +02:00
Jani Nikula
68cfe4ba57 intel_bios_reader: check mipi sequence block version
Bail out on v3+, we don't support that just yet.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-22 14:21:22 +02:00
Jani Nikula
bdf7b1c0eb intel_opregion_decode: add new ASLE fields
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-22 14:21:22 +02:00
Jani Nikula
4fe60a6e1c tools: fix intel_gpu_abrt to use intel_reg
intel_reg_dumper is gone, replaced by 'intel_reg dump'.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-02 13:14:03 +02:00
Matt Turner
b088e30575 tools/aubdump: Link with -ldl.
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-24 16:36:54 +00:00
Thomas Wood
36b8143c22 Add missing noreturn attribute to various functions
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-11-11 14:20:55 +00:00
Chris Wilson
70ee508421 lib: Make instdone initialisation fail gracefully
Just report that we don't recognise the chipset rather than explode.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-11-09 16:57:22 +00:00
Ben Widawsky
134e32378a igt/intel_aubdump: Use the right ring
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-11-06 11:16:23 -08:00
Lu, Han
3e9726b337 tools/intel_audio_dump: add support for Broxton
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-14 15:45:23 +01:00
Derek Morton
1b492e311c benchmarks: Fix build errors on Android M-Dessert
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-10-02 09:42:30 +02:00
Micah Fedke
c81d293aed convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocci
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-11 14:39:43 +01:00
Derek Morton
bcd3e1f33f tools/Android.mk: Fix compile error in intel_reg.c
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-11 14:39:43 +01:00
Thomas Wood
3546514791 null_state_gen: add const to intel_batch_state_copy data
The data is not modified by the function and is often declared const.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11 14:39:43 +01:00
Thomas Wood
fdecc1b5af tools/aubdump: remove void pointer arithmetic
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-11 14:39:43 +01:00
Ville Syrjälä
2155d1eb54 tools/intel_bios_reader: Add MIPI device type
Decode the MIPI [sic] device type.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-09-11 16:11:35 +03:00
Ville Syrjälä
d8313c3002 tools/intel_bios_reader: Decode the device type bits
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-11 16:11:35 +03:00
Ville Syrjälä
a02305260e tools/intel_bios_reader: Print the child dev handle
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-09-11 16:00:58 +03:00
Ville Syrjälä
b701bb14c6 intel_bios_reader: Don't explode looking for the devid
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-11 15:58:39 +03:00
Ville Syrjälä
b1e756451c intel_bios_reader: Read the child device size from VBT
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-11 15:58:38 +03:00
Ville Syrjälä
c137ac7158 tools/intel_display_poller: Align DSPSURF to 128k to appease gen4/vlv/chv
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-11 15:33:28 +03:00
Ville Syrjälä
a8b85ea21b tools/intel_display_poller: Make pipe name alphabetic
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-11 15:33:28 +03:00
Ville Syrjälä
01a2a4d85d tools/intel_display_poller: Try to fix pipe<->plane handling on gen2/3
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-11 15:33:28 +03:00
Ville Syrjälä
ba139493a6 tools/intel_display_poller: Add CHV support
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-11 15:33:28 +03:00
Ville Syrjälä
7d2f1d7d9e tools/intel_reg: Print the potential port names in the help text
v2: Repaint with Jani's favorite color

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-09-11 15:32:28 +03:00
Ville Syrjälä
fb8131545f tools/intel_reg: Set register stride to 1 for VGA registers
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>
2015-09-09 22:41:45 +03:00
Mika Kuoppala
88fed9fbca tools/intel_reg: Use pci device from config on write
Use the pre configured pci device from config also
in write path.

Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-08 16:15:16 +01:00
Thomas Wood
1dcace3018 build: fix unused-result warnings
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-08 16:15:16 +01:00
Thomas Wood
de2470ea4f intel_reg: ensure "intel_reg help" always works
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-08 16:14:45 +01:00
Thomas Wood
9ecb50e5c5 tools: install the register definition files
Install the register definition files and use them by default in
intel_reg.

v2: remove redundant path check

Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-08 16:14:45 +01:00
Thomas Wood
af97918494 tools: remove quick_dump
Remove quick_dump as it has been replaced by the intel_reg tool and move
the register definition files to tools/registers.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Acked-by: Jani Nikula <jani.nikula@intel.com>
2015-09-08 16:14:45 +01:00
Thomas Wood
b9d27f03c7 tools/null_state_gen: fix various compiler warnings
Add the debug and warning flags to cflags and fix the resulting issues.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-08 16:14:45 +01:00
Thomas Wood
4ee6709e3b tests/tools: add --as-needed to linker flags
Add --as-needed to the linker flags to reduce the number of shared
library dependencies, since not all the tests and tools use all the
libraries required by the helper library (for example, many tests do not
use cairo). This helps portability of the binaries and also makes a
very small improvement to the execution speed and memory consumption.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-08 16:14:45 +01:00
Jani Nikula
0e25e5d92d igt: remove deprecated reg access tools in favor of intel_reg
intel_iosf_sb_read, intel_iosf_sb_write, intel_reg_dumper,
intel_reg_read, intel_reg_snapshot, intel_reg_write, intel_vga_read, and
intel_vga_write have been deprecated in favor of intel_reg. Remove the
deprecated tools. intel_reg does everything they do, and more.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-08-17 10:47:56 +03:00
Mika Kuoppala
5c07135b7b tools/null_state/gen9: Send all components in VF state
Fix

commit 59cdc16b1a6f069f944ff17851a59edf8f72d45d
Author: Arun Siluvery <arun.siluvery@linux.intel.com>
Date:   Fri Jul 31 16:27:07 2015 +0100

    tools/null_state/gen9: Send atleast one valid component in VF state

to honor the Reviewed-by, send all four components as noted by
Ben in his review.

Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Cc: Arun Siluvery <arun.siluvery@linux.intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2015-08-13 16:18:55 +03:00