From a1b47ef6ae6b92be4de0cf87f1ad2ee84029f8b7 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 27 Jan 2016 19:44:16 +0000 Subject: [PATCH] igt/gem_concurrent_blit: Disable libdrm buffer cache for child inheritance It just ends up with buffer leaks all over. On the flip side, it does allow us to inherit the bufmgr directly without worry of stomping over the aliased entries (and causing double closes). Signed-off-by: Chris Wilson --- tests/gem_concurrent_all.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c index ef8ac491..9b7ef870 100644 --- a/tests/gem_concurrent_all.c +++ b/tests/gem_concurrent_all.c @@ -568,7 +568,7 @@ igt_render_copyfunc_t rendercopy; static void *buffers_init(struct buffers *data, const struct access_mode *mode, int width, int height, - int _fd) + int _fd, int enable_reuse) { data->mode = mode; data->count = 0; @@ -586,7 +586,8 @@ static void *buffers_init(struct buffers *data, igt_assert(data->src); data->dst = data->src + num_buffers; - drm_intel_bufmgr_gem_enable_reuse(data->bufmgr); + if (enable_reuse) + drm_intel_bufmgr_gem_enable_reuse(data->bufmgr); return intel_batchbuffer_alloc(data->bufmgr, devid); } @@ -1124,16 +1125,8 @@ static void run_child(struct buffers *buffers, * needs to be local as the cache of reusable itself will be COWed, * leading to the child closing an object without the parent knowing. */ - igt_fork(child, 1) { - buffers->bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); - drm_intel_bufmgr_gem_enable_reuse(buffers->bufmgr); - batch = intel_batchbuffer_alloc(buffers->bufmgr, devid); - + igt_fork(child, 1) do_test_func(buffers, do_copy_func, do_hang_func); - - intel_batchbuffer_free(batch); - drm_intel_bufmgr_destroy(buffers->bufmgr); - } igt_waitchildren(); igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); } @@ -1157,7 +1150,7 @@ static void __run_forked(struct buffers *buffers, batch = buffers_init(buffers, buffers->mode, buffers->width, buffers->height, - fd); + fd, true); buffers_create(buffers, num_buffers); for (pass = 0; pass < loops; pass++) @@ -1271,7 +1264,8 @@ run_basic_modes(const char *prefix, igt_fixture batch = buffers_init(&buffers, mode, - 512, 512, fd); + 512, 512, fd, + run_wrap_func != run_child); igt_subtest_f("%s-%s-%s-sanitycheck0%s%s", prefix, mode->name, p->prefix, suffix, h->suffix) { p->require();