diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2012-09-12 15:38:42 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-09-25 10:15:29 +0200 |
commit | 9d73b518fc3c61640123f8499aab7f8373e41dbd (patch) | |
tree | af61e6fd5a655afb46f66aa8ca7d0d68f2026c83 /arch/sandbox/os/common.c | |
parent | 910d0132905ca3ff12dddbcbceb94b4b5112ab5c (diff) | |
download | barebox-9d73b518fc3c61640123f8499aab7f8373e41dbd.tar.gz barebox-9d73b518fc3c61640123f8499aab7f8373e41dbd.tar.xz |
sandbox: add sdl video support
This will allow speed up the dev on framebuffer.
By default the resolution is VGA but this can be changed via cmdline.
We use a pthread to Flip the screen every 100ms as we can not detect when
barebox update it as barebox simpliy write in a buffer.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/sandbox/os/common.c')
-rw-r--r-- | arch/sandbox/os/common.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c index d2aea383fb..a73f400676 100644 --- a/arch/sandbox/os/common.c +++ b/arch/sandbox/os/common.c @@ -52,6 +52,9 @@ #include <mach/linux.h> #include <mach/hostfile.h> +int sdl_xres; +int sdl_yres; + static struct termios term_orig, term_vi; static char erase_char; /* the users erase character */ @@ -278,10 +281,12 @@ static struct option long_options[] = { {"env", 1, 0, 'e'}, {"stdout", 1, 0, 'O'}, {"stdin", 1, 0, 'I'}, + {"xres", 1, 0, 'x'}, + {"yres", 1, 0, 'y'}, {0, 0, 0, 0}, }; -static const char optstring[] = "hm:i:e:O:I:"; +static const char optstring[] = "hm:i:e:O:I:x:y:"; int main(int argc, char *argv[]) { @@ -333,6 +338,12 @@ int main(int argc, char *argv[]) barebox_register_console("cin", fd, -1); break; + case 'x': + sdl_xres = strtoul(optarg, NULL, 0); + break; + case 'y': + sdl_yres = strtoul(optarg, NULL, 0); + break; default: exit(1); } @@ -415,7 +426,9 @@ static void print_usage(const char *prgname) " -O, --stdout=<file> Register a file as a console capable of doing stdout.\n" " <file> can be a regular file or a FIFO.\n" " -I, --stdin=<file> Register a file as a console capable of doing stdin.\n" -" <file> can be a regular file or a FIFO.\n", +" <file> can be a regular file or a FIFO.\n" +" -x, --xres=<res> SDL width.\n" +" -y, --yres=<res> SDL height.\n", prgname ); } @@ -455,6 +468,14 @@ static void print_usage(const char *prgname) * Register \<file\> as a console capable of doing stdin. \<file\> can be a regular * file or a fifo. * + * -x, --xres \<res\> + * + * Specify SDL width + * + * -y, --yres \<res\> + * + * Specify SDL height + * * @section simu_dbg How to debug barebox simulator * */ |