diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-02-10 17:46:43 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-02-13 09:35:36 +0100 |
commit | 3cd45dec2e4be3edacdfc233089b6bd3651fa595 (patch) | |
tree | ae12a86adb402916187eca5bf4715d12546788a4 /lib/igt_aux.c | |
parent | 25c4347078f181a938eaaefbed7e2e27c9dc1a3f (diff) |
lib/igt_gt: Document and consolidate
Also move forcewake and stop_rings code from igt_debugfs to igt_gt
since it fits better. And move the hang injection fork helpers from
igt_aux to igt_gt, too.
Also push the intel_gen call into igt_hang_ring while at it.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'lib/igt_aux.c')
-rw-r--r-- | lib/igt_aux.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/lib/igt_aux.c b/lib/igt_aux.c index aefa0863..b31f0cdb 100644 --- a/lib/igt_aux.c +++ b/lib/igt_aux.c @@ -132,74 +132,6 @@ void igt_stop_signal_helper(void) sig_stat = 0; } -/* GPU abusers */ -static struct igt_helper_process hang_helper; -static void __attribute__((noreturn)) -hang_helper_process(pid_t pid, int fd, int gen) -{ - while (1) { - if (kill(pid, 0)) /* Parent has died, so must we. */ - exit(0); - - igt_post_hang_ring(fd, - igt_hang_ring(fd, gen, I915_EXEC_DEFAULT)); - - sleep(1); - } -} - -/** - * igt_fork_hang_helper: - * - * Fork a child process using #igt_fork_helper to hang the default engine - * of the GPU at regular intervals. - * - * This is useful to exercise slow running code (such as aperture placement) - * which needs to be robust against a GPU reset. - * - * In tests with subtests this function can be called outside of failure - * catching code blocks like #igt_fixture or #igt_subtest. - */ -int igt_fork_hang_helper(void) -{ - int fd, gen; - - if (igt_only_list_subtests()) - return 1; - - fd = drm_open_any(); - if (fd == -1) - return 0; - - gen = intel_gen(intel_get_drm_devid(fd)); - if (gen < 5) { - close(fd); - return 0; - } - - igt_fork_helper(&hang_helper) - hang_helper_process(getppid(), fd, gen); - - close(fd); - return 1; -} - -/** - * igt_stop_hang_helper: - * - * Stops the child process spawned with igt_fork_hang_helper(). - * - * In tests with subtests this function can be called outside of failure - * catching code blocks like #igt_fixture or #igt_subtest. - */ -void igt_stop_hang_helper(void) -{ - if (igt_only_list_subtests()) - return; - - igt_stop_helper(&hang_helper); -} - /** * igt_check_boolean_env_var: * @env_var: environment variable name |