diff options
author | Nikita Kiryanov <nikita@compulab.co.il> | 2015-02-03 13:32:23 +0200 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2015-02-10 13:26:53 +0100 |
commit | 27fad01b7fca1ed9ae946ced37c3d4bde828ba14 (patch) | |
tree | 2f947839a02c67d5ed68a17ed3c3573f6ba85de6 /common/lcd.c | |
parent | b3d12e9bca1b23a537d77af2ae019cddc59f2031 (diff) | |
download | u-boot-imx-27fad01b7fca1ed9ae946ced37c3d4bde828ba14.zip u-boot-imx-27fad01b7fca1ed9ae946ced37c3d4bde828ba14.tar.gz u-boot-imx-27fad01b7fca1ed9ae946ced37c3d4bde828ba14.tar.bz2 |
lcd: mpc8xx: move mpc823-specific fb_put_byte to mpc8xx_lcd.c
Reduce the amount of platform-specific code in common/lcd.c by moving MPC823
implementation of fb_put_byte() to mpc8xx_lcd.c. Since we must also have a
default implementation for everybody else, make the remainder of the code
into a weak function.
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: Simon Glass <sjg@chromium.org>
Cc: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'common/lcd.c')
-rw-r--r-- | common/lcd.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/common/lcd.c b/common/lcd.c index f17b35b..efd9a87 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -635,11 +635,10 @@ static void lcd_display_rle8_bitmap(bmp_image_t *bmp, ushort *cmap, uchar *fb, } #endif -#if defined(CONFIG_MPC823) -#define FB_PUT_BYTE(fb, from) *(fb)++ = (255 - *(from)++) -#else -#define FB_PUT_BYTE(fb, from) *(fb)++ = *(from)++ -#endif +__weak void fb_put_byte(uchar **fb, uchar **from) +{ + *(*fb)++ = *(*from)++; +} #if defined(CONFIG_BMP_16BPP) __weak void fb_put_word(uchar **fb, uchar **from) @@ -764,7 +763,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y) WATCHDOG_RESET(); for (j = 0; j < width; j++) { if (bpix != 16) { - FB_PUT_BYTE(fb, bmap); + fb_put_byte(&fb, &bmap); } else { *(uint16_t *)fb = cmap_base[*(bmap++)]; fb += sizeof(uint16_t) / sizeof(*fb); |