summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2016-11-29igt_aux: Add some list helpers from waylandLyude
Since we're going to be using lists for keeping track of EDIDs we've allocated on the chamelium, add some generic list helpers from the wayland project. Signed-off-by: Lyude <lyude@redhat.com> Changes since v1: - Rename list helpers to be more like those from the Linux kernel v2: Make the api compatible with the kernel as well.
2016-11-29lib: Make signal helper definitions reusableAbdiel Janulgue
Lots of test cases are re-declaring this. v2: Remove definition in benchmarks/gem_syslatency.c Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2016-11-27igt: Add kselftest runner for drm_mmChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-15lib: Add missing include for sync()Petri Latvala
Commit 721d8747e3a2 added sync() calls to igt_main and igt_simple_main, making self-tests fail to build. #including unistd.h in igt_core.h fixes that. Fixes: 721d8747e3a2 ("igt: Add a test for reordering execbufs") CC: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-11lib: substitute cxt BAN_PERIOD with BANNABLEMika Kuoppala
Context BAN_PERIOD will get depracated so subsitute it with BANNABLE property. Make ctx param test to accept both variants for now until kernel changes have landed, to not break BAT. v2: check against - EINVAL on get/set ban as it can return -EPERM v3: better naming for get/set (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2016-11-11lib: Pass I915_TILING_NONE if Yf or YsTomeu Vizoso
The kernel expects that BOs for framebuffers with I915_FORMAT_MOD_Yf_TILED will have I915_TILING_NONE. Fixes: 050c00d53f39 ("lib: Pass I915_TILING_Y to the kernel if Yf or Ys") Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-11-10lib: Pass I915_TILING_Y to the kernel if Yf or YsTomeu Vizoso
GEM_SET_TILING doesn't care about Yf or Ys, so just pass Y. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-11-10lib: Pass tiling constant where that's expectedTomeu Vizoso
We were passing in two places a framebuffer modifier constant instead of a tiling constant. Also adds igt_fb_mod_to_tiling so tests can do that by themselves. Cc: Tvrtko Ursulin <tursulin@ursulin.net> Fixes: 8a1a38661f56 ("lib: Add igt_create_bo_with_dimensions") Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-11-09lib: use the local intel_aub.h fileEmil Velikov
File is provided by the libdrm_intel package which is optional. Since we already have a local copy of the file, we might as well use it ;-) v2: Move the file alongside intel_bufmgr.h and use it in the disable-intel case. Cc: Brian Starkey <brian.starkey@arm.com> Reported-by: Brian Starkey <brian.starkey@arm.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Tested-by: Brian Starkey <brian.starkey@arm.com>
2016-11-09Revert "lib: use the local intel_aub.h file"Tomeu Vizoso
Emil prefers if the approach in v2 is used (it was sent around the time v1 had been applied). This reverts commit 438c8d7c688780337d271016d84a69aab0474097.
2016-11-07igt: Add a test for reordering execbufsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-27lib/drmtest: Test for equivalence with DRIVER_ANYTomeu Vizoso
Cc: Chris Wilson <chris@chris-wilson.co.uk> Fixes: 9921aff583ac ("lib/drmtest: Take DRIVER_ANY into account when opening the DRM device") Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-10-27lib: use the local intel_aub.h fileEmil Velikov
File is provided by the libdrm_intel package which is optional. Since we already have a local copy of the file, we might as well use it ;-) Cc: Brian Starkey <brian.starkey@arm.com> Reported-by: Brian Starkey <brian.starkey@arm.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-10-27lib/drmtest: Take DRIVER_ANY into account when opening the DRM deviceTomeu Vizoso
__drm_open_driver was changed to bail out on VGEM devices unless they are explicitly asked for (DRIVER_VGEM). But with that change we lost support for DRIVER_ANY. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Fixes: 7ce63894854d ("lib: Support opening vGEM device") Cc: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-19igt: Check the physical swizzle statusChris Wilson
The kernel tries to hide L-shaped memory with asymmetric swizzling from userspace by reporting lies through the get-tiling interface. Check for these lies by comparing the reported swizzle with the actual swizzle, and only run swizzling tests where we know the underlying physical swizzling. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>