diff options
author | Nikita Kiryanov <nikita@compulab.co.il> | 2015-02-03 13:32:26 +0200 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2015-02-10 13:28:30 +0100 |
commit | 2306457c4534d5cbadb834a2a185db3ef38e12c8 (patch) | |
tree | 31a703ed0822db2a7225d8d30a07f8d7109038e2 /common/lcd.c | |
parent | 0ee261f6d3f387a33687bff29342e9321e2f8194 (diff) | |
download | u-boot-imx-2306457c4534d5cbadb834a2a185db3ef38e12c8.zip u-boot-imx-2306457c4534d5cbadb834a2a185db3ef38e12c8.tar.gz u-boot-imx-2306457c4534d5cbadb834a2a185db3ef38e12c8.tar.bz2 |
lcd: logo: move generic cmap setting to lcd_logo_set_cmap()
Get rid of platform-specific #ifdefs in bitmap_plot() by moving the generic
case of setting cmap into the weak lcd_logo_set_cmap().
Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Bo Shen <voice.shen@atmel.com>
Tested-by: Josh Wu <josh.wu@atmel.com>
Cc: Bo Shen <voice.shen@atmel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'common/lcd.c')
-rw-r--r-- | common/lcd.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/common/lcd.c b/common/lcd.c index 355c144..dcee3c0 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -387,44 +387,30 @@ int lcd_getbgcolor(void) #ifdef CONFIG_LCD_LOGO __weak void lcd_logo_set_cmap(void) { + int i; + ushort *cmap = configuration_get_cmap(); + + for (i = 0; i < ARRAY_SIZE(bmp_logo_palette); ++i) + *cmap++ = bmp_logo_palette[i]; } void bitmap_plot(int x, int y) { - ushort *cmap = (ushort *)bmp_logo_palette; ushort i, j; uchar *bmap; uchar *fb; ushort *fb16; 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)); + debug("Logo: width %d height %d colors %d\n", + BMP_LOGO_WIDTH, BMP_LOGO_HEIGHT, BMP_LOGO_COLORS); bmap = &bmp_logo_bitmap[0]; fb = (uchar *)(lcd_base + y * lcd_line_length + x * bpix / 8); 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. - * This avoids even more ifdefs in the next stanza - */ - cmap = configuration_get_cmap(); - WATCHDOG_RESET(); - - /* Set color map */ -#if defined(CONFIG_ATMEL_LCD) || defined(CONFIG_MPC823) lcd_logo_set_cmap(); -#else - for (i = 0; i < ARRAY_SIZE(bmp_logo_palette); ++i) { - ushort colreg = bmp_logo_palette[i]; - *cmap++ = colreg; - } -#endif - WATCHDOG_RESET(); for (i = 0; i < BMP_LOGO_HEIGHT; ++i) { |