From patchwork Sun Dec 28 02:20:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 424286 X-Patchwork-Delegate: sjg@chromium.org 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 C0BFA1400D5 for ; Sun, 28 Dec 2014 13:23:29 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E432A4B6AF; Sun, 28 Dec 2014 03:22:49 +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 x+NDjJbkw0Et; Sun, 28 Dec 2014 03:22:49 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 85C4A4B712; Sun, 28 Dec 2014 03:21:57 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 75E1A4B690 for ; Sun, 28 Dec 2014 03:21:25 +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 RHZBWtHVcgK5 for ; Sun, 28 Dec 2014 03:21:25 +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 mail-qc0-f202.google.com (mail-qc0-f202.google.com [209.85.216.202]) by theia.denx.de (Postfix) with ESMTPS id 611BA4B68A for ; Sun, 28 Dec 2014 03:21:18 +0100 (CET) Received: by mail-qc0-f202.google.com with SMTP id i17so572705qcy.5 for ; Sat, 27 Dec 2014 18:21:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qJSH6KsBgV2TgkxoxV+WiqVl6uBZw5S0qNESIa0WOHI=; b=ZkWNYyL7G84OfJdTWaaehJ5GTcMQGfSy3fUQcoK/8ZkXJ/VP3isHsdEf5hBIunhq9c h5KnA8bcNDIeWmr1r+E5tjpU8RUssYGRHCF9qy0g1JTt6uRtncXngGIcav406odZO2kH UV/DGj9XuhqOtPRzrJ8FHdfOQ+GcVF7k4nZxA8gHCfvfr//FMXo9+TKq8sajL/XG+XRB i/A7SByL7x5mG4xznFybCDChBag1xjwV3uNCi+XhHfA8mXh21CxuBz3wPQDPGhV9iUJy zMdZp6sD+pWI4UMMyPEfPfpBrVQpo+mPPMh992iFaB9cFH2JfOX6S714KUyAGHNMcOGy nrSQ== X-Gm-Message-State: ALoCoQnSpoJfkEiuSMC2FUQK4STU5kiRV4n/+jX/0y0WBLAJmamtP+ycgzn10jfv8QlBFvrj3yMR X-Received: by 10.236.1.37 with SMTP id 25mr39162294yhc.25.1419733277154; Sat, 27 Dec 2014 18:21:17 -0800 (PST) Received: from corpmail-nozzle1-1.hot.corp.google.com ([100.108.1.104]) by gmr-mx.google.com with ESMTPS id 26si1529275yhj.7.2014.12.27.18.21.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 27 Dec 2014 18:21:17 -0800 (PST) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-1.hot.corp.google.com with ESMTP id nyLE6jse.1; Sat, 27 Dec 2014 18:21:17 -0800 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 6BE79220889; Sat, 27 Dec 2014 19:21:16 -0700 (MST) From: Simon Glass To: U-Boot Mailing List Date: Sat, 27 Dec 2014 19:20:28 -0700 Message-Id: <1419733246-5612-5-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1419733246-5612-1-git-send-email-sjg@chromium.org> References: <1419733246-5612-1-git-send-email-sjg@chromium.org> Cc: Graeme Russ Subject: [U-Boot] [PATCH 04/22] x86: video: Add support for CONFIG_CONSOLE_SCROLL_LINES X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 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 Some machines are very slow to scroll their displays. To cope with this, support the CONFIG_CONSOLE_SCROLL_LINES option. Setting this to 5 allows the display to operate at an acceptable speed by scrolling 5 lines at a time. This same option is available for LCDs so when these systems are unified this code can be unified also. Signed-off-by: Simon Glass --- drivers/video/cfb_console.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c index a653bb4..75cdf61 100644 --- a/drivers/video/cfb_console.c +++ b/drivers/video/cfb_console.c @@ -312,7 +312,11 @@ void console_cursor(int state); #define CONSOLE_ROW_SECOND (video_console_address + CONSOLE_ROW_SIZE) #define CONSOLE_ROW_LAST (video_console_address + CONSOLE_SIZE - CONSOLE_ROW_SIZE) #define CONSOLE_SIZE (CONSOLE_ROW_SIZE * CONSOLE_ROWS) -#define CONSOLE_SCROLL_SIZE (CONSOLE_SIZE - CONSOLE_ROW_SIZE) + +/* By default we scroll by a single line */ +#ifndef CONFIG_CONSOLE_SCROLL_LINES +#define CONFIG_CONSOLE_SCROLL_LINES 1 +#endif /* Macros */ #ifdef VIDEO_FB_LITTLE_ENDIAN @@ -753,26 +757,33 @@ static void console_clear_line(int line, int begin, int end) static void console_scrollup(void) { + const int rows = CONFIG_CONSOLE_SCROLL_LINES; + int i; + /* copy up rows ignoring the first one */ #ifdef VIDEO_HW_BITBLT video_hw_bitblt(VIDEO_PIXEL_SIZE, /* bytes per pixel */ 0, /* source pos x */ video_logo_height + - VIDEO_FONT_HEIGHT, /* source pos y */ + VIDEO_FONT_HEIGHT * rows, /* source pos y */ 0, /* dest pos x */ video_logo_height, /* dest pos y */ VIDEO_VISIBLE_COLS, /* frame width */ VIDEO_VISIBLE_ROWS - video_logo_height - - VIDEO_FONT_HEIGHT /* frame height */ + - VIDEO_FONT_HEIGHT * rows /* frame height */ ); #else - memcpyl(CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND, - CONSOLE_SCROLL_SIZE >> 2); + memcpyl(CONSOLE_ROW_FIRST, CONSOLE_ROW_FIRST + rows * CONSOLE_ROW_SIZE, + (CONSOLE_SIZE - CONSOLE_ROW_SIZE * rows) >> 2); #endif /* clear the last one */ - console_clear_line(CONSOLE_ROWS - 1, 0, CONSOLE_COLS - 1); + for (i = 1; i <= rows; i++) + console_clear_line(CONSOLE_ROWS - i, 0, CONSOLE_COLS - 1); + + /* Decrement row number */ + console_row -= rows; } static void console_back(void) @@ -884,9 +895,6 @@ static void console_newline(int n) if (console_row >= CONSOLE_ROWS) { /* Scroll everything up */ console_scrollup(); - - /* Decrement row number */ - console_row = CONSOLE_ROWS - 1; } }