testdisplay: test all modes if no option is provided

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 <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
Paulo Zanoni 2011-09-15 15:13:41 -03:00 committed by Daniel Vetter
parent e450cf6d8a
commit 9fe1148c4b

View File

@ -946,7 +946,7 @@ static void update_display(void)
extern char *optarg; extern char *optarg;
extern int optind, opterr, optopt; extern int optind, opterr, optopt;
static char optstr[] = "hiaf:s:d:pt"; static char optstr[] = "hiaf:s:d:pmt";
static void usage(char *name) static void usage(char *name)
{ {
@ -956,11 +956,12 @@ static void usage(char *name)
fprintf(stderr, "\t-s\t<duration>\tsleep between each mode test\n"); fprintf(stderr, "\t-s\t<duration>\tsleep between each mode test\n");
fprintf(stderr, "\t-d\t<depth>\tbit depth of scanout buffer\n"); fprintf(stderr, "\t-d\t<depth>\tbit depth of scanout buffer\n");
fprintf(stderr, "\t-p\ttest overlay plane\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-t\tuse a tiled framebuffer\n");
fprintf(stderr, "\t-f\t<clock MHz>,<hdisp>,<hsync-start>,<hsync-end>,<htotal>,\n"); fprintf(stderr, "\t-f\t<clock MHz>,<hdisp>,<hsync-start>,<hsync-end>,<htotal>,\n");
fprintf(stderr, "\t\t<vdisp>,<vsync-start>,<vsync-end>,<vtotal>\n"); fprintf(stderr, "\t\t<vdisp>,<vsync-start>,<vsync-end>,<vtotal>\n");
fprintf(stderr, "\t\ttest force mode\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); exit(0);
} }
@ -1043,6 +1044,9 @@ int main(int argc, char **argv)
case 'p': case 'p':
test_plane = 1; test_plane = 1;
break; break;
case 'm':
test_preferred_mode = 1;
break;
case 't': case 't':
enable_tiling = 1; enable_tiling = 1;
break; break;
@ -1054,8 +1058,9 @@ int main(int argc, char **argv)
break; break;
} }
} }
if (!test_all_modes && !force_mode && !dump_info) if (!test_all_modes && !force_mode && !dump_info &&
test_preferred_mode = 1; !test_preferred_mode)
test_all_modes = 1;
for (i = 0; i < ARRAY_SIZE(modules); i++) { for (i = 0; i < ARRAY_SIZE(modules); i++) {
fd = drmOpen(modules[i], NULL); fd = drmOpen(modules[i], NULL);