diff options
author | Stefan Roese <sr@denx.de> | 2006-09-18 10:48:03 +0200 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2006-09-18 10:48:03 +0200 |
commit | 64cd52efd1dc51a4a5a0cf10efe5362fab27de29 (patch) | |
tree | 64e046a7d8b2f0106bc387dd032734ad963f4e68 /common/lcd.c | |
parent | 899620c2d66d4eef3b2a0034d062e71d45d886c9 (diff) | |
parent | 854bc8da75709f13dab4cfa6e9094c0cb49b5c5a (diff) | |
download | u-boot-imx-64cd52efd1dc51a4a5a0cf10efe5362fab27de29.zip u-boot-imx-64cd52efd1dc51a4a5a0cf10efe5362fab27de29.tar.gz u-boot-imx-64cd52efd1dc51a4a5a0cf10efe5362fab27de29.tar.bz2 |
Merge with /home/stefan/git/u-boot/denx
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); |