summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-04-11 09:17:33 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-04-11 09:17:33 +0100
commit9e7e7c38a0fe48a64eb946fd4449283e01039573 (patch)
tree12ef802b606430356f52a90d9e125d0e01123292
parent4a3fa3532a3d6605d0ce08b13b224bbf1807ee03 (diff)
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 <chris@chris-wilson.co.uk>
-rw-r--r--tests/gem_concurrent_all.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c
index b4b1e9ad4639..ad4d44425f43 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)