summaryrefslogtreecommitdiff
path: root/lib/drmtest.c
AgeCommit message (Collapse)Author
2013-09-08lib/drmtest: fixup for the prefault reworkDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-08lib/drmtest: Avoid calling exit handlers multiple timesDaniel Vetter
- reset the count when forking - don't add the same handler multiple times - don't restore the exit signal handlers in the forked helper process - reset the exit handler count once called to make sure we don't call it multiple times when dying - don't wait for the signal helper if it's gone already Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03lib/drmtest: use igt_require/assert in the prefault helpersDaniel Vetter
2013-09-03lib/drmtest: extract gem_execbuf helperDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-02lib/drmtest: Improve output when igt_waitchildren failsDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-29lib/drmtest: Print info when children died due to signalsDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-29lib/drmtest: extract igt_fork from gem_concurrent_bltDaniel Vetter
Making sure that we correctly collect the exit codes from all children is a bit a hassle. So add another magic igt codeblock for easy forking and joining. Note that children are (currently at least) not allowed to call igt_skip. Add an assert to enforce this. v2: - Properly propagate the exit code. - Fix the segfault. - Add a child int and num_children paramter to the magic codeblock as suggested by Chris Wilson. - Don't dump noise into stdout when a child thread fails, the parent will do that for us already. v3: Now with some docs. v4: Fixup igt_waitchildren to properly reset state so it can be used again. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-29kms_flip: Exercise flip-vs-renderChris Wilson
For machine with split BCS/RCS rings, we also need to test whether we correctly wait upon outstanding render work before flipping and changing modes. This should also serve to exercise the ring selection code for flips. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-26lib/drmtest: restore in_fixture assertDaniel Vetter
I didn't really want to revert those, too ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-26Revert "tests/gem_concurrent_blit: Fix segmentation fault"Daniel Vetter
This reverts commit 912a7d855600aadb937517ec5bab26bfd9b8953d. Now fixed for real! Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-26lib/drmtest: don't complete fixtures with a longjmpDaniel Vetter
Longjmp creates havoc with stack variables of the current stackframe. And since fixtures should be used to set up such variables creating havoc isn't a great idea. With this I can revert a bunch of bogus patches I've done to paper over this by moving stack variables to be global. The same issue is actually a feature for subtest blocks since subtests should be independant anyway. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-26tests/kms_setmode: don't save/restore vt graphics for dry-runImre Deak
Signed-off-by: Imre Deak <imre.deak@intel.com>
2013-08-26lib/drmtest: fix handling of -h --help argument parsingImre Deak
So far we handled -h or --help arguments properly only if the test called igt_subtest_init_parse_opts(). Fix this for igt_subtest_init() callers too. Make sure we still don't exit for any other unknown options, which the caller may parse with a second getopt scan. Signed-off-by: Imre Deak <imre.deak@intel.com>
2013-08-21lib/drmtest: fix logic fumble in gem_context_createDaniel Vetter
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68363 Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-20lib: Make igt_assert() abort under gdbChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-20tests/gem_concurrent_blit: Fix segmentation faultDaniel Vetter
Apparently the simple changes introduced in commit 78865847f9fae7e590960f9836f2ec8b611a190e Author: Daniel Vetter <daniel.vetter@ffwll.ch> AuthorDate: Mon Aug 19 07:23:49 2013 +0200 Commit: Daniel Vetter <daniel.vetter@ffwll.ch> CommitDate: Mon Aug 19 08:09:25 2013 +0200 lib/drmtest: skip fixtures after an igt_skip pushed the stack space requirement for run_modes over some magic limit (I guess where the strack grow logic starts to fail, but I didn't check). Fix this by moving the data into .bss. Also add some asserts to check that fixtures aren't abused while at it (i.e. the useful parts of my debug printf/assert craze). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68299 Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-19lib: add subtest extra command line option handlingImre Deak
At the moment any command line option handling done by tests will interfere with the option handling of the subtest interface. To fix this add a new version of the subtest_init function accepting optional short and long command line options. Merge these together with the subtest interface's own long options and handle both together in the same getopt_long call. Signed-off-by: Imre Deak <imre.deak@intel.com>
2013-08-19lib: handle SIGSEGV similarly to other error signalsImre Deak
Signed-off-by: Imre Deak <imre.deak@intel.com>
2013-08-19lib: shorten DP/eDP connector namesImre Deak
Signed-off-by: Imre Deak <imre.deak@intel.com>
2013-08-19lib: export kmstest_get_connector_default_modeImre Deak
Signed-off-by: Imre Deak <imre.deak@intel.com>
2013-08-19lib/drmtest: igt_skip when drm_get_card failsDaniel Vetter
Also add printf support to igt_skip to make sure there's always a reason why we fail a testcase. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-19lib/drmtest: extract gem_create_contextDaniel Vetter
libdrm requirements are now up to it. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-19lib/drmtest: rip out drm_open_any_masterDaniel Vetter
It's unused. Also most of our tests failed to ask for the right type of drm fd anyway. So it's imo better to just let them fall over when they don't get master but want it, like they already do today. This also allows us to garbage-collect the master parameter to drm_get_card and associated code. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-19lib/drmtest: Properly skip if no intel gfx supportedDaniel Vetter
drm/* kernel test nirvana! Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-19lib/drmtest: make igt_fail work outside of subtestsDaniel Vetter
With the abortable fixtures we can now correctly fail all subsequent sutbests if we hit upon an igt_assert outside of a subtest. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-19lib/drmtest: skip fixtures after an igt_skipDaniel Vetter
This way we can just enclose all igt_skip/igt_require calls into fixtures even when we have subtests, and still output correct SKIP message for all of them. Wohoo, magic! The only thing which doesn't work yet is enumerating failed subtests, but I think that should work out on top of this. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-16drmtest: Squelch the rude interrupterChris Wilson
Stop printing the debugging information of how many times we emitted a signal.
2013-08-15tests/prime: test dma-buf llseek supportDaniel Vetter
This exercises a proposed patch from Christopher James Halse Rogers. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14lib/drmtest: fix subtest output when skipping all testsDaniel Vetter
(null) isn't too nice ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14lib/drmtest: add igt_subtest_name and use it in kms_flipDaniel Vetter
Useful when the testname is constructed with igt_subtest_f. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14lib/drmtest: sprinkle documentation over igt_skip|fail|success|exitDaniel Vetter
And make the behaviour of igt_exit() a bit saner. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14lib/drmtest: Don't spoil stdout when listing testsDaniel Vetter
Oops. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13lib/drmtest: Don't run the rude interruptor when just listing subtestsDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13tests: introduce igt_requireDaniel Vetter
Since igt_skip has funny control flow we can abuse it and make it work like a special kind of assert which automatically skips tests if a requirement fails. Note that in places where we have a less strict test which should always succeed (e.g. ioctl works or isn't available) the igt_assert should be place before the igt_require with the more strict requirements. Otherwise we'll skip a test instead of properly failing it. Convert a few users of igt_skip over to igt_require to showcase its use. v2: s/gem_check_/gem_require_/ so that we consistently use "require" to indicate magic check that can call igt_skip. Imo hiding the igt_require for feature checks is ok, but for more traditional assert like use cases an explicit igt_require might be better. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13lib/drmtest: roll out igt_assertDaniel Vetter
I've left the asserts as-is where they check for tests that use the infrastructure in drmtest.c incorrectly. That way piglit's differentiation between a failed testcase and a crashing testcase should be more useful. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13lib/drmtest: add igt_assert as a replacement for assertDaniel Vetter
The aim is that we keep on running subtests even when a not-too-lethal assert failed in a subtest. To make that useful also print per-subtest test results from igt_skip|fail|success functions. If required we can always go googletest-nuts with different types of asserts later on, but I think for now we're good with what we have here. v2: Also print out proper SKIP message when skipping all subsequent tests since a global (i.e. outside of a subtest) init step failed and resulted in an igt_skip call. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13lib/drmtest: fixup igt_fail for the list-only caseDaniel Vetter
Oops. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12tests: s/return igt_retval();/igt_exit();/Daniel Vetter
Requested-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12s/drmtest_/igt_/Daniel Vetter
Requested-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12lib/drmtest: __ prefix for drmtest_run_subtestDaniel Vetter
Now that callers must setup the longjmp target (we can't do that in run_subtest itself since that callframe won't survive) tests shouldn't call this function directly any more. Make this clear by adding a __ prefix. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12tests: use drmtest_skip() in caching ioctl helpersDaniel Vetter
This way we can rip out all the skip handling from the test control flow, and additionally (by using drmtest_retval()) even get correct exit codes. The only tricky part is that when we only want ot skip parts of a test (like for gem_pread and gem_pwrite) we need to split out those parts as subtests. But no addition of control-flow is required, the set/longjmp magic in the helpers all makes it happen. Also we make extensive use of the behaviour of drmtest_skip to skip all subsequent subtests if it is called outside of a subtest. This allows us to re-flatten the control flow a lot. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12lib/drmtest: make signal process cleanup more robustDaniel Vetter
If we skip a test and and fail somewhere the parent might die before the child. So add some cleanup to handle this case. Also make sure that the parent indeed waits for the child to die. This is required to make the latest version of the piglit runner happy, it tends to wait for all zombies to disappear. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12lib/drmtest: skip/fail handlingDaniel Vetter
Exitcode handling in igt testcases has too ugly facets in combination with subtests: - When individual subtest needed to be skipped for different reasons we need to painstakingly thread this information through the test to make sure that we still succeed if just one testcase worked (for running it with the simple automake test runner in igt). But it also needs to correctly report the skip exit value if only this one skipped testcase has been run (e.g. when run with piglit or in QA's test infrastructure). - We'd prefer to easily skip (and also fail) subtests without hampering other subtests. Again threading the return value of each subtest through the code is cumbersome. To simplify test case writing use longjmps to be able to get out of subcases easily. But since longjmps are funny things thug it all away into the newly added drmtest_subtest_block macro. Note that if drmtest_skip is called outside of a subtest, but in a testcase with subtests all subsequent subtests will be automatically skipped. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12tests: s/cacheing/cachingDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-10Expand gem_set_cacheing testing to handle the proposed DISPLAY domainChris Wilson
2013-08-06lib: Reset sig_stat after stopping the rude interrupterChris Wilson
2013-07-29lib: export drm_format_to_bppImre Deak
Needed by the next patch. Signed-off-by: Imre Deak <imre.deak@intel.com>
2013-07-23lib/drmtest: add gem_flink and gem_openDaniel Vetter
Requires us to rename a few things in the gem_flink test to avoid variable shadowing. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-23tests/gem_suspend: exercise fence restore codeDaniel Vetter
This exercise the bug fixed in commit 94a335dba34ff47cad3d6d0c29b452d43a1be3c8 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Wed Jul 17 14:51:28 2013 +0200 drm/i915: correctly restore fences with objects attached For fun I've also added a subtest for the inverse transition. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-19lib: Allow users of env_set() to specify a default valueDamien Lespiau
So when the environment value isn't set, one can specify the default value to return. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>