3601 Commits

Author SHA1 Message Date
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
Paulo Zanoni
6cc553adf2 lib/igt_core: fflush stdout after printing subtest results
I often run "sudo ./test 2>&1 | tee output.txt", and when we're
succeeding - never printing to stderr - the output gets buffered and
is never flushed (because it doesn't point to a terminal), so I never
know which test is running. With this fflush, I'm able to know when
each test finishes.

v2: Add blank line too (Chris)

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-26 17:35:39 -03:00
Chris Wilson
f78574101f igt/gem_fenced_exec_thrash: Tidy testing of expected execbuf errors
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-26 11:49:38 +01:00
Derek Morton
c69b135783 igt/gem_fenced_exec_thrash: Fix memory leak between tests
gem_fenced_exec_thrash was not freeing any resources between
subtests. On 1Gb android systems this resulted in the test
failing with an OOM error.

Added cleanup code to free BOs at the end of each subtest.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
2015-06-26 11:49:38 +01:00
Paulo Zanoni
eeda401391 kms_frontbuffer_tracking: GTT mmap writes disable PSR
And they keep it disabled until something else enables it. So let's
consider this on the draw subtests.

With this, some PSR tests that were failing will now start passing.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-25 14:54:24 -03:00
Paulo Zanoni
053f33ad1c kms_frontbuffer_tracking: use CPU mmaps for fill_fb_region()
Because the GTT mmaps "permanently" disable PSR and this can mess
some of our assertions. So let's just use the CPU domain to keep the
implementation simple.

With this, some PSR tests that were failing will now start passing.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-25 14:53:49 -03:00
Paulo Zanoni
7a4ded7b87 kms_frontbuffer_tracking: remove offscreen-{cur,spr} subtests
It doesn't make sense to write on the sprite/cursor plane of the
"offscreen" screen. The pick_target() function was just returning the
offscreen_fb pointer for those cases, so we were not really testing
any cursor or sprite code. So the tests were just the same as
offscreen-pri.

That kills 24 subtests for each feature (72 in total).

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-25 14:53:07 -03:00
Paulo Zanoni
ce3b47bac8 tests/kms_frontbuffer_tracking: add modesetfrombusy test
This test exercies the dev_priv->fb_tracking.busy_bits bug I recently
found and Daniel fixed.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-25 14:52:26 -03: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
Damien Lespiau
06f5f7065f lib: Add a tiny utility function to compute averages
The master plan would be to get a bit more stats in it, at least the
standard deviation and confidence interval. Just need the average for
now.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-25 17:22:03 +01:00
Daniel Vetter
484e27542d tests/kms_fbc_crc: Don't force fbc on old platforms
It's simply a bit too scary on pre-gen6 and imo not worth the bother
really until someone starts to implement all the hacks an w/a required
on these platforms. On later platforms the issues are just with
correctness and performance hence no risk for hanging machines.

Cc: Paulo Zanoni <przanoni@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-06-25 09:43:55 +02:00
Chris Wilson
44d444acaa overlay: Enable locale
Enabling locale allows us to use thousand separators and other such
human touches in the output.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-24 17:03:42 +01:00
Chris Wilson
453792c501 lib: Enable locale dependent output to a terminal
If we are in an interactive session, enable the locale. This allows for
features like setting thousand separators for printing large values. By
only enabling it for interactive terminals, we avoid changing outputs
for the test scripts (leaving them as the "C" locale).

Note this mainly affects the testcases, or binaries built using libigt.
Other binaries need to be localised separately.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michel Thierry <michel.thierry@intel.com>
2015-06-24 17:03:04 +01:00
Paulo Zanoni
7eb5f07949 tests/kms_frontbuffer_tracking: rename set_screens_for_test
Rename it to prepare_subtest. This function used to be much smaller
when I decided its name.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-23 14:44:18 -03:00
Paulo Zanoni
7756e88445 tests/kms_frontbuffer_tracking: simplify flib_subtest fb handling
Get rid of fb2_region, use params->fb directly instead.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-23 14:43:02 -03:00
Paulo Zanoni
77e1bac6eb tests/kms_frontbuffer_tracking: simplify wait_user() calls
I often add new temoprary wait_user() calls when debugging things, and
having to add "if (opt.step)" is annoying, so let's make the step
level check inside wait_user(). As a bonus, our huge macro is 2 lines
shorter.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-23 14:41:22 -03:00
Paulo Zanoni
969cb3c575 tests/kms_frontbuffer_tracking: not all eDP panels support sink CRC
And require sink CRC support for PSR, since the pipe CRC is not
exactly useful there.

v2: Check for ENOTTY (Rodrigo).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91019
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-23 14:41:01 -03:00
Derek Morton
471ebbed53 igt/gem_fence_thrash: Reduce memory usage
On android platforms with 1Gb RAM gem_fence_thrash was failing
with an out of memory error.
This patch causes gem_close() to be called when a handle is
no longer required rather than relying on the cleanup when
the fd is closed. This greatly improves the memory footprint
of the test allowing it to run on 1Mb systems.

Also fixed a leak of the 'threads' variable.

v2: Simplified as per Chris Wilson's suggestion.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
[ickle: fix mmap leak from bo_copy()]
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-23 17:19:07 +01:00
Thomas Wood
154192a680 NEWS: Post-release bump
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-06-23 13:36:02 +01:00
Chris Wilson
0e528af623 igt: Add gem_exec_alignment
Simple test to see whether the kernel obey's the user's request
alignemnt.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-22 15:55:21 +01:00
Chris Wilson
eb7d60e430 igt: Add gem_eio for inducing expected EIO
A few entry points in the GEM API are expected to raise EIO if we
encounter a wedged GPU. This testcase aims to do so by first injecting a
GPU hang with GPU resets disabled (thus causing the GPU to become wedged)
and then exercises the various API to check for the expected errors.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-19 11:44:26 +01:00
Chris Wilson
4fbce7e462 testdisplay_hotplug: Add missing #include <sys/stat.h>
testdisplay_hotplug.c: In function ‘hotplug_event’:
testdisplay_hotplug.c:46:14: error: storage size of ‘s’ isn’t known
  struct stat s;
              ^
testdisplay_hotplug.c:54:2: error: implicit declaration of function ‘fstat’ [-Werror=implicit-function-declaration]
  fstat(drm_fd, &s);
  ^
testdisplay_hotplug.c:54:2: warning: nested extern declaration of ‘fstat’ [-Wnested-externs]
testdisplay_hotplug.c:46:14: warning: unused variable ‘s’ [-Wunused-variable]
  struct stat s;
              ^
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-06-18 10:38:47 +01:00