From 9e7e7c38a0fe48a64eb946fd4449283e01039573 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 11 Apr 2016 09:17:33 +0100 Subject: [PATCH] igt/gem_concurrent_blit: Tweak num_buffers to just exceed target Remember that we allocate and use twice as many buffers as specified (we have a num_buffers array of src and dst) and so adjust the computation such that the combined allocation matches the target. Signed-off-by: Chris Wilson --- tests/gem_concurrent_all.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c index b4b1e9ad..ad4d4442 100644 --- a/tests/gem_concurrent_all.c +++ b/tests/gem_concurrent_all.c @@ -1609,14 +1609,13 @@ num_buffers(uint64_t max, unsigned allow_mem) { unsigned size = 4*s->width*s->height; - unsigned n; + uint64_t n; - if (max == 0) - n = MIN_BUFFERS; - else - n = max / size; + igt_assert(size); + n = max / (2*size); + n += MIN_BUFFERS; - igt_require(n); + igt_require(n < INT32_MAX); igt_require(set_max_map_count(2*n)); if (c->require)