diff options
author | Timur Tabi <timur@freescale.com> | 2010-08-23 16:58:00 -0500 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2010-09-21 22:44:59 +0200 |
commit | 68f6618bcd0f06b5558c66ceb607b14f5f46ba03 (patch) | |
tree | 86aac0653e66d4eee36cc11dfa76fc4d27445209 /drivers/video/cfb_console.c | |
parent | ef351fe1f780b7cbc4c25ed4c544cb59fbf86761 (diff) | |
download | u-boot-imx-68f6618bcd0f06b5558c66ceb607b14f5f46ba03.zip u-boot-imx-68f6618bcd0f06b5558c66ceb607b14f5f46ba03.tar.gz u-boot-imx-68f6618bcd0f06b5558c66ceb607b14f5f46ba03.tar.bz2 |
video: cfb_console: add support for 4bpp bitmaps with GDF_32BIT_X888RGB
Add support for 4bpp bitmaps, currently only for GDF_32BIT_X888RGB
frame buffer format.
Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'drivers/video/cfb_console.c')
-rw-r--r-- | drivers/video/cfb_console.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index fae5417..268bacf 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -1114,8 +1114,44 @@ int video_display_bitmap (ulong bmp_image, int x, int y) } #endif - /* We handle only 8bpp or 24 bpp bitmap */ + /* We handle only 4, 8, or 24 bpp bitmaps */ switch (le16_to_cpu (bmp->header.bit_count)) { + case 4: + padded_line -= width / 2; + ycount = height; + + switch (VIDEO_DATA_FORMAT) { + case GDF_32BIT_X888RGB: + while (ycount--) { + WATCHDOG_RESET (); + /* + * Don't assume that 'width' is an + * even number + */ + for (xcount = 0; xcount < width; xcount++) { + uchar idx; + + if (xcount & 1) { + idx = *bmap & 0xF; + bmap++; + } else + idx = *bmap >> 4; + cte = bmp->color_table[idx]; + FILL_32BIT_X888RGB(cte.red, cte.green, + cte.blue); + } + bmap += padded_line; + fb -= (VIDEO_VISIBLE_COLS + width) * + VIDEO_PIXEL_SIZE; + } + break; + default: + puts("4bpp bitmap unsupported with current " + "video mode\n"); + break; + } + break; + case 8: padded_line -= width; if (VIDEO_DATA_FORMAT == GDF__8BIT_INDEX) { |