Invoking say,
sudo ./tests/gem_render_linear_blits 1
does not make a lot of sense as we're creating a single bo. The test
does not yell at you and passes, even if the rendercopy function does
not do anything. This makes it quite harmful when trying to debug
rendercopy without realizing that count is the number of allocated bos
and must be >= 2.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
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;
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);
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);
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) {