diff --git a/Documentation/commands.dox b/Documentation/commands.dox index 5ef7829..d8cfa6b 100644 --- a/Documentation/commands.dox +++ b/Documentation/commands.dox @@ -18,7 +18,6 @@ @li @subpage _name @li @subpage addpart_command @li @subpage alternate -@li @subpage bmp_command @li @subpage bootm_command @li @subpage bootu @li @subpage bootz @@ -95,6 +94,7 @@ @li @subpage sh @li @subpage sleep @li @subpage source +@li @subpage splash_command @li @subpage test @li @subpage timeout @li @subpage true diff --git a/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board b/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board index ff3365d..58e07e0 100644 --- a/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board +++ b/arch/arm/boards/eukrea_cpuimx25/env/bin/init_board @@ -1,11 +1,11 @@ #!/bin/sh if [ -f /env/logo.bmp ]; then - bmp /env/logo.bmp + splash /env/logo.bmp fb0.enable=1 elif [ -f /env/logo.bmp.lzo ]; then uncompress /env/logo.bmp.lzo /logo.bmp - bmp /logo.bmp + splash /logo.bmp fb0.enable=1 fi diff --git a/arch/arm/boards/eukrea_cpuimx27/env/bin/init b/arch/arm/boards/eukrea_cpuimx27/env/bin/init index f84ace9..cd74974 100644 --- a/arch/arm/boards/eukrea_cpuimx27/env/bin/init +++ b/arch/arm/boards/eukrea_cpuimx27/env/bin/init @@ -17,11 +17,11 @@ fi if [ -f /env/logo.bmp ]; then - bmp /env/logo.bmp + splash /env/logo.bmp fb0.enable=1 elif [ -f /env/logo.bmp.lzo ]; then uncompress /env/logo.bmp.lzo /logo.bmp - bmp /logo.bmp + splash /logo.bmp fb0.enable=1 fi diff --git a/arch/arm/boards/eukrea_cpuimx35/env/bin/init_board b/arch/arm/boards/eukrea_cpuimx35/env/bin/init_board index 89fd9a9..2a07a84 100644 --- a/arch/arm/boards/eukrea_cpuimx35/env/bin/init_board +++ b/arch/arm/boards/eukrea_cpuimx35/env/bin/init_board @@ -1,12 +1,12 @@ #!/bin/sh if [ -f /env/logo.bmp ]; then - bmp /env/logo.bmp + splash /env/logo.bmp fb0.enable=1 gpio_set_value 1 1 elif [ -f /env/logo.bmp.lzo ]; then uncompress /env/logo.bmp.lzo /logo.bmp - bmp /logo.bmp + splash /logo.bmp fb0.enable=1 gpio_set_value 1 1 fi diff --git a/arch/arm/boards/eukrea_cpuimx51/env/bin/init_board b/arch/arm/boards/eukrea_cpuimx51/env/bin/init_board index cb624e5..0af6582 100644 --- a/arch/arm/boards/eukrea_cpuimx51/env/bin/init_board +++ b/arch/arm/boards/eukrea_cpuimx51/env/bin/init_board @@ -1,12 +1,12 @@ #!/bin/sh if [ -f /env/logo.bmp ]; then - bmp /env/logo.bmp + splash /env/logo.bmp fb0.enable=1 gpio_set_value 1 1 elif [ -f /env/logo.bmp.lzo ]; then uncompress /env/logo.bmp.lzo /logo.bmp - bmp /logo.bmp + splash /logo.bmp fb0.enable=1 gpio_set_value 1 1 fi diff --git a/arch/arm/boards/karo-tx25/env/bin/init_board b/arch/arm/boards/karo-tx25/env/bin/init_board index b17c55d..1f35c96 100644 --- a/arch/arm/boards/karo-tx25/env/bin/init_board +++ b/arch/arm/boards/karo-tx25/env/bin/init_board @@ -1,6 +1,6 @@ if [ -e /dev/fb0 -a -e /env/splash.bmp ]; then - bmp /env/splash.bmp + splash /env/splash.bmp fb0.enable=1 fi diff --git a/arch/arm/boards/mioa701/env/bin/init b/arch/arm/boards/mioa701/env/bin/init index 494d067..ab5d84d 100644 --- a/arch/arm/boards/mioa701/env/bin/init +++ b/arch/arm/boards/mioa701/env/bin/init @@ -12,7 +12,7 @@ sdcard_override fb0.enable=1 -bmp /dev/mtd0.barebox-logo +splash /dev/mtd0.barebox-logo mtd_env_override if [ $? = 0 ]; then diff --git a/arch/arm/configs/chumbyone_defconfig b/arch/arm/configs/chumbyone_defconfig index 33d83a8..1b03530 100644 --- a/arch/arm/configs/chumbyone_defconfig +++ b/arch/arm/configs/chumbyone_defconfig @@ -30,7 +30,7 @@ CONFIG_CMD_GO=y CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_NET=y CONFIG_NET_DHCP=y diff --git a/arch/arm/configs/cupid_defconfig b/arch/arm/configs/cupid_defconfig index 28d199b..d7716ea 100644 --- a/arch/arm/configs/cupid_defconfig +++ b/arch/arm/configs/cupid_defconfig @@ -45,7 +45,7 @@ CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_NET=y diff --git a/arch/arm/configs/eukrea_cpuimx25_defconfig b/arch/arm/configs/eukrea_cpuimx25_defconfig index f7207e8..5eb4ff3 100644 --- a/arch/arm/configs/eukrea_cpuimx25_defconfig +++ b/arch/arm/configs/eukrea_cpuimx25_defconfig @@ -43,7 +43,7 @@ CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_CMD_I2C=y diff --git a/arch/arm/configs/eukrea_cpuimx27_defconfig b/arch/arm/configs/eukrea_cpuimx27_defconfig index 93de428..2b95156 100644 --- a/arch/arm/configs/eukrea_cpuimx27_defconfig +++ b/arch/arm/configs/eukrea_cpuimx27_defconfig @@ -31,7 +31,7 @@ CONFIG_CMD_GO=y CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_CMD_I2C=y diff --git a/arch/arm/configs/eukrea_cpuimx35_defconfig b/arch/arm/configs/eukrea_cpuimx35_defconfig index 880beb6..16ef4cc 100644 --- a/arch/arm/configs/eukrea_cpuimx35_defconfig +++ b/arch/arm/configs/eukrea_cpuimx35_defconfig @@ -44,7 +44,7 @@ CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_CMD_I2C=y diff --git a/arch/arm/configs/freescale_mx35_3stack_defconfig b/arch/arm/configs/freescale_mx35_3stack_defconfig index a60658d..4052325 100644 --- a/arch/arm/configs/freescale_mx35_3stack_defconfig +++ b/arch/arm/configs/freescale_mx35_3stack_defconfig @@ -42,7 +42,7 @@ CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_CMD_I2C=y diff --git a/arch/arm/configs/imx28evk_defconfig b/arch/arm/configs/imx28evk_defconfig index 1b44cf4..f4d4661 100644 --- a/arch/arm/configs/imx28evk_defconfig +++ b/arch/arm/configs/imx28evk_defconfig @@ -33,7 +33,7 @@ CONFIG_CMD_GO=y CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_NET=y CONFIG_NET_DHCP=y diff --git a/arch/arm/configs/mioa701_defconfig b/arch/arm/configs/mioa701_defconfig index 2bb3cec..5f06b3c 100644 --- a/arch/arm/configs/mioa701_defconfig +++ b/arch/arm/configs/mioa701_defconfig @@ -38,7 +38,7 @@ CONFIG_CMD_RESET=y CONFIG_CMD_TIMEOUT=y CONFIG_CMD_PARTITION=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_CMD_LED=y diff --git a/arch/arm/configs/neso_defconfig b/arch/arm/configs/neso_defconfig index 5744dc1..3ea6891 100644 --- a/arch/arm/configs/neso_defconfig +++ b/arch/arm/configs/neso_defconfig @@ -45,7 +45,7 @@ CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_NET=y diff --git a/arch/arm/configs/pcm027_defconfig b/arch/arm/configs/pcm027_defconfig index 9760e66..5a65a72 100644 --- a/arch/arm/configs/pcm027_defconfig +++ b/arch/arm/configs/pcm027_defconfig @@ -43,7 +43,7 @@ CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_NET=y diff --git a/arch/arm/configs/pcm038_defconfig b/arch/arm/configs/pcm038_defconfig index 5ce4f7a..bab4002 100644 --- a/arch/arm/configs/pcm038_defconfig +++ b/arch/arm/configs/pcm038_defconfig @@ -49,7 +49,7 @@ CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_NET=y diff --git a/arch/arm/configs/tx25stk5_defconfig b/arch/arm/configs/tx25stk5_defconfig index 99057c2..e098ef8 100644 --- a/arch/arm/configs/tx25stk5_defconfig +++ b/arch/arm/configs/tx25stk5_defconfig @@ -45,7 +45,7 @@ CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_NET=y diff --git a/arch/arm/configs/tx28stk5_defconfig b/arch/arm/configs/tx28stk5_defconfig index b4e3747..49a0ab3 100644 --- a/arch/arm/configs/tx28stk5_defconfig +++ b/arch/arm/configs/tx28stk5_defconfig @@ -41,7 +41,7 @@ CONFIG_CMD_PARTITION=y CONFIG_CMD_MAGICVAR=y CONFIG_CMD_MAGICVAR_HELP=y -CONFIG_CMD_BMP=y +CONFIG_CMD_SPLASH=y CONFIG_CMD_GPIO=y CONFIG_CMD_UNCOMPRESS=y CONFIG_NET=y diff --git a/commands/Kconfig b/commands/Kconfig index f2756cc..c4623fa 100644 --- a/commands/Kconfig +++ b/commands/Kconfig @@ -535,10 +535,10 @@ depends on MODULES prompt "lsmod" -config CMD_BMP +config CMD_SPLASH bool depends on VIDEO - prompt "bmp" + prompt "splash" help show bmp files on framebuffer devices diff --git a/commands/Makefile b/commands/Makefile index ccebd7f..24bf46a 100644 --- a/commands/Makefile +++ b/commands/Makefile @@ -49,7 +49,7 @@ obj-$(CONFIG_CMD_HELP) += help.o obj-$(CONFIG_CMD_LSMOD) += lsmod.o obj-$(CONFIG_CMD_INSMOD) += insmod.o -obj-$(CONFIG_CMD_BMP) += bmp.o +obj-$(CONFIG_CMD_SPLASH) += splash.o obj-$(CONFIG_USB_GADGET_DFU) += dfu.o obj-$(CONFIG_USB_GADGET_SERIAL) += usbserial.o obj-$(CONFIG_CMD_GPIO) += gpio.o diff --git a/commands/bmp.c b/commands/bmp.c deleted file mode 100644 index 4130474..0000000 --- a/commands/bmp.c +++ /dev/null @@ -1,221 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static inline void set_pixel(struct fb_info *info, void *adr, int r, int g, int b) -{ - u32 px; - - px = (r >> (8 - info->red.length)) << info->red.offset | - (g >> (8 - info->green.length)) << info->green.offset | - (b >> (8 - info->blue.length)) << info->blue.offset; - - switch (info->bits_per_pixel) { - case 8: - break; - case 16: - *(u16 *)adr = px; - break; - case 32: - *(u32 *)adr = px; - break; - } -} - -static int do_bmp(int argc, char *argv[]) -{ - int ret, opt, fd; - char *fbdev = "/dev/fb0"; - void *fb, *offscreenbuf = NULL; - struct fb_info info; - struct bmp_image *bmp; - char *bmpfile; - int bmpsize; - char *image; - int sw, sh, width, height, startx = -1, starty = -1; - int bits_per_pixel, fbsize; - int xres, yres; - int offscreen = 0; - void *adr, *buf; - - while((opt = getopt(argc, argv, "f:x:y:o")) > 0) { - switch(opt) { - case 'f': - fbdev = optarg; - break; - case 'x': - startx = simple_strtoul(optarg, NULL, 0); - break; - case 'y': - starty = simple_strtoul(optarg, NULL, 0); - case 'o': - offscreen = 1; - } - } - - if (optind == argc) { - printf("no filename given\n"); - return 1; - } - bmpfile = argv[optind]; - - fd = open(fbdev, O_RDWR); - if (fd < 0) { - perror("open"); - return 1; - } - - fb = memmap(fd, PROT_READ | PROT_WRITE); - if (fb == (void *)-1) { - perror("memmap"); - goto failed_memmap; - } - - ret = ioctl(fd, FBIOGET_SCREENINFO, &info); - if (ret) { - perror("ioctl"); - goto failed_memmap; - } - - xres = info.xres; - yres = info.yres; - - bmp = read_file(bmpfile, &bmpsize); - if (!bmp) { - printf("unable to read %s\n", bmpfile); - goto failed_memmap; - } - - if (bmp->header.signature[0] != 'B' || - bmp->header.signature[1] != 'M') { - printf("No valid bmp file\n"); - } - - sw = le32_to_cpu(bmp->header.width); - sh = le32_to_cpu(bmp->header.height); - - if (startx < 0) { - startx = (xres - sw) / 2; - if (startx < 0) - startx = 0; - } - - if (starty < 0) { - starty = (yres - sh) / 2; - if (starty < 0) - starty = 0; - } - - width = min(sw, xres - startx); - height = min(sh, yres - starty); - - bits_per_pixel = le16_to_cpu(bmp->header.bit_count); - fbsize = xres * yres * (info.bits_per_pixel >> 3); - - if (offscreen) { - /* Don't fail if malloc fails, just continue rendering directly - * on the framebuffer - */ - offscreenbuf = malloc(fbsize); - if (offscreenbuf) - memcpy(offscreenbuf, fb, fbsize); - } - - buf = offscreenbuf ? offscreenbuf : fb; - - if (bits_per_pixel == 8) { - int x, y; - struct bmp_color_table_entry *color_table = bmp->color_table; - - for (y = 0; y < height; y++) { - image = (char *)bmp + - le32_to_cpu(bmp->header.data_offset); - image += (sh - y - 1) * sw * (bits_per_pixel >> 3); - adr = buf + ((y + starty) * xres + startx) * - (info.bits_per_pixel >> 3); - for (x = 0; x < width; x++) { - int pixel; - - pixel = *image; - - set_pixel(&info, adr, color_table[pixel].red, - color_table[pixel].green, - color_table[pixel].blue); - adr += info.bits_per_pixel >> 3; - - image += bits_per_pixel >> 3; - } - } - } else if (bits_per_pixel == 24) { - int x, y; - - for (y = 0; y < height; y++) { - image = (char *)bmp + - le32_to_cpu(bmp->header.data_offset); - image += (sh - y - 1) * sw * (bits_per_pixel >> 3); - adr = buf + ((y + starty) * xres + startx) * - (info.bits_per_pixel >> 3); - for (x = 0; x < width; x++) { - char *pixel; - - pixel = image; - - set_pixel(&info, adr, pixel[2], pixel[1], - pixel[0]); - adr += info.bits_per_pixel >> 3; - - image += bits_per_pixel >> 3; - } - } - } else - printf("bmp: illegal bits per pixel value: %d\n", bits_per_pixel); - - if (offscreenbuf) { - memcpy(fb, offscreenbuf, fbsize); - free(offscreenbuf); - } - - free(bmp); - close(fd); - - return 0; - -failed_memmap: - close(fd); - - return 1; -} - -BAREBOX_CMD_HELP_START(bmp) -BAREBOX_CMD_HELP_USAGE("bmp [OPTIONS] FILE\n") -BAREBOX_CMD_HELP_SHORT("Show the bitmap FILE on the framebuffer.\n") -BAREBOX_CMD_HELP_OPT ("-f ", "framebuffer device (/dev/fb0)\n") -BAREBOX_CMD_HELP_OPT ("-x ", "x offset (default center)\n") -BAREBOX_CMD_HELP_OPT ("-y ", "y offset (default center)\n") -BAREBOX_CMD_HELP_OPT ("-o", "render offscreen\n") -BAREBOX_CMD_HELP_END - -/** - * @page bmp_command - -This command displays a graphics in the bitmap (.bmp) format on the -framebuffer. Currently the bmp command supports images with 8 and 24 bit -color depth. - -\todo What does the -o (offscreen) option do? - - */ - -BAREBOX_CMD_START(bmp) - .cmd = do_bmp, - .usage = "show a bmp image", - BAREBOX_CMD_HELP(cmd_bmp_help) -BAREBOX_CMD_END diff --git a/commands/splash.c b/commands/splash.c new file mode 100644 index 0000000..6526b20 --- /dev/null +++ b/commands/splash.c @@ -0,0 +1,221 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static inline void set_pixel(struct fb_info *info, void *adr, int r, int g, int b) +{ + u32 px; + + px = (r >> (8 - info->red.length)) << info->red.offset | + (g >> (8 - info->green.length)) << info->green.offset | + (b >> (8 - info->blue.length)) << info->blue.offset; + + switch (info->bits_per_pixel) { + case 8: + break; + case 16: + *(u16 *)adr = px; + break; + case 32: + *(u32 *)adr = px; + break; + } +} + +static int do_splash(int argc, char *argv[]) +{ + int ret, opt, fd; + char *fbdev = "/dev/fb0"; + void *fb, *offscreenbuf = NULL; + struct fb_info info; + struct bmp_image *bmp; + char *bmpfile; + int bmpsize; + char *image; + int sw, sh, width, height, startx = -1, starty = -1; + int bits_per_pixel, fbsize; + int xres, yres; + int offscreen = 0; + void *adr, *buf; + + while((opt = getopt(argc, argv, "f:x:y:o")) > 0) { + switch(opt) { + case 'f': + fbdev = optarg; + break; + case 'x': + startx = simple_strtoul(optarg, NULL, 0); + break; + case 'y': + starty = simple_strtoul(optarg, NULL, 0); + case 'o': + offscreen = 1; + } + } + + if (optind == argc) { + printf("no filename given\n"); + return 1; + } + bmpfile = argv[optind]; + + fd = open(fbdev, O_RDWR); + if (fd < 0) { + perror("open"); + return 1; + } + + fb = memmap(fd, PROT_READ | PROT_WRITE); + if (fb == (void *)-1) { + perror("memmap"); + goto failed_memmap; + } + + ret = ioctl(fd, FBIOGET_SCREENINFO, &info); + if (ret) { + perror("ioctl"); + goto failed_memmap; + } + + xres = info.xres; + yres = info.yres; + + bmp = read_file(bmpfile, &bmpsize); + if (!bmp) { + printf("unable to read %s\n", bmpfile); + goto failed_memmap; + } + + if (bmp->header.signature[0] != 'B' || + bmp->header.signature[1] != 'M') { + printf("No valid bmp file\n"); + } + + sw = le32_to_cpu(bmp->header.width); + sh = le32_to_cpu(bmp->header.height); + + if (startx < 0) { + startx = (xres - sw) / 2; + if (startx < 0) + startx = 0; + } + + if (starty < 0) { + starty = (yres - sh) / 2; + if (starty < 0) + starty = 0; + } + + width = min(sw, xres - startx); + height = min(sh, yres - starty); + + bits_per_pixel = le16_to_cpu(bmp->header.bit_count); + fbsize = xres * yres * (info.bits_per_pixel >> 3); + + if (offscreen) { + /* Don't fail if malloc fails, just continue rendering directly + * on the framebuffer + */ + offscreenbuf = malloc(fbsize); + if (offscreenbuf) + memcpy(offscreenbuf, fb, fbsize); + } + + buf = offscreenbuf ? offscreenbuf : fb; + + if (bits_per_pixel == 8) { + int x, y; + struct bmp_color_table_entry *color_table = bmp->color_table; + + for (y = 0; y < height; y++) { + image = (char *)bmp + + le32_to_cpu(bmp->header.data_offset); + image += (sh - y - 1) * sw * (bits_per_pixel >> 3); + adr = buf + ((y + starty) * xres + startx) * + (info.bits_per_pixel >> 3); + for (x = 0; x < width; x++) { + int pixel; + + pixel = *image; + + set_pixel(&info, adr, color_table[pixel].red, + color_table[pixel].green, + color_table[pixel].blue); + adr += info.bits_per_pixel >> 3; + + image += bits_per_pixel >> 3; + } + } + } else if (bits_per_pixel == 24) { + int x, y; + + for (y = 0; y < height; y++) { + image = (char *)bmp + + le32_to_cpu(bmp->header.data_offset); + image += (sh - y - 1) * sw * (bits_per_pixel >> 3); + adr = buf + ((y + starty) * xres + startx) * + (info.bits_per_pixel >> 3); + for (x = 0; x < width; x++) { + char *pixel; + + pixel = image; + + set_pixel(&info, adr, pixel[2], pixel[1], + pixel[0]); + adr += info.bits_per_pixel >> 3; + + image += bits_per_pixel >> 3; + } + } + } else + printf("bmp: illegal bits per pixel value: %d\n", bits_per_pixel); + + if (offscreenbuf) { + memcpy(fb, offscreenbuf, fbsize); + free(offscreenbuf); + } + + free(bmp); + close(fd); + + return 0; + +failed_memmap: + close(fd); + + return 1; +} + +BAREBOX_CMD_HELP_START(splash) +BAREBOX_CMD_HELP_USAGE("splash [OPTIONS] FILE\n") +BAREBOX_CMD_HELP_SHORT("Show the bitmap FILE on the framebuffer.\n") +BAREBOX_CMD_HELP_OPT ("-f ", "framebuffer device (/dev/fb0)\n") +BAREBOX_CMD_HELP_OPT ("-x ", "x offset (default center)\n") +BAREBOX_CMD_HELP_OPT ("-y ", "y offset (default center)\n") +BAREBOX_CMD_HELP_OPT ("-o", "render offscreen\n") +BAREBOX_CMD_HELP_END + +/** + * @page bmp_command + +This command displays a graphics in the bitmap (.bmp) format on the +framebuffer. Currently the bmp command supports images with 8 and 24 bit +color depth. + +\todo What does the -o (offscreen) option do? + + */ + +BAREBOX_CMD_START(splash) + .cmd = do_splash, + .usage = "show a bmp image", + BAREBOX_CMD_HELP(cmd_splash_help) +BAREBOX_CMD_END