From patchwork Mon Oct 8 21:42:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 190143 X-Patchwork-Delegate: twarren@nvidia.com 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 5BF842C0317 for ; Tue, 9 Oct 2012 08:47:14 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4F8F8281D7; Mon, 8 Oct 2012 23:47:12 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 4DzxWTzgwH-o; Mon, 8 Oct 2012 23:47:11 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9F565281D9; Mon, 8 Oct 2012 23:44:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A7602281BC for ; Mon, 8 Oct 2012 23:44:20 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 dAGj5YR3PW6U for ; Mon, 8 Oct 2012 23:44:18 +0200 (CEST) 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 mail-qa0-f74.google.com (mail-qa0-f74.google.com [209.85.216.74]) by theia.denx.de (Postfix) with ESMTPS id 507E428186 for ; Mon, 8 Oct 2012 23:44:11 +0200 (CEST) Received: by mail-qa0-f74.google.com with SMTP id a16so385906qae.3 for ; Mon, 08 Oct 2012 14:44:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=Pbmpb0IAKg13XdFTweHS8PEm7muofaNFxaBiQW5G22U=; b=jPuQ+7jLmMwUwOumIbURD0GHwlKNqh/qwvAONJWTUxedwlAdPWkocPXvKXTbCzGm+n sTD/oalDRoVvAVF9CHnsZ+7iHVcgOvLPt0d3FOfOIhvEgad0ZHvGjzMha+grmBA+v+ul KLf4XQAMcbOYZF6azbvFmo4zMPle0PFVwNU7ovf6CVwGlx9WFZniiW2KuGq06eyZyF/O jXGPWy7/sDhy+1WyjSQTzOmX+BiIcUq+7m2qf8D8f7v7F7YynU18Q1hNv3wouwU9rac5 NlX7kwgh08n3QNQDeMjHXw4CrPGLFYpOBkFC+WZlnNegZzsauY3l2gSm+DXzDJ/4LNf3 PIwQ== Received: by 10.236.79.98 with SMTP id h62mr13643861yhe.16.1349732650723; Mon, 08 Oct 2012 14:44:10 -0700 (PDT) Received: from wpzn4.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id c61si4441926yhm.3.2012.10.08.14.44.10 (version=TLSv1/SSLv3 cipher=AES128-SHA); Mon, 08 Oct 2012 14:44:10 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.73.79]) by wpzn4.hot.corp.google.com (Postfix) with ESMTP id 9C1011E0048; Mon, 8 Oct 2012 14:44:10 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 7B62B1612A7; Mon, 8 Oct 2012 14:44:10 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Mon, 8 Oct 2012 14:42:35 -0700 Message-Id: <1349732556-30700-16-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.7.3 In-Reply-To: <1349732556-30700-1-git-send-email-sjg@chromium.org> References: <1349732556-30700-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQkF4wfu3f6dLm+aWOFeVy2Ewz+vemwE9nBkH6ggf389Iq57DWZCAR1JBVAaul3oGT8jVj/mnlUxXESVyOGWhktUUO4Tw4xdz5pgzKTpCJXX6qVe3uO9visDlE7bWAe7L9Hq4NnumtFWDs6bmHOKxopj8b1+Q6qkFbPGCm0PSFJ60a6v/P5/n86a/9DA3xjujXEmCZBi Cc: Tom Warren Subject: [U-Boot] [PATCH v5 15/16] lcd: Add CONFIG_CONSOLE_SCROLL_LINES option to speed console X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de When the cursor position gets to the end of the LCD console we normally scroll by one line. This adds an option to increase that value. Console scrolling is often slow, and if a large amount of output is being sent, increasing this option to 10 or so will speed things up considerably. Signed-off-by: Simon Glass --- Changes in v5: - Fix CONFIG_CONSOLE_SCROLL_LINES commit title - Fix misleading comments in common/lcd.c Changes in v4: - Use CONFIG_CONSOLE_SCROLL_LINES instead of CONSOLE_SCROLL_LINES - Put default CONFIG_CONSOLE_SCROLL_LINES at top of file Changes in v3: - Fix tiny bug in mult-line lcd scrolling README | 6 ++++++ common/lcd.c | 22 +++++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/README b/README index 42b3172..255d073 100644 --- a/README +++ b/README @@ -1449,6 +1449,12 @@ The following options need to be configured: here, since it is cheaper to change data cache settings on a per-section basis. + CONFIG_CONSOLE_SCROLL_LINES + + When the console need to be scrolled, this is the number of + lines to scroll by. It defaults to 1. Increasing this makes + the console jump but can help speed up operation when scrolling + is slow. - Splash Screen Support: CONFIG_SPLASH_SCREEN diff --git a/common/lcd.c b/common/lcd.c index 74fa3f9..3d53651 100644 --- a/common/lcd.c +++ b/common/lcd.c @@ -76,6 +76,11 @@ #define CONFIG_LCD_ALIGNMENT PAGE_SIZE #endif +/* By default we scroll by a single line */ +#ifndef CONFIG_CONSOLE_SCROLL_LINES +#define CONFIG_CONSOLE_SCROLL_LINES 1 +#endif + DECLARE_GLOBAL_DATA_PTR; ulong lcd_setmem (ulong addr); @@ -131,12 +136,20 @@ void lcd_set_flush_dcache(int flush) static void console_scrollup(void) { - /* Copy up rows ignoring the first one */ - memcpy(CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND, CONSOLE_SCROLL_SIZE); + const int rows = CONFIG_CONSOLE_SCROLL_LINES; + + /* Copy up rows ignoring those that will be overwritten */ + memcpy(CONSOLE_ROW_FIRST, + lcd_console_address + CONSOLE_ROW_SIZE * rows, + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows); + + /* Clear the last rows */ + memset(lcd_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows, + COLOR_MASK(lcd_color_bg), + CONSOLE_ROW_SIZE * rows); - /* Clear the last one */ - memset(CONSOLE_ROW_LAST, COLOR_MASK(lcd_color_bg), CONSOLE_ROW_SIZE); lcd_sync(); + console_row -= rows; } /*----------------------------------------------------------------------*/ @@ -165,7 +178,6 @@ static inline void console_newline(void) if (console_row >= CONSOLE_ROWS) { /* Scroll everything up */ console_scrollup(); - --console_row; } else { lcd_sync(); }