diff options
author | Andre Renaud <andre@bluewatersys.com> | 2013-02-13 17:48:00 +0000 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2013-03-21 10:50:42 +0100 |
commit | 317461c1db97abef243964ae4c7cc7d3485ec73f (patch) | |
tree | e0797848774ed11f22d8e7faa6d24c11a54a7d5e /common/lcd.c | |
parent | a5796c51ce87870cde39c0b9cd29ac775d0fb514 (diff) |
Fix bitmap offsets for non 8-bit LCDs
Currently bitmap logos don't interpret the X coordinate
correctly if the bpp is anything other than 8.
Signed-off-by: Andre Renaud <andre@bluewatersys.com>
Diffstat (limited to 'common/lcd.c')
-rw-r--r-- | common/lcd.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/common/lcd.c b/common/lcd.c index 92debaf0173..195f1de617c 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -611,15 +611,16 @@ void bitmap_plot(int x, int y) immap_t *immr = (immap_t *) CONFIG_SYS_IMMR; cpm8xx_t *cp = &(immr->im_cpm); #endif + unsigned bpix = NBITS(panel_info.vl_bpix); debug("Logo: width %d height %d colors %d cmap %d\n", BMP_LOGO_WIDTH, BMP_LOGO_HEIGHT, BMP_LOGO_COLORS, ARRAY_SIZE(bmp_logo_palette)); bmap = &bmp_logo_bitmap[0]; - fb = (uchar *)(lcd_base + y * lcd_line_length + x); + fb = (uchar *)(lcd_base + y * lcd_line_length + x * bpix / 8); - if (NBITS(panel_info.vl_bpix) < 12) { + if (bpix < 12) { /* Leave room for default color map * default case: generic system with no cmap (most likely 16bpp) * cmap was set to the source palette, so no change is done. @@ -670,7 +671,7 @@ void bitmap_plot(int x, int y) } else { /* true color mode */ u16 col16; - fb16 = (ushort *)(lcd_base + y * lcd_line_length + x); + fb16 = (ushort *)fb; for (i = 0; i < BMP_LOGO_HEIGHT; ++i) { for (j = 0; j < BMP_LOGO_WIDTH; j++) { col16 = bmp_logo_palette[(bmap[j]-16)]; |