From patchwork Fri Mar 27 07:01:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Schmelzer X-Patchwork-Id: 455322 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 59BD71400DE for ; Fri, 27 Mar 2015 18:03:01 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 90919A7463; Fri, 27 Mar 2015 08:02:59 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Xi4ZfvMqErUu; Fri, 27 Mar 2015 08:02:59 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5839DA7441; Fri, 27 Mar 2015 08:02:56 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9FEF94B6CB for ; Fri, 27 Mar 2015 08:02:31 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wx1HcSoyj5dR for ; Fri, 27 Mar 2015 08:02:31 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from s15287728.onlinehome-server.info (hamspirit.at [87.106.47.214]) by theia.denx.de (Postfix) with ESMTP id 5E8194B6CA for ; Fri, 27 Mar 2015 08:02:29 +0100 (CET) Received: from localhost (s15287728.onlinehome-server.info [127.0.0.1]) by s15287728.onlinehome-server.info (Postfix) with ESMTP id DA7FD8F480CD; Fri, 27 Mar 2015 07:02:20 +0000 (UTC) Received: from s15287728.onlinehome-server.info ([127.0.0.1]) by localhost (s15287728.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CfQnLS1ztcXz; Fri, 27 Mar 2015 07:02:15 +0000 (UTC) Received: from hannes-werkstatt.scm.lan (178-189-207-239.adsl.highway.telekom.at [178.189.207.239]) by s15287728.onlinehome-server.info (Postfix) with ESMTP id 11AFA8F480C9; Fri, 27 Mar 2015 07:02:10 +0000 (UTC) From: Hannes Petermaier To: u-boot@lists.denx.de Date: Fri, 27 Mar 2015 08:01:36 +0100 Message-Id: <1427439699-11126-3-git-send-email-oe5hpm@oevsv.at> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1427439699-11126-1-git-send-email-oe5hpm@oevsv.at> References: <1427439699-11126-1-git-send-email-oe5hpm@oevsv.at> Cc: Tom Rini , sjg@google.com Subject: [U-Boot] [PATCH v4 2/4] common/lcd_console: ask only one-time for bg/fg-color per call X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 v4: None Changes in v3: None 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];