From 459ff6b7e24dc0bda5d45b41afdf1fe9aaafc936 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 20 Apr 2016 07:49:02 +0100 Subject: [PATCH] igt/gem_concurrent_blit: Ensure we only shrink the child buffers As we reuse the parent arrays under the assumption that the child uses fewer buffers, make sure that is true. Signed-off-by: Chris Wilson --- tests/gem_concurrent_all.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c index ad4d4442..c0af60d4 100644 --- a/tests/gem_concurrent_all.c +++ b/tests/gem_concurrent_all.c @@ -1327,11 +1327,15 @@ static void __run_forked(struct buffers *buffers, buffers_reset(buffers, true); igt_fork(child, num_children) { + int num_buffers; + /* recreate process local variables */ fd = drm_open_driver(DRIVER_INTEL); - buffers->num_buffers /= num_children; - buffers->num_buffers += MIN_BUFFERS; + num_buffers = buffers->num_buffers / num_children; + num_buffers += MIN_BUFFERS; + if (num_buffers < buffers->num_buffers) + buffers->num_buffers = num_buffers; buffers_reset(buffers, true); buffers_create(buffers);