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 <daniel.vetter@ffwll.ch>
This commit is contained in:
Daniel Vetter 2011-03-25 21:54:02 +01:00
parent 2aac22358f
commit bfa6f5d94f

View File

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