summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2020-07-02 13:32:34 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-07-02 18:46:01 +0100
commitdf9004c501b203c1b418781ad2c94dfe36892ef5 (patch)
treed507d50eb47a32080d1c94504a302ca1bb70b36b /tests
parentf35053d4b6d7bbcf6505ef67a8bd56acc7fb2eb2 (diff)
i915/perf: Instantiate a local drm_fd for the unprivileged helper
While the test is blocked, we keep trying the gen12_single_ctx_helper(). As this is using the parent's drm_fd, all of our context allocations are persistent. Reopen the device in the child so that when we exit, our allocations are freed along with the process -- avoiding a total memory leak if the test is stuck. This does not explain why the test was stuck, it just prevents us from exacerbating the error condition. Hopefully leaving the system in a more debuggable state. References: https://gitlab.freedesktop.org/drm/intel/-/issues/2126 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/i915/perf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/i915/perf.c b/tests/i915/perf.c
index d4ebae30d..92edc9f1f 100644
--- a/tests/i915/perf.c
+++ b/tests/i915/perf.c
@@ -4120,8 +4120,13 @@ gen12_test_single_ctx_render_target_writes_a_counter(void)
do {
igt_fork_helper(&child) {
+ /* A local device for local resources. */
+ drm_fd = gem_reopen_driver(drm_fd);
+
igt_drop_root();
gen12_single_ctx_helper();
+
+ close(drm_fd);
}
child_ret = igt_wait_helper(&child);
igt_assert(WEXITSTATUS(child_ret) == EAGAIN ||