test_output: add --dev parameter

The --dev parameter is used to specify the device that is used for
testing.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-08-12 13:30:51 +02:00
parent d97fc0baf0
commit 2841558f7c

View File

@ -57,6 +57,7 @@ static struct ev_eloop *eloop;
struct { struct {
bool fbdev; bool fbdev;
bool test; bool test;
char *dev;
} output_conf; } output_conf;
static int blit_outputs(struct uterm_video *video) static int blit_outputs(struct uterm_video *video)
@ -176,7 +177,8 @@ static void print_help()
"\n" "\n"
"Video Options:\n" "Video Options:\n"
"\t --fbdev [off] Use fbdev instead of DRM\n" "\t --fbdev [off] Use fbdev instead of DRM\n"
"\t --test [off] Try displaying content instead of listing devices\n", "\t --test [off] Try displaying content instead of listing devices\n"
"\t --dev [/dev/dri/card0 | /dev/fb0] Use the given device\n",
"test_input"); "test_input");
/* /*
* 80 char line: * 80 char line:
@ -192,6 +194,7 @@ struct conf_option options[] = {
TEST_OPTIONS, TEST_OPTIONS,
CONF_OPTION_BOOL(0, "fbdev", NULL, &output_conf.fbdev, false), CONF_OPTION_BOOL(0, "fbdev", NULL, &output_conf.fbdev, false),
CONF_OPTION_BOOL(0, "test", NULL, &output_conf.test, false), CONF_OPTION_BOOL(0, "test", NULL, &output_conf.test, false),
CONF_OPTION_STRING(0, "dev", NULL, &output_conf.dev, NULL),
}; };
int main(int argc, char **argv) int main(int argc, char **argv)
@ -215,6 +218,9 @@ int main(int argc, char **argv)
node = "/dev/dri/card0"; node = "/dev/dri/card0";
} }
if (output_conf.dev)
node = output_conf.dev;
log_notice("Creating video object using %s...", node); log_notice("Creating video object using %s...", node);
ret = uterm_video_new(&video, eloop, mode, node); ret = uterm_video_new(&video, eloop, mode, node);