summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)