From bfa6f5d94ffccfe00a6232e5adaf61d60c7cdde2 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Fri, 25 Mar 2011 21:54:02 +0100 Subject: [PATCH] gem_stress: limit gtt_size to 256 gem_stress maps all buffers, so more only results in trashing (which should be handled with an option). Signed-off-by: Daniel Vetter --- tests/gem_stress.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/gem_stress.c b/tests/gem_stress.c index 62e91c0e..5aa6def8 100644 --- a/tests/gem_stress.c +++ b/tests/gem_stress.c @@ -548,9 +548,12 @@ int main(int argc, char **argv) { int i, j; unsigned *current_permutation, *tmp_permutation; + unsigned tmp; drm_fd = drm_open_any(); - num_buffers = 2 * gem_aperture_size(drm_fd) / (1024*1024) / 3; + tmp = gem_aperture_size(drm_fd) / (1024*1024);; + tmp = tmp > 256 ? 256 : tmp; + num_buffers = 2 * tmp / 3; num_buffers /= 2; printf("Using %d 1MiB buffers\n", num_buffers);