summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-08-22igt/shell: Add console.{log,error} and modernize/prettier.io samples.v8-shellJoonas Lahtinen9-30/+147
2018-08-22igt/shell: Flesh out the os.fork() interfaceChris Wilson6-0/+309
2018-08-22igt/shell: Wrap ioctls on our fdChris Wilson1-0/+83
2018-08-22igt/shell: First attempt at instantiating an object to wrap OSChris Wilson5-0/+218
2018-08-22igt/shell: Move the shell globals into the igt.toy namespaceChris Wilson4-88/+210
2018-08-22igt/shell: Minimal igt stub interfaceChris Wilson3-1/+101
2018-08-22igt/shell: Bare v8 baselineChris Wilson25-1/+14785
2018-08-21tests/kms_cursor_crc: Open DRM device with DRIVER_ANYHaneen Mohammed1-10/+21
So that this test can be run in drivers other than i915. Remove devid and only check it if the driver is i915. Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2018-08-20pm_rpm: Require DMC loaded before testing runtime_pm for gen9+Rodrigo Vivi1-0/+16
Since we block runtime PM if DMC is not loaded, let's skip the test. v2: Use i915_dmc_info presence to detect dmc requirement instead of gen check as Chris suggested. v3: Add missing \0 before using buf. (Chris) v4: read only 14 bytes [0:13] so buf[len] is the 15th position. Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Imre Deak <imre.deak@intel.com> Cc: Anusha Srivatsa <anusha.srivatsa@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-08-17lib: Poll for snd_hda_intel discoveryChris Wilson1-24/+43
Loading the sounds modules is asynchronous with the sysfs device hierarchy being instantiated sometime after modprobe returns. As such while we are probing for the sound device, poll a few times to accommodate the async discovery. v2: closedir() after use Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Imre Deak <imre.deak@intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com>
2018-08-17runner/resultgen: Implement the totals fieldPetri Latvala1-4/+86
The totals field in the results json lists the total amount of particular test results, both overall and by binary. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-08-17runner/resultgen: Be more robust with incomplete testsPetri Latvala1-13/+38
If a test is incomplete and didn't have time to print that it's entering a subtest, the generated results will think the test binary does not have subtests. If that case is known, make sure to attribute blame correctly. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-08-16igt/pm_rpm: Skip counting modes if modprobed with disable_displayChris Wilson1-6/+4
If we've explicitly disabled the display, we will never find any connected outputs or modes. Checking for them will fail and report the missing requirement instead. v2: Sigh, avoid more comparisons against enabled displays v3: Try occasionally compiling patches Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Imre Deak <imre.deak@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com>
2018-08-16runner: Match the piglit name with -t and -x optionsPetri Latvala2-2/+11
Instead of just matching the binary/subtest name. Originally not implemented to get the runner landed faster. Turned out to be simple enough. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-08-16Revert "lib: Keep upto half of RAM reserved for test runner"Chris Wilson1-5/+2
This reverts commit 2c7224e488457afb7bb76664c4b7c857baef1e08 as it was accidentally pushed when fixing up the pm_rpm compilation. Oops. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Petri Latvala <petri.latvala@intel.com>
2018-08-16igt/pm_rpm: Include igt_device.hChris Wilson1-0/+1
../tests/pm_rpm.c: In function ‘setup_environment’: ../tests/pm_rpm.c:702:2: warning: implicit declaration of function ‘igt_device_set_master’; did you mean ‘pci_device_cfg_write’? [-Wimplicit-function-declaration] igt_device_set_master(drm_fd); Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Imre Deak <imre.deak@intel.com>
2018-08-16lib: Keep upto half of RAM reserved for test runnerChris Wilson1-2/+5
Halve our estimated available RAM for use by the tests to avoid nasty situations where the test runner may force us into swap. Rumour has it that the new runner isn't quite so bloated as piglit... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com> Cc: Petri Latvala <petri.latvala@intel.com>
2018-08-16intel-ci: Exclude pm_rpm module-reload from full testingChris Wilson1-0/+1
The pm_rpm module-reload exists to exercise a rpm wakeref leak, and affects the random selection of tests run after it. Similar to the normal module-reload tests, care must be taken in its execution to avoid causing spurious failures elsewhere. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Petri Latvala <petri.latvala@intel.com>
2018-08-16igt/pm_rpm: Avoid at_exit_drm_fdChris Wilson1-1/+4
Keep the drm_fd owned by pm_rpm as we need to relinquish all ownership of the device in order to unload the module. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Imre Deak <imre.deak@intel.com>
2018-08-16igt/pm_rpm: Close local fd before trying to unload moduleChris Wilson1-9/+11
Make sure everything we open in setup_environment() is paired to teardown_environment(). Fixes: d8e78990aa2b ("igt/pm_rpm: Test reaquisition of runtime-pm after module reload") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Imre Deak <imre.deak@intel.com>
2018-08-15igt/gem_ctx_switch: Show the combined ctx-switch latencyChris Wilson1-0/+27
Since we submit from several processes to the same engine for the forked tests, the total number of context switches is the sum of each process and needs to be combined together to compute the individual cs latency. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-08-15docs: fix typo sharding->sharingLucas De Marchi1-1/+1
I was grepping for shard as the tests run on CI, but the only occurrence was this one which seems to be a typo since it's about prime tests. Fixes: 76bce773 ("docs: Update documentation generation with missing entries") Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2018-08-14lib: sync with the newer i915_pciids.h from the kernel (CFL)Rodrigo Vivi1-0/+1
One more CFL ID added to spec. Align with kernel commit d0e062ebb3a4 ("drm/i915/cfl: Add a new CFL PCI ID.") v2: Fixed commit subject per Petri request. Cc: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2018-08-14igt/pm_rpm: Test reaquisition of runtime-pm after module reloadChris Wilson2-0/+23
It doesn't work right now and desperately needs to be fixed... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Imre Deak <imre.deak@intel.com>
2018-08-14igt/pm_rpm: Test incomplete(debug) suspends vs rpmChris Wilson1-8/+25
Check that we restore runtime pm around debug suspends and hibernates. v2: Differentiate between external test setup failure and one of interest v3: Keep basic-rte failing instead of skipping. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Imre Deak <imre.deak@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com>
2018-08-14tests: Replace calls to igt_pipe_crc_drain + get_single with ↵Maarten Lankhorst6-27/+13
igt_pipe_crc_get_current() This is a more race free of accomplishing the same. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-08-14lib/igt_debugfs: Add igt_pipe_crc_get_current() to get a crc.Maarten Lankhorst2-1/+33
A pair of igt_pipe_crc_drain() and igt_pipe_crc_get_single() has a bug in which you're not sure whether the new CRC is captured because the vblank irq may race against the CRC irq and delivered to userspace too soon. When receiving a vblank event, igt_pipe_crc_drain() will then drain all crc's, but not the new (stale) crc, which is then delivered and immediately returned by igt_pipe_crc_get_single(). Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-08-14lib/igt_debugfs: explicitly wait for first crc in igt_pipe_crc_startMahesh Kumar1-2/+9
Now crc framework does not wait for first CRC during open, User need to wait for crc if he wants so. This patch make changes in igt_pipe_crc_start to make sure we wait until first crc available after open to keep the tests behaviour same. Without this if driver is skipping few initial crcs there will be mismatch in expected and actual number of crcs returned by crc framework. Changes Since V1: - poll instead of read_one_crc (Maarten) Changes Since V2: - poll without timeout, we already have igt_timeout (Maarten) Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-08-13runner/meson: Add support for use_rpath optionArkadiusz Hiler1-0/+3
Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2018-08-13meson: Define all the rpath_dirs in one placeArkadiusz Hiler4-74/+44
So they are located close to the definitions of the corresponding install_dirs and can be reused easily. Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2018-08-13runner: Fix path handlingArkadiusz Hiler2-35/+34
absolute_path() tends to return NULL if more than the last element of the path is nonexistent. That behavior is confusing the callers, which use NULL as a convention for something not being set at all. Let's fix that by sprinkling a little bit of recursion onto absolute_path() and wrapping POSIX in some sanity. Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2018-08-10intel-ci: Skip module reloadsChris Wilson1-0/+9
Reloading the module may impact subsequent tests by destabilising the system. As we do for BAT, if we want to test reloads, it should be handled explicitly at the end of the run, rather than placed at random in the middle of the test list. v2: Commentary References: https://bugs.freedesktop.org/show_bug.cgi?id=106539 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2018-08-10intel-ci: Comment on kernel selftest exclusionChris Wilson1-1/+4
The kernel selftests are excluded from the shard lists as those lists are compiled separately. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Petri Latvala <petri.latvala@intel.com>
2018-08-10tests/kms_force_connector_basic: Verify planes are restored after load ↵Maarten Lankhorst1-0/+61
detection, v2. There's a bug in our load detection in which we don't correctly restore planes to their previous states. Strictly verify this is the case by setting a fb on all planes. Changes since v1: - Remove igt_assert(found) in verification, would always fail. Cc: Ville Syrjala <ville.syrjala@linux.intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-08-09runner: Unit tests for the runnerPetri Latvala10-0/+1070
TODO: Unit tests for the results.json file contents. v2: - Avoid writing the nul character to mock files - Properly set up tmpdirs v3: - Restore the resume-related changes that were lost in rebase v4: - Better teardown for temporary directories - Build with autotools Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-08-09runner: New test runnerPetri Latvala19-0/+3449
This is a new test runner to replace piglit. Piglit has been very useful as a test runner, but certain improvements have been very difficult if possible at all in a generic test running framework. Important improvements over piglit: - Faster to launch. Being able to make assumptions about what we're executing makes it possible to save significant amounts of time. For example, a testlist file's line "igt@somebinary@somesubtest" already has all the information we need to construct the correct command line to execute that particular subtest, instead of listing all subtests of all test binaries and mapping them to command lines. Same goes for the regexp filters command line flags -t and -x; If we use -x somebinaryname, we don't need to list subtests from somebinaryname, we already know none of them will get executed. - Logs of incomplete tests. Piglit collects test output to memory and dumps them to a file when the test is complete. The new runner writes all output to disk immediately. - Ability to execute multiple subtests in one binary execution. This was possible with piglit, but its semantics made it very hard to implement in practice. For example, having a testlist file not only selected a subset of tests to run, but also mandated that they be executed in the same order. - Flexible timeout support. Instead of mandating a time tests cannot exceed, the new runner has a timeout on inactivity. Activity is any output on the test's stdout or stderr, or kernel activity via /dev/kmsg. The runner is fairly piglit compatible. The command line is very similar, with a few additions. IGT_TEST_ROOT environment flag is still supported, but can also be set via command line (in place of igt.py in piglit command line). The results are a set of log files, processed into a piglit-compatible results.json file (BZ2 compression TODO). There are some new fields in the json for extra information: - "igt-version" contains the IGT version line. In multiple-subtests-mode the version information is only printed once, so it needs to be duplicated to all subtest results this way. - "dmesg-warnings" contains the dmesg lines that triggered a dmesg-warn/dmesg-fail state. - Runtime information will be different. Piglit takes a timestamp at the beginning and at the end of execution for runtime. The new runner uses the subtest output text. The binary execution time will also be included; The key "igt@somebinary" will have the runtime of the binary "somebinary", whereas "igt@somebinary@a" etc will have the runtime of the subtests. Substracting the subtest runtimes from the binary runtime yields the total time spent doing setup in igt_fixture blocks. v2: - use clock handling from igt_core instead of copypaste - install results binary - less magic numbers - scanf doesn't give empty strings after all - use designated array initialization with _F_JOURNAL and pals - add more comments to dump_dmesg - use signal in kill_child instead of bool - use more 'usual' return values for execute_entry - use signal number instead of magic integers - use IGT_EXIT_INVALID instead of magic 79 - properly remove files in clear_test_result_directory() - remove magic numbers - warn if results directory contains extra files - fix naming in matches_any - construct command line in a cleaner way in add_subtests() - clarify error in filtered_job_list - replace single string fprintfs with fputs - use getline() more sanely - refactor string constants to a shared header - explain non-nul-terminated string handling in resultgen - saner line parsing - rename gen_igt_name to generate_piglit_name - clean up parse_result_string - explain what we're parsing in resultgen - explain the runtime accumulation in add_runtime - refactor result overriding - stop passing needle sizes to find_line functions - refactor stdout/stderr parsing - fix regex whitelist compiling - add TODO for suppressions.txt - refactor dmesg parsing - fill_from_journal returns void - explain missing result fields with TODO comments - log_level parsing with typeof - pass stdout/stderr to usage() instead of a bool - fix absolute_path overflow - refactor settings serialization - remove maybe_strdup function - refactor job list serialization - refactor resuming, add new resume binary - catch mmap failure correctly v3: - rename runner to igt_runner, etc - add meson option for building the runner - use UPPER_CASE names for string constants - add TODO comments for future refactoring - add a midding close() - const correctness where applicable - also build with autotools Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-08-09uwildmat: Case-insensitive test selectionPetri Latvala1-3/+8
Since we only use plain ascii in subtest names, using non-locale-aware tolower() to compare case-insensitively works. Doing this within uwildmat instead of tolowering the subtest name and then calling uwildmat() is required, because of selection strings like: foo,bar,!Foo The above line will select subtest Bar, and not select Foo. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-08-09lib: Export igt_gettime and igt_time_elapsedPetri Latvala2-12/+31
Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-08-09lib: Print subtest starting/ending line to stderr tooPetri Latvala1-1/+16
when instructed via the environment. This is needed for the new test runner to properly assign stderr output to the correct subtest. v2: Print the subtest result from skip_subtests_henceforth handling also to stderr. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-08-08igt/amd_prime: Link an amdgpu bo into i915 and try to shrink itChris Wilson1-0/+32
Create and export an amdgpu bo into i915 so that we can try and invalidate the i915_bo->pages from inside the shrinker, teaching lockdep about that linkage. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Daniel Vetter <daniel@ffwll.ch> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
2018-08-08igt/prime_vgem: Ask the shrinker to purge a vgem bo from inside i915Chris Wilson1-0/+29
Link a vgem dmabuf into an i915 bo and then ask the i915 shrinker to purge/invalidate its pages. This should establish the lockdep link from the fs_reclaim shrinker section to whatever locks are used to acquire/release dmabuf mappings; if any are required ofc. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Daniel Vetter <daniel@ffwll.ch> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
2018-08-08igt/gem_eio: Preserve batch between reset-stress iterationsChris Wilson1-13/+17
We can keep the original batch around and avoid recreating it between reset iterations to focus on the impact of resets. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
2018-08-08meson: Downgrade meson version requirement a notchPetri Latvala1-1/+1
0.44.0 is a fine version. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
2018-08-08igt/gem_eio: Apply reset-stress to each engineChris Wilson1-7/+17
A simple question as to whether the error only occurs on rcs/hsw, or all. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
2018-08-03igt/gem_eio: Measure reset delay from threadChris Wilson1-21/+24
We assert that we complete a wedge within 250ms. However, when we use a thread to delay the wedging until after we start waiting, that thread itself is delayed longer than our wait timeout. This results in a false positive error where we fail the test before we even trigger the reset. Reorder the test so that we only ever measure the delay from triggering the reset until we wakeup, and assert that is in a timely fashion (less than 250ms). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105954 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-08-02kms_pipe_crc_basic: Skip when hitting -EIOMaarten Lankhorst1-1/+3
-EIO is returned when the crtc is not active, in which case we skip the test because the parsing of the parameter in crtc-0/crc/control is not done. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reported-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-08-02tests/kms_pipe_crc_basic: expect setting bad source to fail, v2.Mahesh Kumar1-2/+5
Now crc-core framework verifies the source string passed by the user. So setting bad-source will fail. Expect file write to fail in bad-source subtest of kms_pipe_crc_basic. Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> #v1 Changes since v1: - Allow bad-source to succeed with current and future behavior. (mlankhorst) - Test that errno is set to EINVAL. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> [mlankhorst: Modified test to work with both behaviors, as long as errno is set to EINVAL] Reviewed-by: Mahesh Kumar <mahesh1.kumar@intel.com>
2018-08-02trace.pl: Bring back timeline stackingTvrtko Ursulin1-0/+7
Bring back the button which expands/stacks overlapping timeline boxes. We default to no stacking, but sometimes expanding the view can be useful, especially with deep request pipelines. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
2018-08-02tests/perf_pmu: Restore runtime PM status at rc6 test exitTvrtko Ursulin1-0/+3
Avoid running subsequent subtests in non-default setup by restoring the runtime PM config in one particular subtest. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-08-02lib/igt_pm: Export function to restore runtime PM statusTvrtko Ursulin2-0/+42
In cases when runtime PM is enabled only from individual subtests and not whole tests it is usable to be able to restore the old runtime PM config and so avoid running subsequent subtests in an unexpected environment. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>