From patchwork Tue Feb 12 14:24:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Lespiau X-Patchwork-Id: 2128491 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id C29D33FCA4 for ; Tue, 12 Feb 2013 14:25:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A6A39E63EC for ; Tue, 12 Feb 2013 06:25:59 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by gabe.freedesktop.org (Postfix) with ESMTP id 0BCECE63D1 for ; Tue, 12 Feb 2013 06:24:48 -0800 (PST) Received: by mail-wg0-f44.google.com with SMTP id dr12so101892wgb.11 for ; Tue, 12 Feb 2013 06:24:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:date:message-id:x-mailer; bh=pRhzxNO6b/cuRfPvq0XJ76fnuADx+gsDBQj7jLLkMqE=; b=OoVEu8CfENWrlTF8NZ/Yqmicbdj1GL/XywO2ZbBsAOjr56fI9YyNmJgLeiyzsF0uWm uB0tD+ZyQamgddQ8gDhdkqhGIbRi39GS8oO83Nb+vvV23L4RTC860odZ+dNwkcKcS80x wz2nJr8d1q9UwnzEcJVHARFsFGO3CzSpVD0Zy2KJr3A/NjN/6AjKJg/quHBppzkwdIyA Z8qA0kB24oBJ+HVRE77/MRS4K2ejK9X02gmazL5BNGpW1JfJCDPbIyIEUEej3ZXVHWgO l7kFriH+06ddbwePZV4lcinOoRlw2expsX4E2B59jtytRKaQI2KbZ07fHFF21YkKtVvQ qneA== X-Received: by 10.194.76.237 with SMTP id n13mr31595309wjw.57.1360679088016; Tue, 12 Feb 2013 06:24:48 -0800 (PST) Received: from localhost.localdomain ([83.217.123.106]) by mx.google.com with ESMTPS id t7sm30126593wiy.2.2013.02.12.06.24.46 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 12 Feb 2013 06:24:46 -0800 (PST) From: Damien Lespiau To: intel-gfx@lists.freedesktop.org Date: Tue, 12 Feb 2013 14:24:40 +0000 Message-Id: <1360679080-2499-1-git-send-email-damien.lespiau@gmail.com> X-Mailer: git-send-email 1.7.11.7 Subject: [Intel-gfx] [PATCH i-g-t] tests: Forbid to run the blit tests with count of 1 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org From: Damien Lespiau 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 --- tests/gem_linear_blits.c | 4 ++++ tests/gem_render_linear_blits.c | 5 +++++ tests/gem_render_tiled_blits.c | 5 +++++ tests/gem_tiled_blits.c | 3 +++ 4 files changed, 17 insertions(+) diff --git a/tests/gem_linear_blits.c b/tests/gem_linear_blits.c index fe15f1d..ec2dc56 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 8ba24a3..a7e0189 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 31b2ee1..626e652 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 a6d5555..bb43976 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) {