From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anatolij Gustschin Date: Tue, 24 Apr 2012 17:55:12 +0200 Subject: [U-Boot] [PATCH 1/2] LCD: drawing 32bpp uncompressed bitmap image In-Reply-To: <4F94B49B.3070101@samsung.com> References: <4F94B49B.3070101@samsung.com> Message-ID: <20120424175512.5818dba2@wker> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, On Mon, 23 Apr 2012 10:47:07 +0900 Donghwa Lee wrote: > This patch supports drawing 32bpp uncompressed bitmap image. > > Signed-off-by: Donghwa Lee > Signed-off-by: Kyungmin.park > --- > common/lcd.c | 26 ++++++++++++++++++++++---- > 1 files changed, 22 insertions(+), 4 deletions(-) > > diff --git a/common/lcd.c b/common/lcd.c > index bf1a6a9..a7b04d2 100644 > --- a/common/lcd.c > +++ b/common/lcd.c ... > @@ -739,8 +739,14 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) > height = panel_info.vl_row - y; > > bmap = (uchar *)bmp + le32_to_cpu (bmp->header.data_offset); > + > +#ifndef CONFIG_EXYNOS_FB > fb = (uchar *) (lcd_base + > (y + height - 1) * lcd_line_length + x * bpix / 8); > +#else > + fb = (uchar *) (lcd_base + (y + height) * > + (panel_info.vl_col * (bpix / 8)) + x * (bpix / 8)); > +#endif This ifndef shouldn't be needed. Better pass needed 'y' position to the lcd_display_bitmap() function. > > switch (bmp_bpix) { > case 1: /* pass through */ > @@ -788,9 +794,21 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) > bmap += (padded_line - width) * 2; > fb -= (width * 2 + lcd_line_length); > } > + Please do not add this empty line here. > break; > #endif /* CONFIG_BMP_16BPP */ > - > + case 32: > + for (i = 0; i < height; ++i) { > + for (j = 0; j < width; j++) { > + *(fb++) = *(bmap++); > + *(fb++) = *(bmap++); > + *(fb++) = *(bmap++); > + *(fb++) = *(bmap++); > + } > + fb -= ((panel_info.vl_col * > + (bpix / 8)) + width * (bpix / 8)); you can use lcd_line_lenght instead of (panel_info.vl_col * (bpix / 8)) here, i think. > + } > + break; Please surround by #ifdef CONFIG_BMP_32BPP ... #endif so that boards not using 32bpp do not suffer from code size increase. Thanks, Anatolij