613 Commits

Author SHA1 Message Date
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
Arun Siluvery
59cdc16b1a tools/null_state/gen9: Send atleast one valid component in VF state
A programming restriction exists for this instruction, atleast one component
of one valid vertex element must be enabled.

Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
Reviewed-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2015-08-13 15:20:32 +03:00
Kristian Høgsberg Kristensen
33bc41aa41 aubdump: Write header after figuring out the gen
We have to defer figuring out the gen until we have a PCI ID, which we
don't have for sure until the first execbuffer2 ioctl. We can't write
the file header until we have the gen since we need to know the size of
offsets in the file format.  Move the call to write_header() into the
dump_execbuffer2() where we have the gen.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-08-12 08:58:00 -07:00
Kristian Høgsberg Kristensen
3156305ace aubdump: Handle 48 bit ppgtt dumping
Put 48 bit block offsets in the AUB file and track the bo offsets with
uint64_t.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-08-12 08:58:00 -07:00
Kristian Høgsberg
9c15167c61 tools/aubdump: Get PCI ID from getparam ioctl when we can
Instead of doing an extra getparam ioctl to discover the PCI ID, we
can snoop it when the application queries it.

Signed-off-by: Kristian Høgsberg <krh@cryptic-dragon.jf.intel.com>
2015-08-07 15:00:32 -07:00
Kristian Høgsberg
5f4fad3182 tools/aubdump: Don't rely on open for discovering the drm fd
DRI3 passes the drm fd over X protocol and as such we can't rely on
hooking open to discover the drm fd. Instead we look for drm ioctl
codes in the ioctl wrapper. If we don't have a drm fd and see
something that looks like a drm ioctl, we stat the fd to see if it's a
drm fd.  If it is, we save it for later so we don't have to do an
extra stat on every ioctl.  We can then drop the open wrapper, but we
keep the close wrapper so we can invalidate our cached drm_fd if it's
closed.

Signed-off-by: Kristian Høgsberg <krh@cryptic-dragon.jf.intel.com>
2015-08-07 14:59:56 -07:00
Derek Morton
1ae1d290bf benchmarks/Android.mk, tools/Android.mk: Fix android build error
Recently added tools / benckmarks have the same module name as
existing tests. Android does not allow duplicate modules. This
patch appends _benchmark and _tool to the module names used when
building benckmarks and tools to prevent clashes with tests of
the same name.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-08-06 14:39:44 +02:00
Kristian Høgsberg Kristensen
78e2a2f245 tools: Use right #include path for i915_drm.h
pkg-config adds /usr/include/libdrm to the include path so we only need i915_drm.h

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-08-05 11:53:17 -07:00
Kristian Høgsberg Kristensen
220c7d1f91 tools/aubdump: Add --device option for overriding device ID
This lets us capture AUB traces for platforms different from the one
we're running on.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-08-04 15:00:50 -07:00
Kristian Høgsberg Kristensen
f47bdba8b0 tools/aubdump.c: Also define struct drm_i915_gem_userptr for compatibility
Oops, we obviously also need to define the argument struct for userptr.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-08-04 09:36:53 -07:00
Kristian Høgsberg Kristensen
e4fa17df02 tools/aubdump: #define DRM_IOCTL_I915_GEM_USERPTR if kernel headers don't
Fix compile error on older kernels.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-07-31 14:26:15 -07:00
Kristian Høgsberg Kristensen
e6a5d799fc tools: Add LD_PRELOAD-based AUB dumper tool
This does everything the aub dump functionality in libdrm does, but
without being part of libdrm.  This moves the very developer oriented
functionality out of core libdrm and adds some flexibility in how we
activate it (we can specify filename, for example).  Most importantly,
this lets us dump aub files for tools and/or drivers that don't use
libdrm, without having to add that code to each of those projects.

The tool is used much like strace or valgrind.  For example:

  $ intel_aubdump -v --output=stuff.aub -- glxgears -geometry 500x500

will launch glxgears with its options and enable aub dumping and pass
the -v and --output=stuff.aub options to the aub dumper.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-07-31 10:40:04 -07:00
Derek Morton
3c294a8fa3 Android.mk: Disable tools that do not build for android
Disable the tools / demo code that do not currently build
for android until they can be fixed.

Affected tools / demos
intel_display_crc
intel_sprite_on

v2: intel_display_crc compiled conditionally on ANDROID_HAS_CAIRO
flag.
v3: removed intel_reg from the skip list as Thomas has prepared
a patch to fix it for Android.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20 18:13:37 +01:00
Thomas Wood
51576b7ad6 tools/Android.mk: add any extra program sources
v2: remove unintended change and fix source file duplication errors
    (Derek Morton)

Cc: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20 18:13:37 +01:00
Thomas Wood
80f1553780 intel_reg: support platforms without sys/io.h
Based on an idea from Jani Nikula.

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20 18:13:37 +01:00
Chris Wilson
d9c3f0b50c tools: Add a simple stats generator 'igt_stats'
A rudimentary tool on top of the igt_stats library. Reads a list of
numbers from stdin or from a file and prints the estimate of the central
location, aka average.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-19 15:30:23 +01:00
Damien Lespiau
0a01a190f6 build: Add DEBUG_FLAGS to tools and self-tests
Makes using GDB better on those binaries.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-07-02 11:20:42 +01:00
Damien Lespiau
669b5da2bc tools: Add an intel_firmware_decode tool
So we can inspect fw headers. Sample output:

Firmware: skl_dmc_ver1_18.bin (7892 bytes)
CSS header (128 bytes)
    module_type: DMC (9)
    header_len: 32
    header_ver: 0x10000
    module_id: 0x0
    module_vendor: 0x0
    date: 0x7df060c
    size: 1973
    key_size: 0
    modulus_size: 0
    exponent_size: 0
    version: 1.18 (0x10012)
    kernel_header_info: 0x0
Package header (256 bytes)
    header_len: 64
    header_ver: 1
    num_entries: 3
Firmware #1
    stepping: A.*
    offset: 4294967295
Firmware #2
    stepping: B.*
    offset: 4294967295
Firmware #3
    stepping: *.*
    offset: 0
0x7f0867143000
0x7f0867143180
    signature: 0x40403e3e
    header_len: 128
    header_ver: 1
    dmcc_ver: 520
    project: 0x900
    fw_size: 1845
    fw_version: 0x10008
    mmio_count: 3
        write(0x0008f074, 0x00002fc0)
        write(0x0008f004, 0x02500204)
        write(0x0008f034, 0xc003b400)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-30 16:38:54 +01:00
Damien Lespiau
66e0bf66da stats: Spwan igt_init_with_size() from igt_init()
It's all about good looking APIs.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 19:05:41 +01:00
Damien Lespiau
3a5cf84317 stats: Add a way to specify if the data set is a population or a sample
This changes how we compute the variance. We want an unbiased variance
when reasoning about a sample.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:07 +01:00
Damien Lespiau
515cec1210 stats: Add a way to retrieve the standard deviation
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:03:27 +01:00
Damien Lespiau
e55a11d3eb stats: Be more precise and talk about mean, not average
There are several types of averages eg. mean, median and mode.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:03:27 +01:00
Damien Lespiau
de774ed31e skl_compute_wrpll: Don't try other dividers if we find a 0 central freq deviation
Paulo suggested that we could short-circuit the search for a good
divider if we find a 0 deviation of the DCO frequency from the central
frequency.

Out of the 373 test frequencies, 34 hit that fast path.

Suggested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-25 17:49:34 +01:00
Damien Lespiau
26336385ac skl_compute_wrpll: Sync a comment with from the kernel code
Might as well try to keep the code in both this test and the kernel as
close as possible.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-25 17:49:34 +01:00
Damien Lespiau
dfebf08d9a skl_compute_wrpll: Fix the mininum deviation computation
Paulo noticed that, because we were only comparing positive deviations
with positive deviations and negative deviations with negative
deviations, we weren't actually always using the absolute minimal
deviation at all.

This improves the average deviation across all tested frequencies (373):

before: average deviation: 215.13
after: average deviation: 194.47

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-25 17:22:04 +01:00
Damien Lespiau
afdaeabbcf skl_compute_wrpll: Cycle through dividers, then central freqs
Follow Paulo's comment on the corresponding kernel patch.

This means we also have to move the break when we have cycled through
the even dividers as well.

This improves the number of even dividers used across the tested
frequencies (373) (at the expense of a slightly worse average deviation,
but "even dividers take precedence over a lower deviation".

before:
  even/odd dividers: 338/35
  average deviation: 206.52

after:
  even/odd dividers: 363/10
  average deviation: 215.13

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-25 17:22:04 +01:00
Damien Lespiau
efd2895f23 skl_compute_wrpll: Print the average deviation
It's interesting to watch the effect of some algorithm tweaks on the
average deviation between the central freq and the dco freq. A metric
we'd like to minimize.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-25 17:22:04 +01:00
Thomas Wood
aa75f37397 tools: print a warning for tools replaced by intel_reg
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-06-11 14:48:58 +01:00
Damien Lespiau
15f60217cc intel_display_crc: A new tool to play with display CRCs
The CRC debug interface is a bit more than a simple textual file in
debugfs as there are a small command language to control what we want
from them.

This tool starts, slowly, by allowing us to dump the pipe CRCs whenever
we want. It can be handy to check what is the current CRC when we reach
a certain state on the screen (when using --interactive-debug for
instance) against a known CRC.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-15 12:22:21 +01:00
Damien Lespiau
e949c42b49 quick_dump: Expand the WM cursor registers
The tool I used to generate that list doesn't support expanding the list
of registers when dealing with something like CUR_WM_A_*. Expand it by
hand for now (tm).

Remove CUR_PAL_${pipe}_* for the same reason (and because it's not very
useful to have).

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-12 16:41:09 +01:00
Damien Lespiau
5f932c4dad quick_dump/skl: Add more pipe/plane registers
With the recent developments, add scaler and NV12 registers to the dump.
Also add the cursor registers that were missing in the first batch.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-11 19:31:26 +01:00
Damien Lespiau
f6155ac30c build: Add missing line continuation
When -lrt was added, it was missing a '\' at the end of line. Add it.

Cc: Tim Gore <tim.gore@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-11 17:55:36 +01:00
Damien Lespiau
cb57cdc632 skl_compute_wrpll: Prefer even dividers
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-08 17:55:30 +01:00
Damien Lespiau
b3ef2986ca skl_compute_wrpll: Count how many even/odd dividers we compute
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-08 17:55:30 +01:00
Damien Lespiau
8d1739dd84 skl_compute_wrpll: Make sure we respect the DCO frequency constraints
We might as well verify that we have a semblance of all being in order
by making sure the DCO frequency is within the expected bounds.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-08 17:55:30 +01:00
Damien Lespiau
acbcdbd8b7 skl_compute_wrpll: Add a way to test the SKL WRPLL algorithm
I had various problems (infinite loops, unable to compute dividers for
certain frequencies) after implementing a BSpec update. Much easier to
debug that in userspace.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-08 17:55:30 +01:00
Damien Lespiau
5dbeebc8aa compute_wrpll: Rename ddi_compute_wrpll to hsw_compute_wrpll
We're going to add the SKL version, time to rename the HSW/BDW one.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-08 17:55:30 +01:00