tests/gem_*_blits: reduce buffer count to not trash swap

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Daniel Vetter
2011-10-15 13:09:36 +02:00
parent 62c542fd4e
commit b75451838a
5 changed files with 37 additions and 0 deletions
+5
View File
@@ -148,6 +148,11 @@ int main(int argc, char **argv)
fd = drm_open_any();
count = 3 * gem_aperture_size(fd) / (1024*1024) / 2;
if (count > intel_get_total_ram_mb() * 9 / 10) {
count = intel_get_total_ram_mb() * 9 / 10;
fprintf(stderr, "not enough RAM to run test, reducing buffer count\n");
return 77;
}
count |= 1;
printf("Using %d 1MiB buffers\n", count);