From: przanoni@gmail.com Subject: [gpu-tools 3/7] testdisplay: test all modes if no option is provided Date: Thu, 15 Sep 2011 15:13:41 -0300 Message-ID: <1316110421-19091-1-git-send-email-przanoni@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-yx0-f177.google.com (mail-yx0-f177.google.com [209.85.213.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 06B83A2579 for ; Thu, 15 Sep 2011 11:13:50 -0700 (PDT) Received: by yxi11 with SMTP id 11so2664710yxi.36 for ; Thu, 15 Sep 2011 11:13:50 -0700 (PDT) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org Cc: Paulo Zanoni List-Id: intel-gfx@lists.freedesktop.org From: Paulo Zanoni Previously, when called without any arguments, the application required user input to finish. However, testdisplay is ran by "make check", and it is not a good idea to run a program that requires user input in "make check". So we change the default behavior to something that doesn't require user input. You can still access the previous behavior using the "-m" argument. Signed-off-by: Paulo Zanoni --- tests/testdisplay.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/testdisplay.c b/tests/testdisplay.c index 94c6e74..cae04e9 100644 --- a/tests/testdisplay.c +++ b/tests/testdisplay.c @@ -946,7 +946,7 @@ static void update_display(void) extern char *optarg; extern int optind, opterr, optopt; -static char optstr[] = "hiaf:s:d:pt"; +static char optstr[] = "hiaf:s:d:pmt"; static void usage(char *name) { @@ -956,11 +956,12 @@ static void usage(char *name) fprintf(stderr, "\t-s\t\tsleep between each mode test\n"); fprintf(stderr, "\t-d\t\tbit depth of scanout buffer\n"); fprintf(stderr, "\t-p\ttest overlay plane\n"); + fprintf(stderr, "\t-m\ttest the preferred mode\n"); fprintf(stderr, "\t-t\tuse a tiled framebuffer\n"); fprintf(stderr, "\t-f\t,,,,,\n"); fprintf(stderr, "\t\t,,,\n"); fprintf(stderr, "\t\ttest force mode\n"); - fprintf(stderr, "\tDefault is to test the preferred mode.\n"); + fprintf(stderr, "\tDefault is to test all modes.\n"); exit(0); } @@ -1043,6 +1044,9 @@ int main(int argc, char **argv) case 'p': test_plane = 1; break; + case 'm': + test_preferred_mode = 1; + break; case 't': enable_tiling = 1; break; @@ -1054,8 +1058,9 @@ int main(int argc, char **argv) break; } } - if (!test_all_modes && !force_mode && !dump_info) - test_preferred_mode = 1; + if (!test_all_modes && !force_mode && !dump_info && + !test_preferred_mode) + test_all_modes = 1; for (i = 0; i < ARRAY_SIZE(modules); i++) { fd = drmOpen(modules[i], NULL); -- 1.7.4.1