diff --git a/tests/gem_linear_blits.c b/tests/gem_linear_blits.c index fe15f1d1..ec2dc56d 100644 --- a/tests/gem_linear_blits.c +++ b/tests/gem_linear_blits.c @@ -189,6 +189,10 @@ int main(int argc, char **argv) count = atoi(argv[1]); if (count == 0) count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; + else if (count < 2) { + fprintf(stderr, "count must be >= 2\n"); + return 1; + } if (count > intel_get_total_ram_mb() * 9 / 10) { count = intel_get_total_ram_mb() * 9 / 10; diff --git a/tests/gem_render_linear_blits.c b/tests/gem_render_linear_blits.c index 8ba24a3d..a7e01893 100644 --- a/tests/gem_render_linear_blits.c +++ b/tests/gem_render_linear_blits.c @@ -85,6 +85,11 @@ int main(int argc, char **argv) count = atoi(argv[1]); if (count == 0) count = 3 * gem_aperture_size(fd) / SIZE / 2; + else if (count < 2) { + fprintf(stderr, "count must be >= 2\n"); + return 1; + } + printf("Using %d 1MiB buffers\n", count); bo = malloc(sizeof(*bo)*count); diff --git a/tests/gem_render_tiled_blits.c b/tests/gem_render_tiled_blits.c index 31b2ee18..626e652e 100644 --- a/tests/gem_render_tiled_blits.c +++ b/tests/gem_render_tiled_blits.c @@ -88,6 +88,11 @@ int main(int argc, char **argv) count = atoi(argv[1]); if (count == 0) count = 3 * gem_aperture_size(fd) / SIZE / 2; + else if (count < 2) { + fprintf(stderr, "count must be >= 2\n"); + return 1; + } + printf("Using %d 1MiB buffers\n", count); buf = malloc(sizeof(*buf)*count); diff --git a/tests/gem_tiled_blits.c b/tests/gem_tiled_blits.c index a6d5555f..bb439760 100644 --- a/tests/gem_tiled_blits.c +++ b/tests/gem_tiled_blits.c @@ -132,6 +132,9 @@ int main(int argc, char **argv) if (count == 0) { count = 3 * gem_aperture_size(fd) / (1024*1024) / 2; count += (count & 1) == 0; + } else if (count < 2) { + fprintf(stderr, "count must be >= 2\n"); + return 1; } if (count > intel_get_total_ram_mb() * 9 / 10) {