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>
This commit is contained in:
Chris Wilson 2016-04-11 09:17:33 +01:00
parent 4a3fa3532a
commit 9e7e7c38a0

View File

@ -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)