diff options
author | Jon Loeliger <jdl@freescale.com> | 2006-09-19 08:51:24 -0500 |
---|---|---|
committer | Jon Loeliger <jdl@freescale.com> | 2006-09-19 08:51:24 -0500 |
commit | afa98843e4665add11b69496341053b268156e3a (patch) | |
tree | 116878b6b94920a5f282d0a16e4b9ad9dfaf57ff /common/lcd.c | |
parent | b440d0ef72e6278973d3220c10136a4c0624c286 (diff) | |
parent | aeec782b020930732eab075af97212c3f03afcae (diff) | |
download | u-boot-imx-afa98843e4665add11b69496341053b268156e3a.zip u-boot-imx-afa98843e4665add11b69496341053b268156e3a.tar.gz u-boot-imx-afa98843e4665add11b69496341053b268156e3a.tar.bz2 |
Merge branch 'master' of http://www.denx.de/git/u-boot
Conflicts:
board/stxxtc/Makefile
Diffstat (limited to 'common/lcd.c')
-rw-r--r-- | common/lcd.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/common/lcd.c b/common/lcd.c index 0be1912..d79350f 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -585,6 +585,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) uchar *bmap; ushort padded_line; unsigned long width, height; + unsigned long pwidth = panel_info.vl_col; unsigned colors,bpix; unsigned long compression; #if defined(CONFIG_PXA250) @@ -628,6 +629,8 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) cmap = (ushort *)fbi->palette; #elif defined(CONFIG_MPC823) cmap = (ushort *)&(cp->lcd_cmap[255*sizeof(ushort)]); +#elif defined(CONFIG_MCC200) + /* MCC200 LCD doesn't need CMAP, supports 1bpp b&w only */ #else # error "Don't know location of color map" #endif @@ -652,9 +655,28 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) } } + /* + * BMP format for Monochrome assumes that the state of a + * pixel is described on a per Bit basis, not per Byte. + * So, in case of Monochrome BMP we should align widths + * on a byte boundary and convert them from Bit to Byte + * units. + * Probably, PXA250 and MPC823 process 1bpp BMP images in + * their own ways, so make the converting to be MCC200 + * specific. + */ +#if defined(CONFIG_MCC200) + if (bpix==1) + { + width = ((width + 7) & ~7) >> 3; + x = ((x + 7) & ~7) >> 3; + pwidth= ((pwidth + 7) & ~7) >> 3; + } +#endif + padded_line = (width&0x3) ? ((width&~0x3)+4) : (width); - if ((x + width)>panel_info.vl_col) - width = panel_info.vl_col - x; + if ((x + width)>pwidth) + width = pwidth - x; if ((y + height)>panel_info.vl_row) height = panel_info.vl_row - y; @@ -666,7 +688,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) for (j = 0; j < width ; j++) #if defined(CONFIG_PXA250) *(fb++)=*(bmap++); -#elif defined(CONFIG_MPC823) +#elif defined(CONFIG_MPC823) || defined(CONFIG_MCC200) *(fb++)=255-*(bmap++); #endif bmap += (width - padded_line); |