3776 Commits

Author SHA1 Message Date
Paulo Zanoni
344dab22e9 kms_frontbuffer_tracking: avoid huge strides during normal operation
We want to restrict huge strides to the yet-to-be-implemented
stride-size-specific subtest.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 11:32:53 -03:00
Paulo Zanoni
c2d656c5d6 kms_frontbuffer_tracking: don't hardcode the X/Y big FB offset
While debugging the test failures I tried different values for the
offsets, so having a central place to change them is the only sane
way.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 11:32:32 -03:00
Paulo Zanoni
9ca8a1bade pm_rpm: remove pm_status_fd declaration
This was forgotten since we moved some code to igt_aux.c a long time
ago.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14 09:40:10 -03:00
Matt Roper
b81f7db593 kms_universal_plane.c: Update sanity checks for gen9
SKL and BXT have some new plane capabilities that previous generations
didn't have; we need to update some of our universal plane tests to
expect success rather than failure when running on these platforms.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2015-07-08 13:54:12 -07:00
Abdiel Janulgue
8ad1e40778 tests/gem_exec_params: check invalid flags for Resource Streamer
Make sure resource streamer flags works only in correct ring in
addition to checking next flag after the RS boundary fails.

v2: Make sure we reject RS on pre-hsw.
v3: Don't skip 1<<15 for the exec flags (Jani Nikula)

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-06 10:02:06 +01:00
Damien Lespiau
ec9e5996d1 build: Don't use automake's conditional in a Makefile.sources
I just remembered that those Makefile.sources files where also
included by the Android build system, so we can't use automake's
conditionals in there.

So, we want to use GNU make's one. Unfortunately, after all those years,
GNU automake still doesn't do anything useful with GNU make's ifeq:

  lib/Makefile.sources:66: error: else without if

automake will helpfully signal that the 'else' corresponding to the
'ifeq' doesn't have a corresponding 'if'. Well, yeah, thanks.

Fortunately, we can work around this by cunningly inserting a space
before 'ifeq', 'else' and 'endif' and fool automake's regex-based
checks.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-07-02 15:23:35 +01:00
Damien Lespiau
64295c67e9 build: Add -lm to tests
Since the introduction of igt_stats and its usage in gem_exec_nop, we
need to link the tests against libm. My rebasing bot complained when
linking gem_exec_nop:

  lib/igt_stats.c:492: undefined reference to `sqrt'

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-07-02 11:54:17 +01:00
Damien Lespiau
e5653d5f1d build: Add an option to not use the git hash in version
When developing, it's quite annoying that the version changes every
commit, causing the library to be rebuild and every single binary
re-linked.

Add a config option to skip that.

I remember Ville asking for this "feature" as well.

v2: Option is now called --disable-git-hash (Thomas)
    Various spelling mistakes (Thomas)

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-07-02 11:54:12 +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
390653acfb aux: Don't evaluate several times the arguments of min() and max()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-07-02 11:20:42 +01:00
Damien Lespiau
643aab2249 stats: Add wikipedia links to get_trimean() and get_iqm()
Useful knowledge for anyone looking at the documentation and following
the linkes.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-07-02 11:20:42 +01:00
Thomas Wood
d01ebbd97d docs: various documentation fixes
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-02 08:17:17 +01:00
Thomas Wood
8a109f94b9 docs: fix duplicated ID error
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-02 08:17:17 +01:00
Thomas Wood
85f6d82d3c docs: fix "no link" warning
igt_save_module_param is an internal static function and therefore isn't
included in the public API documentation.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-02 08:17:17 +01:00
Thomas Wood
f01e0552d6 docs: add the annotation glossary
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-02 08:17:17 +01:00
Thomas Wood
5d80872009 docs: override section id to avoid '/' in filenames
The section id is generated from the section title and is used to create
the html output filename, which therefore causes problems if it includes
a '/' character.

Cc: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-02 08:17:17 +01:00
Chris Wilson
614895fec1 igt/gem_exec_nop: Control boost/idle frequencies
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-01 21:02:55 +01:00
Chris Wilson
b43070987e igt/gem_exec_nop: Wait between runs
In order to keep the GPU in a consistent state between samples, we have
to wait for it to fall asleep before proceeding.

For fun hook up igt_stats.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-01 18:58:46 +01:00
Chris Wilson
2d305f6199 stats: Add trimean
https://en.wikipedia.org/wiki/Trimean

	The trimean is a the most efficient 3-point L-estimator (estimator
	of central tendency, i.e. average), even more robust than the
	median at estimating the average of a sample population.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-01 18:58:46 +01:00
Chris Wilson
19135a3447 stats: Add the interquartile mean (IQM)
https://en.wikipedia.org/wiki/Interquartile_mean

	The IQM is a truncated mean and so is very similar to the scoring
	method used in sports that are evaluated by a panel of judges:
	discard the lowest and the highest scores; calculate the mean
	value of the remaining scores.

It's useful to hide outliers in measurements (due to cold cache etc),
without having to worry too much about the actual distribution.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-01 18:58:46 +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
Joonas Lahtinen
ad411e2d5d tests/gem_ringfill: Add {render,blitter}-forked-1 subtests.
Add forking subtests to gem_ringfill. Tests cause consistent GPU
hangs on SKL.

v2: Removed noop parts.
v3:
- Allow executing the tests in order too (Chris Wilson).
- Rename the tests to -forked-1

Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
[ickle: Extend to cover forked-N]
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89959
2015-06-29 11:41:06 +01:00
Damien Lespiau
46f277b90b stats: Exercise the reallocation paths
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 19:05:41 +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
00432ff260 stats: Allow the underlying arrays to grow at will
Chris mentioned he wanted to be able to measure a variable "for one
second" and use igt_stats to store them. That's one case where we don't
know the number of data points upfront.

We should really support that, so here it is.

v2: Just free ->sorted when a new capacity is needed.
    ensure_sorted_values() will then reallocate the array to the new
    capacity on demand (Chris)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 19:05:41 +01:00
Damien Lespiau
817ea87b6e stats: Test we do correctly invalidate the sorted array
Chris had a doubt, and I was lazy and didn't do a similar test for the
quartiles/median than for the mean (test_invalidate_mean()). Plug that
gap.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:46:37 +01:00
Damien Lespiau
fabde384a3 stats: Add support for the interquartile range (IQR)
IQR is a good measure of dispersion.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:08 +01:00
Damien Lespiau
1b8997b3f8 stats: Add support for quartiles (and thus median)
More stuff, quite useful characteristics of a dataset.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:08 +01:00
Damien Lespiau
3839bacde8 stats: Add a bulk version of _push()
In case we want to push a bunch of values in one go.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:08 +01:00
Damien Lespiau
2fe286985f stats: Use igt_assert_eq_double() when asserting on doubles
Lucky enough to have exact values, == works!

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:08 +01:00
Damien Lespiau
0a38e977c0 lib: Add double versions of igt_assert_cmp() and igt_assert_eq()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:08 +01:00
Damien Lespiau
23888526c7 docs: Add documentation for igt_assert_cmpuint()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:08 +01:00
Damien Lespiau
f660d0a054 docs: Add documentation for igt_assert_u32()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:07 +01:00
Damien Lespiau
4dca31b2d6 docs: Fix a "libraray" typo
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:07 +01:00
Damien Lespiau
0e4c175e04 stats: Add igt_stats_get_range()
Somewhat useful, for instance to size an histogram.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:07 +01:00
Damien Lespiau
4a89a841a1 stats: Add functions to retrieve min/max values of the dataset
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:07 +01:00
Damien Lespiau
87009f3d7b stats: Factor out a fixture to initialize stats
We're going to use this simple fixture once more, might as well make a
function instead of copy/pasting code.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:07 +01:00
Damien Lespiau
17ed69fbb8 stats: Add a note about the standard deviation derived from unbiased variance
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:07 +01:00
Damien Lespiau
da123adeae stats: Add a getter for the population property
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:07 +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
a2f6fd3725 stats: Add gtkdoc section for igt_stats
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:07 +01:00
Damien Lespiau
087a8d1c63 stats: Add header gards
Sigh.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:07 +01:00
Damien Lespiau
6ebd8c2dc3 doc: Remove i-g-t/intel prefixes and capitalize section titles
Looks better!

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:07 +01:00
Damien Lespiau
203c3841fc stats: Zero the whole structure at init() time
Because the structure started small, I initialized every member
directly, but that means that the new fields added weren't properly
initialized (sigh!). Zero the whole thing first then.

Also, the punishment for introducing a bug should be to write the
corresponding unit test. It's not a perfect one, but I'll take it.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:04:07 +01:00
Damien Lespiau
76ea7b9133 tests/stats: Make sure we properly invalidate the cached mean
Sure, that's an implementation details, but make sure we do recompute
the mean when we add a new value.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:03:27 +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
05c10f940f stats: Use an algorithm popularised by Knuth to compute mean and variance
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27 16:03:27 +01:00
Damien Lespiau
9986282c2b tests/igt_stats: Call igt_stats_fini() to not leak the array
Sure, it'll be freed at exit(), but might as well be a bit pedantic.

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
Paulo Zanoni
e86557ca9f lib/igt_draw: move to the GTT domain before using GTT mmaps
With this, we don't need to worry about what happened to the buffer
before.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-26 17:36:47 -03:00