From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hannes Petermaier Date: Wed, 18 Mar 2015 08:37:21 +0100 Subject: [U-Boot] [PATCH v2 2/4] common/lcd_console: ask only one-time for bg/fg-color per call In-Reply-To: <1426664243-30998-1-git-send-email-oe5hpm@oevsv.at> References: <1426664243-30998-1-git-send-email-oe5hpm@oevsv.at> Message-ID: <1426664243-30998-3-git-send-email-oe5hpm@oevsv.at> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de From: Hannes Petermaier Don't call the lcd_getfgcolor and lcd_getbgcolor within the "draw-loop", this only wastes time. Signed-off-by: Hannes Petermaier Signed-off-by: Hannes Petermaier --- Changes in v2: None common/lcd_console.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/common/lcd_console.c b/common/lcd_console.c index 243b7c5..b7dda7a 100644 --- a/common/lcd_console.c +++ b/common/lcd_console.c @@ -59,7 +59,8 @@ static void lcd_putc_xy(ushort x, ushort y, char c) { uchar *dest; ushort row; - int fg_color, bg_color; + int fg_color = lcd_getfgcolor(); + int bg_color = lcd_getbgcolor(); int i; dest = (uchar *)(lcd_console_address + @@ -73,10 +74,6 @@ static void lcd_putc_xy(ushort x, ushort y, char c) #else uchar *d = dest; #endif - - fg_color = lcd_getfgcolor(); - bg_color = lcd_getbgcolor(); - uchar bits; bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row]; -- 1.7.9.5