]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
lcd: make lcd_drawchars() independant of lcd_base
authorNikita Kiryanov <nikita@compulab.co.il>
Mon, 8 Dec 2014 15:14:44 +0000 (17:14 +0200)
committerAnatolij Gustschin <agust@denx.de>
Sat, 10 Jan 2015 16:53:36 +0000 (17:53 +0100)
lcd_logo() has the following return value:

 #if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
return (void *)((ulong)lcd_base + BMP_LOGO_HEIGHT * lcd_line_length);
 #else
return (void *)lcd_base;
 #endif

This return value gets assigned to lcd_console_address.
lcd_console_address is not assigned or modified anywhere else.
Thus:

 #if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO):
y' = BMP_LOGO_HEIGHT + y;
lcd_base + y' * lcd_line_length ==
lcd_base + (BMP_LOGO_HEIGHT + y) * lcd_line_length ==
lcd_base + BMP_LOGO_HEIGHT * lcd_line_length + y * lcd_line_length ==
lcd_console_address + y * lcd_line_length
 #else
lcd_base + y * lcd_line_length == lcd_console_address + y * lcd_line_length
 #endif

This is a preparatory step for extracting lcd console code into its own
file.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Simon Glass <sjg@chromium.org>
common/lcd.c

index 1259446a0e51cd7469d7e020582b85374f675cff..4ff952442ac250f45d58af0ab4d421e905c67727 100644 (file)
@@ -318,11 +318,8 @@ static void lcd_drawchars(ushort x, ushort y, uchar *str, int count)
        ushort row;
        int fg_color, bg_color;
 
-#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
-       y += BMP_LOGO_HEIGHT;
-#endif
-
-       dest = (uchar *)(lcd_base + y * lcd_line_length + x * NBITS(LCD_BPP)/8);
+       dest = (uchar *)(lcd_console_address +
+                       y * lcd_line_length + x * NBITS(LCD_BPP) / 8);
 
        for (row = 0; row < VIDEO_FONT_HEIGHT; ++row, dest += lcd_line_length) {
                uchar *s = str;