summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2016-10-18drmtest: Install exithandler for i915, even in multidriver testsChris Wilson
If we opened the driver multiple times, we would not flush i915 if it was opened second. The persistence of one test state into a second can upset third parties, e.g. prime_vgem upsetting vgem_basic (due to references from i915.ko to vgem.ko preventing module unload). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2016-10-18lib/igt_aux: Improve documentation for igt_system_suspend_autoresume()Imre Deak
While at it fix the order of states for consistency. Suggested by Daniel. Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-10-14lib/sysfs: Use a fallback for builtin modulesChris Wilson
A builtin modules does not have a sysfs/device/module symlink, so be creative. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-14tests: prefix IGT kernel log messages with [IGT]Jani Nikula
Make the IGT logging stand out better and easier to grep. Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-10-13igt/gem_ctx_param: Update invalid parma numberChris Wilson
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97108 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-13igt/gem_ctx_param: Tidy error messagesChris Wilson
Avoid macro expansion inside the asserts so that the error messages are readable. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-13lib/igt_aux: Add support for various system suspend/resume optionsImre Deak
To have a more accurate idea about any suspend/resume issues we can perform the s/r until various phases in the s/r sequence. This way we can isolate the given problem as being a device driver, kernel core or BIOS related issue. Actual subtests using these new s/r phases will be added as follow-up. While at it also add the freeze suspend target, it's something we also would need to test. Signed-off-by: Imre Deak <imre.deak@intel.com>
2016-10-13lib/igt_gt: Use /sys/.../error instead of /debug/.../i915_error_stateChris Wilson
The stable path is via sys, but we only have to use this should the kernel be ignoring our request to ignore simulated hangs. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-13igt/gem_wait: Use explicit timersChris Wilson
Rather than guestimating a workload that should take a certain amount of time, use a sigitimer to terminate a batch (and so complete the wait) after an exact amount of time. And in the process expand testing to cover multiple rings and hangcheck. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-11lib/chipset: Properly skip on non-IntelDaniel Vetter
Random drive-by I noticed while hacking on piglit. Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-10-05igt_kms: Refresh output when setting pipe.Maarten Lankhorst
We still allow duplicates at this point, but when commit is called only one output per display is allowed. This fixes tests like kms_psr_sink_crc, which expect a valid pipe. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-09-30igt/gem_userptr_blits: Tidy up the debug spamChris Wilson
igt_subtest_group { /* to the request */ } Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97934
2016-09-27lib: Do two writes to /proc/sys/vm/drop_caches againPetri Latvala
The drop_caches sysctl has a max value of 4, so writing 7 to it just fails. Avoid the earlier two-writes problem by opening the fd twice. v2: Don't lseek(), open() twice. (Chris) Signed-off-by: Petri Latvala <petri.latvala@intel.com>
2016-09-20lib/igt_core: Print stacktrace in initialization/fixture blocks.Marius Vlad
Likely candidate for this behaviour is the igt_fixture block. Seen in the CI by running tests/kms_psr_sink_crc which is causing segfaults in the fixture block. While at it fix some minor printing bugs. Signed-off-by: Marius Vlad <marius.c.vlad@intel.com> CC: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-20lib: Add igt_primes.h to SOURCESChris Wilson
Not as automagic as kbuild :( Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-19lib: Add support for DROP_FREED in igt_drop_caches_set()Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-16lib: Export igt_debugfs_mount()Chris Wilson
Not everything we want from debugfs is under debugfs/dri. But we do want to share the code to find the debugfs mount point (and mount it if is not found). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-16lib: Add an iterator to generate primesChris Wilson
Primes are useful as input sources since they should not fall into any patterns that may be optimised by the drivers. An example of use this in a test driver: uint32_t seqno, inc, count; seqno = inc = count = 0; do { inc = igt_next_prime_number(inc); if (seqno + inc < seqno) break; seqno += inc; /* igt_assert_eq(test_inc(inc), seqno); */ count++; } while (1); printf("count=%u, seqno=%u, last=%u\n", count, seqno, inc); and prints "count=27878, seqno=4294845817, last=323381", or for simply generating the set of the first N prime numbers, use for_each_prime_number(prime, 100) printf("%lu ", prime); which prints 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 64 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 Note that 1 is included in the set of prime numbers for convenience above. Mathematicians beware! The set of primes is computed using the Sieve of Eratosthenes, which basically just keeps a list of all multiples - any number not in list is therefore prime. As a bitmask of all integers is kept, it can be quite memory intensive for very large primes. A fallback to "trial division" is available just in case, but for large primes that is much slower. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-15lib/kms: Probe connectors from igt_enable_connectors()Chris Wilson
This fixes a failure when running kms_flip after booting on a bare system as nothing will have probed the connectors before hand. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-13igt/gem_busy: Prevent banning when running multiple hang testsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-02lib/igt_core: Wrap print_backtrace_sig_safe() with HAVE_LIBUNWIND.Marius Vlad
Reported-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-09-01lib/igt_core: Print stacktrace when receiving one of the crash signals.marius vlad
While at it add SIGFPE as a crash signal. v3: Remove calls to igt_assert_eq() as these are not async-safe. As one user of this method remove the function pointer and recursive call. (Chris Wilson) v2: Added some helpers to avoid printf() inside a signal handler. (Chris Wilson) Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-09-01lib/intel_chipset: Fix compilation when enabling the debugger.marius vlad
Add IS_SANDYBRIDGE() macro used by debugger/eudb. Signed-off-by: Marius Vlad <marius.c.vlad@intel.com> CC: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-01autotools/: Allow check target to be invoked w/o the need to issue a build.Marius Vlad
We need to have the test list generated before running the check target. Migrated igt_command_line.sh to tests/ from lib/tests/, which allows to building the tests and execute the script. This would allow cleaning followed by a make check. Also assembler/ directory needs also to be adjusted in order for this to work. Kept the possibility to invoke tests/igt_command_line.sh to determine which test is failing. Signed-off-by: Marius Vlad <marius.c.vlad@intel.com> Url: https://patchwork.freedesktop.org/series/6539/ Reviewed-By: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-01lib: Make igt_command_line.sh selftest standaloneChris Wilson
Allow the casual user to run igt_command_line.sh to discover what make check is complaining about. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-08-29lib: Avoid using 2 writes to /proc/sys/vm/drop_cachesChris Wilson
As the second write is ignored (leading to lack of memory freeing and spuriously failing tests), just do everything from the one write. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-08-25igt_kms: Populate more members of connectors.Maarten Lankhorst
It's possible to make use of disconnected connectors, for example when overriding the mode or testing connector properties that don't need it to be connected. Support this by zeroing the mode in that case. We still return false, but this is ignored by commit. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-08-23lib/kms: Force connector probing on first useChris Wilson
In order for igt to run completely standalone, it must coldplug connectors on first use by forcing the probe. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-08-18lib: Preallocate framebuffersChris Wilson
So for reasons unfathomable CRC appear to be miscalculated when the plane is not in the mappable aperture. Worrisome, but for now preallocate space in the mappable region for the new framebuffer and design some specific tests to explore the issue further. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-08-05lib: Fix typo s/huma-readable/human-readable/Ville Syrjälä
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-08-05tools/intel_reg: Dump DP_BUFTRANS registers on ILK-IVBVille Syrjälä
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-08-04igt_kms: Use proper panning coordinates for legacy primary plane updatesMatt Roper
A copy/paste error resulted in us using src_x for both the x and y panning coordinates; make sure we use src_y instead for the appropriate parameter. Fixes: 0e29ce3265b ("igt_kms: Remove pan members from igt_plane, v2.") Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Bob Paauwe <bob.j.paauwe@intel.com>
2016-08-04igt/gem_mocs_settings: adding RC6 testsPeter Antoine
This change adds a RC6 test for the MOCS. The MOCS registers are loaded and saved as part of the RC6 cycle but not all the registers are saved/restored. This tests that those registers are correctly restored. Signed-off-by: Peter Antoine <peter.antoine@intel.com>
2016-08-04lib/Makefile: Replace automake specific names of listings in Makefile.sourcesRobert Foss
Replace the automake specific variable names for listings in Makefile.sources with something not automake specific. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-08-04lib/tests/Makefile: Replace automake specific names of listings in ↵Robert Foss
Makefile.sources Replace the automake specific names of listings with something that isn't automake specific. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-08-04lib/stubs: Add stubs for intel_bufmgrRobert Foss
This patch provides stubs for functionality otherwise provided by intel_bufmgr. The stubbed functions all fail with a call to igt_require_f(false,""). Defines and enums have been copied from libdrm_intel. Due to the stubbed tests failing with an igt_require_f() call, these stubs are not well suited for non-tests, since tools/benchmarks/etc 'skipping' execution is unhelpful. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-08-04configure.ac: Harmonize HAVE_XXX flag for all drm platforms to HAVE_LIBDRM_XXXRobert Foss
Replace the automake flag HAVE_XXX for VC4/NOUVEAU with HAVE_LIBDRM_XXX in order for the flags to be more descriptive and also follow the same convention as HAVE_LIBDRM_INTEL. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-08-01igt/gem_mmap_gtt/wc: Reduce test runtimeChris Wilson
Add a new iterator macro to run for a specified number of milliseconds. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-27docs: minimal docs for igt_vgem.cDaniel Vetter
Feeling somewhat lazy right now ;-) Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-07-27lib: Update ioctl_wrappers functionsDaniel Vetter
We probably should nuke a bunch of the local_ defines again ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-07-27lib: Update igt_chipset docsDaniel Vetter
gtkdoc can't handle aliasing, so let's rename the intel_device_info function. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-07-27docs: pull in VC4 docsDaniel Vetter
We have them, let's use them. Cc: Eric Anholt <eric@anholt.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-07-27lib: Update igt_core docsDaniel Vetter
Just missing comment for igt_log_level. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-07-27lib: Update docs for igt_statsDaniel Vetter
Unfortunately gtkdoc refuses to acknowledge static inlines, so need to nuke them. It probably gets confused by that static ... Also unamed unions confuse gtk-doc, move everything else public up. Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-07-27lib: update docs for igt_pmDaniel Vetter
- Move all the pm helpers into igt_pm.c. No idea why that wasn't done in the original commit that created igt_pm.c. - Add missing docs where needed. Cc: David Weinehall <david.weinehall@intel.com> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-07-27lib: Update docs for igt_fbDaniel Vetter
- Again match names of paramaters - structs need a typedef to work in gtk-doc - gtk-doc doesn't know about unsigned, expects unsigned int instead Cc: Paulo Zanoni <paulo.r.zanoni@intel.com Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-07-27lib/debugs: nuke igt_crc_equal againDaniel Vetter
This was intentionally left out of the abi since CRC have fairly low entropy and can't be reliably compared for inequality in testcases. Spotted while fixing up warnigns in docs, but given that igt_assert_crc_equal has a big comment explaining why only the positive assert exists I'm not sure all those docs are all that useful :( Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: Matt Roper <matthew.d.roper@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-07-27lib: update docs for igt_debugfsDaniel Vetter
- gtk-doc requires that the names in comments match the ones in the header declaration. - igt_debugfs_dir works together with igt_sysfs_get(). Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-07-27lib: Update docs for igt_sysfs.cDaniel Vetter
Need to actually put it into the master .xml. Also rename the parameter names in the source with the ones in the header files to avoid confusion. gtkdoc requires that the names in the comment matches with the header. Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-07-27lib/igt_kms: Add some more documentation to some common kms functions.Maarten Lankhorst
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>