summaryrefslogtreecommitdiff
path: root/lib/drmtest.h
AgeCommit message (Collapse)Author
2013-11-01lib: make igt_set_vt_graphics_mode never failDaniel Vetter
All tests agree that this is a letal failure, so no point to pass it back to callers. Also add some igt_require calls for the drm_fd where I've noticed that it's missing. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-28lib: Add a drm_open_any_render() that will try to use render nodesDamien Lespiau
I was fedup with having to run my tests as root and not being able to use my usual setup for tests that only exercise the GT part of the GPU. Render nodes to the rescue! Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-10-21lib/drmtest: Add kmstest_paint_color_alpha()Ville Syrjälä
kmstest_paint_color_alpha() just like kmstest_paint_color() except you also get to specify the alpha channel. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2013-10-18rendercopy: Add a way to dump an .aub file with the rendercopy bosDamien Lespiau
v2 (by Ben): Remove libdrm dependency since intel-gpu-tools now requires a higher version anyway. Remove associated #ifdef ENABLE_AUB_DUMP Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
2013-10-15lib: Add kmstest_paint_color()Damien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-10-15lib: Add a igt_assert_cmpint()Damien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-10-10tests/gem_suspend: test debugfs/sysfs reads while s/rDaniel Vetter
Just a very quick hack cobbled together with /bin/sh and exec. We can't use system since that does stupid things with singals ... Still we need to whack the child process pretty hard to get rid of it. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-10-09lib/drmtest: extract rawer __gem_set_tilingDaniel Vetter
For tests that expect failures. Also apply the existing gem_set_tiling helper a bit wider. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-30testdisplay: Use DRM_MODE_FLAG_3D_MASKDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30lib: Add a helper to write a png from a struct kmstest_fbDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30lib: Add a helper to paint a PNG using cairoDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-30lib: Dump information about the supported 3D stereo formatsDamien Lespiau
When dumping the details of a mode, let's add the 3D formats the mode supports. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-09-19lib/drmtest: igt_assert|require with format stringsDaniel Vetter
v2: Add a comment about the pitfalls around va_list handling. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-10lib/drmtest: consolidate the helper process killing in one exit handlerDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-10lib/drmtest: create helpers for forking helper threadsDaniel Vetter
The upshot is that we can share the logic to make sure the helpers are all properly stoved again in a 2nd step. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-04lib/drmtest: add igt_skip_on macroDaniel Vetter
I've fumbled the logic inversion when converting to igt_require way too often, so lets add something for dummies like me ;-) 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: include sys/mman.h from drmtest.hDaniel Vetter
We need it for mmapping to get at PROT_READ|WRITE anyway. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03lib/drmtest: extract gem_execbuf helperDaniel 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: 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-19overlay: Auatomatically mount debugfsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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: 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: 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-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-15lib/drmtest: Use igt_assert in the do_ioctl/do_or_die helpersDaniel Vetter
abort results in "crash" test results in the piglit runner, igt gives us neater output. The downside is that we can now only use these in igt tests, but that's already the case (and given their placement in drmtest.h their intended use-case, too). Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14lib/drmtest: documentation for igt_fixtureDaniel Vetter
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-14tests: Introduce igt_fixtureDaniel Vetter
Just a tiny wrapper to protect global test setup/teardown code when just listing subtests. Rolling this out over all tests with subtests should allow us to generate the testlist with piglit as an unpriviledged user on a non-intel system. The aim here is to make our QA team happy who currently suffers from this. Even more so for the prime tests since you need a system with intel _and_ nouveau gpus to just be able to list tests. Exemplary conversion with gem_concurrent_blt.c Fixture is the same name other test suites like googletest use for setup/teardown code used by multiple tests. 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-14tests: add igt_subtest_f for snprintf'ing testnamesDaniel Vetter
Useful when stitching together combinatorial testnames. v2: - ## rules are just fun. We need 2 indirections to actually get __LINE__ to properly expand. - Kill stray ; which botched the logic. 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: 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-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-12s/drmtest_subtest_block/drmtest_subtest/Daniel Vetter
The _block postfix meant to convey that a C statement/block must follow can be misread as the verb to block. So drop it. 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 to check for ringsDaniel Vetter
To simplify things add a set of gem_check_<ring> functions which take care of this. Since I've opted for static inlines drmtest.h grew a few more header includes which was a neat opportunity to dump a few redundant #defines. This kills all the skipped_all hand-rolled logic we have. 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: 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-12lib/drmtest: Add drmtest_subtest_block macroDaniel Vetter
Doesn't do more than an if (drmtest_run_test(name)) right now, but as soon as we get a bit of infrastructure to handle test failures and skipping, this will get more interesting. 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-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>