diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-04-20 07:49:02 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-04-20 07:50:18 +0100 |
commit | 459ff6b7e24dc0bda5d45b41afdf1fe9aaafc936 (patch) | |
tree | 53ed67b019cea849599c0d3f0885c782ca595161 /tests/gem_concurrent_all.c | |
parent | 87acd98a2c89f058719332dd18e6824bc7e64580 (diff) |
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 <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_concurrent_all.c')
-rw-r--r-- | tests/gem_concurrent_all.c | 8 |
1 files 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); |