mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-23 06:13:04 +00:00
tests/gem_*_blits: reduce buffer count to not trash swap
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
@@ -248,6 +248,13 @@ int main(int argc, char **argv)
|
||||
count = atoi(argv[1]);
|
||||
if (count == 0)
|
||||
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;
|
||||
}
|
||||
|
||||
printf("Using %d 1MiB buffers\n", count);
|
||||
|
||||
handle = malloc(sizeof(uint32_t)*count*2);
|
||||
|
||||
Reference in New Issue
Block a user