summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2015-08-05lib: add igt_debugfs_read()Paulo Zanoni
A helpful function for when you want to read a whole debugfs file to a string and don't want to worry about opening and closing file descriptors and asserting buffer sizes. We've been using this already for kms_frontbuffer_tracking and kms_fbcon_fbt, so the only test with new code here is kms_fbc_crc. Also notice that for kms_fbc_crc we had to increase the buffer size since the file can sometimes be bigger than 64 bytes - depending on the reason why FBC is disabled. Of course, there are probably many other programs we can patch, but I'm not doing this now. v2: Add the macro to wrap sizeof() (Daniel). v3: Add documentation for the macro too (Daniel). Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-28igt/gem_streaming_writes: Bind into the GTT earlyChris Wilson
If we are using a streaming GGTT write into the source, we need to trigger an early fault in order to obtain a mappable offset. This is required when later we start reserving execbuf object top-down to try and avoid mappable space! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-22benchmarks: Benchmarkify gem_exec_nopChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-20lib/gpgpu_fill: Add SKL supportDominik Zeromski
SKL changed state base address command. Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Dominik Zeromski <dominik.zeromski@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20lib/gpgpu_fill: Add BDW supportDominik Zeromski
BDW changed structure of surface state and interface descriptors. Commands like state base address, gpgpu walker were extended. Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Dominik Zeromski <dominik.zeromski@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20lib: Move gpgpu_fill code to separate fileDominik Zeromski
The gpgpu fill utility functions are used in separate test so it's logical to keep them in separate file. This is similar to what media spin test did in the past. Functionally only gpgpu kernel changed. Send instruction payload size was reduced. Since offset is incremented by 0x10 bytes there is no point in using larger writes. Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Dominik Zeromski <dominik.zeromski@intel.com> [Thomas: Fix typo of gpgpu_fill.h in Makefile.sources] Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-20lib: exit immediately if igt_fail is called in an exit handlerThomas Wood
Exit immediately if the test is already exiting and igt_fail is called. This can happen if an igt_assert fails in an exit handler. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91349 Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-19igt/stats: Fixup tests to compile after interface changesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-19lib: Allow storing floating point values in igt_statsChris Wilson
We don't always have precise integers with which to store, so allow degrading to double precision floating point based on available input. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-14configure: require libdrm >= 2.4.55Paulo Zanoni
And drop the now unnecessary universal plane definitions. The 2.4.55 version is already quite old, so we should be fine. Thanks to Thomas Wood for quickly spotting this. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@>
2015-07-02build: Don't use automake's conditional in a Makefile.sourcesDamien Lespiau
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-02build: Add an option to not use the git hash in versionDamien Lespiau
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-02build: Add DEBUG_FLAGS to tools and self-testsDamien Lespiau
Makes using GDB better on those binaries. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-07-02aux: Don't evaluate several times the arguments of min() and max()Damien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-07-02stats: Add wikipedia links to get_trimean() and get_iqm()Damien Lespiau
Useful knowledge for anyone looking at the documentation and following the linkes. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-07-02docs: various documentation fixesThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-07-02docs: fix "no link" warningThomas Wood
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-02docs: override section id to avoid '/' in filenamesThomas Wood
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-01stats: Add trimeanChris Wilson
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-01stats: Add the interquartile mean (IQM)Chris Wilson
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-06-27stats: Exercise the reallocation pathsDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Spwan igt_init_with_size() from igt_init()Damien Lespiau
It's all about good looking APIs. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Allow the underlying arrays to grow at willDamien Lespiau
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-27stats: Test we do correctly invalidate the sorted arrayDamien Lespiau
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-27stats: Add support for the interquartile range (IQR)Damien Lespiau
IQR is a good measure of dispersion. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Add support for quartiles (and thus median)Damien Lespiau
More stuff, quite useful characteristics of a dataset. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Add a bulk version of _push()Damien Lespiau
In case we want to push a bunch of values in one go. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Use igt_assert_eq_double() when asserting on doublesDamien Lespiau
Lucky enough to have exact values, == works! Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27lib: Add double versions of igt_assert_cmp() and igt_assert_eq()Damien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27docs: Add documentation for igt_assert_cmpuint()Damien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27docs: Add documentation for igt_assert_u32()Damien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27docs: Fix a "libraray" typoDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Add igt_stats_get_range()Damien Lespiau
Somewhat useful, for instance to size an histogram. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Add functions to retrieve min/max values of the datasetDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Factor out a fixture to initialize statsDamien Lespiau
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-27stats: Add a note about the standard deviation derived from unbiased varianceDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Add a getter for the population propertyDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Add a way to specify if the data set is a population or a sampleDamien Lespiau
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-27stats: Add gtkdoc section for igt_statsDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Add header gardsDamien Lespiau
Sigh. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27doc: Remove i-g-t/intel prefixes and capitalize section titlesDamien Lespiau
Looks better! Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Zero the whole structure at init() timeDamien Lespiau
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-27tests/stats: Make sure we properly invalidate the cached meanDamien Lespiau
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-27stats: Add a way to retrieve the standard deviationDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27stats: Use an algorithm popularised by Knuth to compute mean and varianceDamien Lespiau
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-27tests/igt_stats: Call igt_stats_fini() to not leak the arrayDamien Lespiau
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-27stats: Be more precise and talk about mean, not averageDamien Lespiau
There are several types of averages eg. mean, median and mode. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-26lib/igt_draw: move to the GTT domain before using GTT mmapsPaulo Zanoni
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-26lib/igt_core: fflush stdout after printing subtest resultsPaulo Zanoni
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-25lib: Add a tiny utility function to compute averagesDamien Lespiau
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>