lib/drmtest: extract igt_fork from gem_concurrent_blt
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 29 Aug 2013 08:06:51 +0000 (10:06 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 29 Aug 2013 16:18:33 +0000 (18:18 +0200)
commitcd1f220847c34610ab9e07c3cf1c5a7e77284eb8
tree8c3f54af9c7b7303d03157f26c4c51413224394c
parent90a25055e3ec7d9779663bec9cbae93187671bfd
lib/drmtest: extract igt_fork from gem_concurrent_blt

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>
lib/drmtest.c
lib/drmtest.h
tests/gem_concurrent_blit.c