From patchwork Sat Mar 23 01:29:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 1061847 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44R32D2Rwsz9sT4 for ; Sat, 23 Mar 2019 12:33:24 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 06895C21E0D; Sat, 23 Mar 2019 01:32:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 84AE1C2214E; Sat, 23 Mar 2019 01:32:40 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 26E91C2217A; Sat, 23 Mar 2019 01:32:32 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by lists.denx.de (Postfix) with ESMTP id 019F1C2214C for ; Sat, 23 Mar 2019 01:32:29 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A718A1688; Fri, 22 Mar 2019 18:32:23 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 11EA13F71A; Fri, 22 Mar 2019 18:32:21 -0700 (PDT) From: Andre Przywara To: Anatolij Gustschin , Maxime Ripard , Jagan Teki Date: Sat, 23 Mar 2019 01:29:55 +0000 Message-Id: <20190323013002.27117-2-andre.przywara@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190323013002.27117-1-andre.przywara@arm.com> References: <20190323013002.27117-1-andre.przywara@arm.com> Cc: Tom Rini , Alex Graf , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 1/8] video/console: Fix DM_VIDEO font glyph array indexing X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" When the character to be printed on a DM_VIDEO console is from the "extended ASCII" range (0x80 - 0xff), it will be treated as a negative number, as it's declared as a signed char. This leads to negative array indicies into the glyph bitmap array, and random garbled characters. Cast the character to an unsigned type to make the index always positive and avoid an out-of-bounds access. Signed-off-by: Andre Przywara Reviewed-by: Simon Glass --- drivers/video/console_normal.c | 3 ++- drivers/video/console_rotate.c | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/video/console_normal.c b/drivers/video/console_normal.c index 2cfa510d5f..511589eaff 100644 --- a/drivers/video/console_normal.c +++ b/drivers/video/console_normal.c @@ -84,7 +84,8 @@ static int console_normal_putc_xy(struct udevice *dev, uint x_frac, uint y, return -EAGAIN; for (row = 0; row < VIDEO_FONT_HEIGHT; row++) { - uchar bits = video_fontdata[ch * VIDEO_FONT_HEIGHT + row]; + unsigned int idx = (uint8_t)ch * VIDEO_FONT_HEIGHT + row; + uchar bits = video_fontdata[idx]; switch (vid_priv->bpix) { #ifdef CONFIG_VIDEO_BPP8 diff --git a/drivers/video/console_rotate.c b/drivers/video/console_rotate.c index f076570335..e5ebaa03fa 100644 --- a/drivers/video/console_rotate.c +++ b/drivers/video/console_rotate.c @@ -90,7 +90,7 @@ static int console_putc_xy_1(struct udevice *dev, uint x_frac, uint y, char ch) int i, col; int mask = 0x80; void *line; - uchar *pfont = video_fontdata + ch * VIDEO_FONT_HEIGHT; + uchar *pfont = video_fontdata + (uint8_t)ch * VIDEO_FONT_HEIGHT; line = vid_priv->fb + (VID_TO_PIXEL(x_frac) + 1) * vid_priv->line_length - (y + 1) * pbytes; @@ -222,7 +222,8 @@ static int console_putc_xy_2(struct udevice *dev, uint x_frac, uint y, char ch) VIDEO_FONT_WIDTH - 1) * VNBYTES(vid_priv->bpix); for (row = 0; row < VIDEO_FONT_HEIGHT; row++) { - uchar bits = video_fontdata[ch * VIDEO_FONT_HEIGHT + row]; + unsigned int idx = (uint8_t)ch * VIDEO_FONT_HEIGHT + row; + uchar bits = video_fontdata[idx]; switch (vid_priv->bpix) { #ifdef CONFIG_VIDEO_BPP8 @@ -348,7 +349,7 @@ static int console_putc_xy_3(struct udevice *dev, uint x_frac, uint y, char ch) void *line = vid_priv->fb + (vid_priv->ysize - VID_TO_PIXEL(x_frac) - 1) * vid_priv->line_length + y * pbytes; - uchar *pfont = video_fontdata + ch * VIDEO_FONT_HEIGHT; + uchar *pfont = video_fontdata + (uint8_t)ch * VIDEO_FONT_HEIGHT; if (x_frac + VID_TO_POS(vc_priv->x_charsize) > vc_priv->xsize_frac) return -EAGAIN; From patchwork Sat Mar 23 01:29:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 1061848 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44R32D3kWPz9sT5 for ; Sat, 23 Mar 2019 12:33:24 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 2A8FAC21E2B; Sat, 23 Mar 2019 01:32:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 14657C22158; Sat, 23 Mar 2019 01:32:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 140BBC2217F; Sat, 23 Mar 2019 01:32:37 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by lists.denx.de (Postfix) with ESMTP id BCF83C21E3B for ; Sat, 23 Mar 2019 01:32:34 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8A941168F; Fri, 22 Mar 2019 18:32:25 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E8C723F71A; Fri, 22 Mar 2019 18:32:23 -0700 (PDT) From: Andre Przywara To: Anatolij Gustschin , Maxime Ripard , Jagan Teki Date: Sat, 23 Mar 2019 01:29:56 +0000 Message-Id: <20190323013002.27117-3-andre.przywara@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190323013002.27117-1-andre.przywara@arm.com> References: <20190323013002.27117-1-andre.przywara@arm.com> Cc: Tom Rini , Alex Graf , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 2/8] video/console: Implement reverse video ANSI sequence for DM_VIDEO X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" The video console for DM_VIDEO compliant drivers only understands a very small number of ANSI sequences. First and foremost it misses the "reverse video" command, which is used by our own bootmenu command to highlight the selected entry. To avoid forcing people to use their imagination when using the bootmenu, let's just implement the rather simple reverse effect. We need to store the background colour index for that, so that we can recalculate both the foreground and background colour pixel values. Signed-off-by: Andre Przywara Reviewed-by: Simon Glass --- drivers/video/vidconsole-uclass.c | 11 ++++++++++- drivers/video/video-uclass.c | 1 + include/video.h | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 2ca19d4049..87f43c2030 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -360,6 +360,13 @@ static void vidconsole_escape_char(struct udevice *dev, char ch) vid_priv->colour_fg = vid_console_color( vid_priv, vid_priv->fg_col_idx); break; + case 7: + /* reverse video */ + vid_priv->colour_fg = vid_console_color( + vid_priv, vid_priv->bg_col_idx); + vid_priv->colour_bg = vid_console_color( + vid_priv, vid_priv->fg_col_idx); + break; case 30 ... 37: /* foreground color */ vid_priv->fg_col_idx &= ~7; @@ -369,8 +376,10 @@ static void vidconsole_escape_char(struct udevice *dev, char ch) break; case 40 ... 47: /* background color */ + vid_priv->bg_col_idx &= ~7; + vid_priv->bg_col_idx |= val - 40; vid_priv->colour_bg = vid_console_color( - vid_priv, val - 40); + vid_priv, vid_priv->bg_col_idx); break; default: /* ignore unsupported SGR parameter */ diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index f307cf243b..14aac88d6d 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -136,6 +136,7 @@ void video_set_default_colors(struct udevice *dev, bool invert) back = temp; } priv->fg_col_idx = fore; + priv->bg_col_idx = back; priv->colour_fg = vid_console_color(priv, fore); priv->colour_bg = vid_console_color(priv, back); } diff --git a/include/video.h b/include/video.h index 1d57b48b17..485071d072 100644 --- a/include/video.h +++ b/include/video.h @@ -70,6 +70,7 @@ enum video_log2_bpp { * the LCD is updated * @cmap: Colour map for 8-bit-per-pixel displays * @fg_col_idx: Foreground color code (bit 3 = bold, bit 0-2 = color) + * @bg_col_idx: Background color code (bit 3 = bold, bit 0-2 = color) */ struct video_priv { /* Things set up by the driver: */ @@ -92,6 +93,7 @@ struct video_priv { bool flush_dcache; ushort *cmap; u8 fg_col_idx; + u8 bg_col_idx; }; /* Placeholder - there are no video operations at present */ From patchwork Sat Mar 23 01:29:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 1061850 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44R33W4G0Pz9sT3 for ; Sat, 23 Mar 2019 12:34:31 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 545D8C22160; Sat, 23 Mar 2019 01:33:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 8D19CC22109; Sat, 23 Mar 2019 01:32:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C4D18C2208B; Sat, 23 Mar 2019 01:32:37 +0000 (UTC) Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by lists.denx.de (Postfix) with ESMTP id EAF97C22186 for ; Sat, 23 Mar 2019 01:32:35 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6F5801713; Fri, 22 Mar 2019 18:32:27 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CD3C53F71A; Fri, 22 Mar 2019 18:32:25 -0700 (PDT) From: Andre Przywara To: Anatolij Gustschin , Maxime Ripard , Jagan Teki Date: Sat, 23 Mar 2019 01:29:57 +0000 Message-Id: <20190323013002.27117-4-andre.przywara@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190323013002.27117-1-andre.przywara@arm.com> References: <20190323013002.27117-1-andre.przywara@arm.com> Cc: Tom Rini , Alex Graf , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 3/8] video/console: Implement relative cursor movement ANSI handling X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" The ANSI terminal escapce sequence standard defines relative cursor movement commands (ESC [ A-F). So far the DM_VIDEO console code was ignoring them. Interpret those sequences and move the cursor by the requested amount of rows or columns in the right direction. This brings the code on par with the legacy video console driver (cfb_console). Signed-off-by: Andre Przywara Reviewed-by: Simon Glass --- drivers/video/vidconsole-uclass.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 87f43c2030..cbd63f0ce8 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -259,6 +259,43 @@ static void vidconsole_escape_char(struct udevice *dev, char ch) priv->escape = 0; switch (ch) { + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': { + int row, col, num; + char *s = priv->escape_buf; + + /* + * Cursor up/down: [%dA, [%dB, [%dE, [%dF + * Cursor left/right: [%dD, [%dC + */ + s++; /* [ */ + s = parsenum(s, &num); + if (num == 0) /* No digit in sequence ... */ + num = 1; /* ... means "move by 1". */ + + get_cursor_position(priv, &row, &col); + if (ch == 'A' || ch == 'F') + row -= num; + if (ch == 'C') + col += num; + if (ch == 'D') + col -= num; + if (ch == 'B' || ch == 'E') + row += num; + if (ch == 'E' || ch == 'F') + col = 0; + if (col < 0) + col = 0; + if (row < 0) + row = 0; + /* Right and bottom overflows are handled in the callee. */ + set_cursor_position(priv, row, col); + break; + } case 'H': case 'f': { int row, col; From patchwork Sat Mar 23 01:29:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 1061853 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44R34y3BY5z9sT3 for ; Sat, 23 Mar 2019 12:35:46 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 0E37AC22161; Sat, 23 Mar 2019 01:33:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id EBB7AC22163; Sat, 23 Mar 2019 01:32:55 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A4D12C2216A; Sat, 23 Mar 2019 01:32:37 +0000 (UTC) Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by lists.denx.de (Postfix) with ESMTP id EB9A0C22188 for ; Sat, 23 Mar 2019 01:32:35 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5A0E2174E; Fri, 22 Mar 2019 18:32:29 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B16243F71A; Fri, 22 Mar 2019 18:32:27 -0700 (PDT) From: Andre Przywara To: Anatolij Gustschin , Maxime Ripard , Jagan Teki Date: Sat, 23 Mar 2019 01:29:58 +0000 Message-Id: <20190323013002.27117-5-andre.przywara@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190323013002.27117-1-andre.przywara@arm.com> References: <20190323013002.27117-1-andre.przywara@arm.com> Cc: Tom Rini , Alex Graf , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 4/8] video/console: Implement ANSI clear line command X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" There is a standard ANSI terminal escape sequence to clear a whole line of text. So far the DM_VIDEO console was missing this code. Detect the sequence and use vidconsole_set_row with the background colour to fix this omission. Signed-off-by: Andre Przywara Reviewed-by: Simon Glass --- drivers/video/vidconsole-uclass.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index cbd63f0ce8..7d914ed5ca 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -346,6 +346,25 @@ static void vidconsole_escape_char(struct udevice *dev, char ch) } break; } + case 'K': { + struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent); + int mode; + + /* + * Clear (parts of) current line + * [0K - clear line to end + * [2K - clear entire line + */ + parsenum(priv->escape_buf + 1, &mode); + + if (mode == 2) { + int row, col; + + get_cursor_position(priv, &row, &col); + vidconsole_set_row(dev, row, vid_priv->colour_bg); + } + break; + } case 'm': { struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent); char *s = priv->escape_buf; From patchwork Sat Mar 23 01:29:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 1061852 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44R34m1dbTz9sT3 for ; Sat, 23 Mar 2019 12:35:36 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id EC738C22175; Sat, 23 Mar 2019 01:33:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0D566C21D8A; Sat, 23 Mar 2019 01:32:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 47646C21E90; Sat, 23 Mar 2019 01:32:37 +0000 (UTC) Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by lists.denx.de (Postfix) with ESMTP id D97F4C22167 for ; Sat, 23 Mar 2019 01:32:36 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3E1E61993; Fri, 22 Mar 2019 18:32:31 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9C1243F71A; Fri, 22 Mar 2019 18:32:29 -0700 (PDT) From: Andre Przywara To: Anatolij Gustschin , Maxime Ripard , Jagan Teki Date: Sat, 23 Mar 2019 01:29:59 +0000 Message-Id: <20190323013002.27117-6-andre.przywara@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190323013002.27117-1-andre.przywara@arm.com> References: <20190323013002.27117-1-andre.przywara@arm.com> Cc: Tom Rini , Alex Graf , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 5/8] video/console: Factor out actual character output X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" In preparation for doing character set translations, factor out the actual glyph display functionality into a separate function. This will be used in a subsequent patch. Signed-off-by: Andre Przywara Reviewed-by: Simon Glass --- drivers/video/vidconsole-uclass.c | 42 +++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 7d914ed5ca..e16567029a 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -457,6 +457,32 @@ error: priv->escape = 0; } +/* Put that actual character on the screen (using the CP437 code page). */ +static int vidconsole_output_glyph(struct udevice *dev, char ch) +{ + struct vidconsole_priv *priv = dev_get_uclass_priv(dev); + int ret; + + /* + * Failure of this function normally indicates an unsupported + * colour depth. Check this and return an error to help with + * diagnosis. + */ + ret = vidconsole_putc_xy(dev, priv->xcur_frac, priv->ycur, ch); + if (ret == -EAGAIN) { + vidconsole_newline(dev); + ret = vidconsole_putc_xy(dev, priv->xcur_frac, priv->ycur, ch); + } + if (ret < 0) + return ret; + priv->xcur_frac += ret; + priv->last_ch = ch; + if (priv->xcur_frac >= priv->xsize_frac) + vidconsole_newline(dev); + + return 0; +} + int vidconsole_put_char(struct udevice *dev, char ch) { struct vidconsole_priv *priv = dev_get_uclass_priv(dev); @@ -494,23 +520,9 @@ int vidconsole_put_char(struct udevice *dev, char ch) priv->last_ch = 0; break; default: - /* - * Failure of this function normally indicates an unsupported - * colour depth. Check this and return an error to help with - * diagnosis. - */ - ret = vidconsole_putc_xy(dev, priv->xcur_frac, priv->ycur, ch); - if (ret == -EAGAIN) { - vidconsole_newline(dev); - ret = vidconsole_putc_xy(dev, priv->xcur_frac, - priv->ycur, ch); - } + ret = vidconsole_output_glyph(dev, ch); if (ret < 0) return ret; - priv->xcur_frac += ret; - priv->last_ch = ch; - if (priv->xcur_frac >= priv->xsize_frac) - vidconsole_newline(dev); break; } From patchwork Sat Mar 23 01:30:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 1061854 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44R3580bfsz9sRf for ; Sat, 23 Mar 2019 12:35:55 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id B8758C22157; Sat, 23 Mar 2019 01:34:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 5B28DC2208B; Sat, 23 Mar 2019 01:33:39 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 95E62C22133; Sat, 23 Mar 2019 01:32:46 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by lists.denx.de (Postfix) with ESMTP id 5A399C22179 for ; Sat, 23 Mar 2019 01:32:42 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 241E719BF; Fri, 22 Mar 2019 18:32:33 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 81A343F71A; Fri, 22 Mar 2019 18:32:31 -0700 (PDT) From: Andre Przywara To: Anatolij Gustschin , Maxime Ripard , Jagan Teki Date: Sat, 23 Mar 2019 01:30:00 +0000 Message-Id: <20190323013002.27117-7-andre.przywara@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190323013002.27117-1-andre.przywara@arm.com> References: <20190323013002.27117-1-andre.przywara@arm.com> Cc: Tom Rini , Alex Graf , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 6/8] video/console: Convert UTF-8 codes to CP437 code points X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" The character set used by U-Boot's built-in fonts is the old "code page 437" (from the original IBM PC). However people would probably expect UTF-8 on a terminal these days, the UEFI code definitely does. Provide a conversion routine to convert a UTF-8 byte stream into a CP437 character code. This uses a combination of arrays and switch/case statements to provide an efficient way of translating the large Unicode character range to the 8 bits used for CP437. This fixes UEFI display on the DM_VIDEO console, which were garbled for any non-ASCII characters, for instance for the block graphic characters used by Grub to display the menu. Signed-off-by: Andre Przywara --- drivers/video/Makefile | 1 + drivers/video/utf8_cp437.c | 170 ++++++++++++++++++++++++++++++++++++++ drivers/video/vidconsole-uclass.c | 8 +- include/video_console.h | 9 ++ 4 files changed, 186 insertions(+), 2 deletions(-) create mode 100644 drivers/video/utf8_cp437.c diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 671f037c35..8decf407bb 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -12,6 +12,7 @@ obj-$(CONFIG_CONSOLE_TRUETYPE) += console_truetype.o fonts/ obj-$(CONFIG_DISPLAY) += display-uclass.o obj-$(CONFIG_DM_VIDEO) += backlight-uclass.o obj-$(CONFIG_DM_VIDEO) += panel-uclass.o simple_panel.o +obj-$(CONFIG_DM_VIDEO) += utf8_cp437.o obj-$(CONFIG_DM_VIDEO) += video-uclass.o vidconsole-uclass.o obj-$(CONFIG_DM_VIDEO) += video_bmp.o endif diff --git a/drivers/video/utf8_cp437.c b/drivers/video/utf8_cp437.c new file mode 100644 index 0000000000..983da39406 --- /dev/null +++ b/drivers/video/utf8_cp437.c @@ -0,0 +1,170 @@ +/* + * Convert UTF-8 bytes into a code page 437 character. + * Based on the table in the Code_page_437 Wikipedia page. + */ + +#include + +static uint8_t code_points_00a0[] = { + 255, 173, 155, 156, 7, 157, 7, 21, + 7, 7, 166, 174, 170, 7, 7, 7, + 248, 241, 253, 7, 7, 230, 20, 250, + 7, 7, 167, 175, 172, 171, 7, 168, + 7, 7, 7, 7, 142, 143, 146, 128, + 7, 144, 7, 7, 7, 7, 7, 7, + 7, 165, 7, 7, 7, 7, 153, 7, + 7, 7, 7, 7, 154, 7, 7, 225, + 133, 160, 131, 7, 132, 134, 145, 135, + 138, 130, 136, 137, 141, 161, 140, 139, + 7, 164, 149, 162, 147, 7, 148, 246, + 7, 151, 163, 150, 129, 7, 7, 152, +}; + +static uint8_t code_points_2550[] = { + 205, 186, 213, 214, 201, 184, 183, 187, + 212, 211, 200, 190, 189, 188, 198, 199, + 204, 181, 182, 185, 209, 210, 203, 207, + 208, 202, 216, 215, 206 +}; + +static uint8_t utf8_convert_11bit(uint16_t code) +{ + switch (code) { + case 0x0192: return 159; + case 0x0393: return 226; + case 0x0398: return 233; + case 0x03A3: return 228; + case 0x03A6: return 232; + case 0x03A9: return 234; + case 0x03B1: return 224; + case 0x03B4: return 235; + case 0x03B5: return 238; + case 0x03C0: return 227; + case 0x03C3: return 229; + case 0x03C4: return 231; + case 0x03C6: return 237; + } + + return 0; +}; + +static uint8_t utf8_convert_2xxx(uint16_t code) +{ + switch (code) { + case 0x2022: return 7; + case 0x203C: return 19; + case 0x207F: return 252; + case 0x20A7: return 158; + case 0x2190: return 27; + case 0x2191: return 24; + case 0x2192: return 26; + case 0x2193: return 25; + case 0x2194: return 29; + case 0x2195: return 18; + case 0x21A8: return 23; + case 0x2219: return 249; + case 0x221A: return 251; + case 0x221E: return 236; + case 0x221F: return 28; + case 0x2229: return 239; + case 0x2248: return 247; + case 0x2261: return 240; + case 0x2264: return 243; + case 0x2265: return 242; + case 0x2310: return 169; + case 0x2320: return 244; + case 0x2321: return 245; + case 0x2500: return 196; + case 0x2502: return 179; + case 0x250C: return 218; + case 0x2510: return 191; + case 0x2514: return 192; + case 0x2518: return 217; + case 0x251C: return 195; + case 0x2524: return 180; + case 0x252C: return 194; + case 0x2534: return 193; + case 0x253C: return 197; + case 0x2580: return 223; + case 0x2584: return 220; + case 0x2588: return 219; + case 0x258C: return 221; + case 0x2590: return 222; + case 0x2591: return 176; + case 0x2592: return 177; + case 0x2593: return 178; + case 0x25A0: return 254; + case 0x25AC: return 22; + case 0x25B2: return 30; + case 0x25BA: return 16; + case 0x25BC: return 31; + case 0x25C4: return 17; + case 0x25CB: return 9; + case 0x25D8: return 8; + case 0x25D9: return 10; + case 0x263A: return 1; + case 0x263B: return 2; + case 0x263C: return 15; + case 0x2640: return 12; + case 0x2642: return 11; + case 0x2660: return 6; + case 0x2663: return 5; + case 0x2665: return 3; + case 0x2666: return 4; + case 0x266A: return 13; + case 0x266B: return 14; + } + + return 0; +} + +uint8_t convert_uc16_to_cp437(uint16_t code) +{ + if (code < 0x7f) // ASCII + return code; + if (code < 0xa0) // high control characters + return code; + if (code < 0x100) // international characters + return code_points_00a0[code - 0xa0]; + if (code < 0x800) + return utf8_convert_11bit(code); + if (code >= 0x2550 && code < 0x256d) // block graphics + return code_points_2550[code - 0x2550]; + + return utf8_convert_2xxx(code); +} + +uint8_t convert_utf8_to_cp437(uint8_t c, uint32_t *esc) +{ + int shift; + uint32_t ucp; + + if (c < 127) // ASCII + return c; + if (c == 127) + return 8; // DEL (?) + + switch (c & 0xf0) { + case 0xc0: case 0xd0: // two bytes sequence + *esc = (1U << 24) | ((c & 0x1f) << 6); + return 0; + case 0xe0: // three bytes sequence + *esc = (2U << 24) | ((c & 0x0f) << 12); + return 0; + case 0xf0: // four bytes sequence + *esc = (3U << 24) | ((c & 0x07) << 18); + return 0; + case 0x80: case 0x90: case 0xa0: case 0xb0: // continuation + shift = (*esc >> 24) - 1; + ucp = *esc & 0xffffff; + if (shift) { + *esc = (shift << 24) | ucp | (c & 0x3f) << (shift * 6); + return 0; + } + *esc = 0; + + return convert_uc16_to_cp437(ucp | (c & 0x3f)); + } + + return 0; +} diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index e16567029a..275c6c05c8 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -457,7 +457,7 @@ error: priv->escape = 0; } -/* Put that actual character on the screen (using the CP437 code page). */ +/* Put that actual character on the screen (using the font native code page). */ static int vidconsole_output_glyph(struct udevice *dev, char ch) { struct vidconsole_priv *priv = dev_get_uclass_priv(dev); @@ -486,6 +486,7 @@ static int vidconsole_output_glyph(struct udevice *dev, char ch) int vidconsole_put_char(struct udevice *dev, char ch) { struct vidconsole_priv *priv = dev_get_uclass_priv(dev); + uint8_t glyph_idx; int ret; if (priv->escape) { @@ -520,7 +521,10 @@ int vidconsole_put_char(struct udevice *dev, char ch) priv->last_ch = 0; break; default: - ret = vidconsole_output_glyph(dev, ch); + glyph_idx = convert_utf8_to_cp437(ch, &priv->ucs); + if (glyph_idx == 0) /* UTF-8 continuation */ + return 0; + ret = vidconsole_output_glyph(dev, glyph_idx); if (ret < 0) return ret; break; diff --git a/include/video_console.h b/include/video_console.h index 52a41ac200..07e5fd0226 100644 --- a/include/video_console.h +++ b/include/video_console.h @@ -81,6 +81,7 @@ struct vidconsole_priv { int escape_len; int row_saved; int col_saved; + u32 ucs; char escape_buf[32]; }; @@ -240,6 +241,14 @@ void vidconsole_position_cursor(struct udevice *dev, unsigned col, */ u32 vid_console_color(struct video_priv *priv, unsigned int idx); +/* + * Convert an UTF-8 byte into the corresponding character in the CP437 + * code page. Returns 0 if that character is part of a multi-byte sequence. + * for which *esc holds the state of. Repeatedly feed in more bytes until + * the return value is not 0 anymore. + */ +uint8_t convert_utf8_to_cp437(uint8_t c, uint32_t *esc); + #endif #endif From patchwork Sat Mar 23 01:30:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 1061849 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44R3371sS2z9sT3 for ; Sat, 23 Mar 2019 12:34:11 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id DA2B8C22133; Sat, 23 Mar 2019 01:33:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 7CEC6C2217A; Sat, 23 Mar 2019 01:32:52 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E7881C2210C; Sat, 23 Mar 2019 01:32:38 +0000 (UTC) Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by lists.denx.de (Postfix) with ESMTP id E0FEEC22175 for ; Sat, 23 Mar 2019 01:32:36 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 098031A25; Fri, 22 Mar 2019 18:32:35 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 668D43F71A; Fri, 22 Mar 2019 18:32:33 -0700 (PDT) From: Andre Przywara To: Anatolij Gustschin , Maxime Ripard , Jagan Teki Date: Sat, 23 Mar 2019 01:30:01 +0000 Message-Id: <20190323013002.27117-8-andre.przywara@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190323013002.27117-1-andre.przywara@arm.com> References: <20190323013002.27117-1-andre.przywara@arm.com> Cc: Tom Rini , Alex Graf , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 7/8] usb: kbd: Properly translate up/down arrow keys X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" So far arrows key pressed on an USB keyboard got translated to some low ASCII control sequences (Ctrl+N, Ctrl+P). Some programs understand these codes, but the standard for those keys is to use ANSI control sequences for cursor movement (ESC [ A). Our own boot menu is a victim of this, currently we cannot change the selection with an USB keyboard due to this. Since we already implement a queue for USB key codes, we can just insert the three character ANSI sequence into the key buffer. This fixes the bootmenu, and is more universal for other users (UEFI) as well. Signed-off-by: Andre Przywara Reviewed-by: Simon Glass --- common/usb_kbd.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/common/usb_kbd.c b/common/usb_kbd.c index 020f0d4117..cc99c6be07 100644 --- a/common/usb_kbd.c +++ b/common/usb_kbd.c @@ -145,6 +145,12 @@ static void usb_kbd_put_queue(struct usb_kbd_pdata *data, char c) data->usb_kbd_buffer[data->usb_in_pointer] = c; } +static void usb_kbd_put_sequence(struct usb_kbd_pdata *data, char *s) +{ + for (; *s; s++) + usb_kbd_put_queue(data, *s); +} + /* * Set the LEDs. Since this is used in the irq routine, the control job is * issued with a timeout of 0. This means, that the job is queued without @@ -235,9 +241,25 @@ static int usb_kbd_translate(struct usb_kbd_pdata *data, unsigned char scancode, } /* Report keycode if any */ - if (keycode) { + if (keycode) debug("%c", keycode); + + switch (keycode) { + case 0x0e: /* Down arrow key */ + usb_kbd_put_sequence(data, "\e[B"); + break; + case 0x10: /* Up arrow key */ + usb_kbd_put_sequence(data, "\e[A"); + break; + case 0x06: /* Right arrow key */ + usb_kbd_put_sequence(data, "\e[C"); + break; + case 0x02: /* Left arrow key */ + usb_kbd_put_sequence(data, "\e[D"); + break; + default: usb_kbd_put_queue(data, keycode); + break; } return 0; From patchwork Sat Mar 23 01:30:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 1061851 X-Patchwork-Delegate: agust@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=arm.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44R34L6x2Pz9sT3 for ; Sat, 23 Mar 2019 12:35:14 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 8D333C21E90; Sat, 23 Mar 2019 01:34:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 986A7C21D8A; Sat, 23 Mar 2019 01:33:29 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 24833C21E0D; Sat, 23 Mar 2019 01:32:46 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.101.70]) by lists.denx.de (Postfix) with ESMTP id D21FAC21E9F for ; Sat, 23 Mar 2019 01:32:42 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E31EE1AED; Fri, 22 Mar 2019 18:32:36 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4BAF53F71A; Fri, 22 Mar 2019 18:32:35 -0700 (PDT) From: Andre Przywara To: Anatolij Gustschin , Maxime Ripard , Jagan Teki Date: Sat, 23 Mar 2019 01:30:02 +0000 Message-Id: <20190323013002.27117-9-andre.przywara@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190323013002.27117-1-andre.przywara@arm.com> References: <20190323013002.27117-1-andre.przywara@arm.com> Cc: Tom Rini , Alex Graf , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 8/8] sunxi: allow boards to de-select SYS_WHITE_ON_BLACK font scheme X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" In the sunxi-common.h config header we unconditionally define CONFIG_SYS_WHITE_ON_BLACK, although it's actually a Kconfig option which could be individually selected by a user. Remove this #define from the header and let it default to "y" on sunxi boards (like we do for other platforms). Signed-off-by: Andre Przywara Reviewed-by: Simon Glass --- drivers/video/Kconfig | 2 +- include/configs/sunxi-common.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 2eac4b6381..43412873c9 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -120,7 +120,7 @@ config CONSOLE_TRUETYPE_SIZE config SYS_WHITE_ON_BLACK bool "Display console as white on a black background" - default y if ARCH_AT91 || ARCH_EXYNOS || ARCH_ROCKCHIP || TEGRA || X86 + default y if ARCH_AT91 || ARCH_EXYNOS || ARCH_ROCKCHIP || TEGRA || X86 || ARCH_SUNXI help Normally the display is black on a white background, Enable this option to invert this, i.e. white on a black background. This can be diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index b01d1c3c84..ee18260be6 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -449,7 +449,6 @@ extern int soft_i2c_gpio_scl; "stdout=serial,vga\0" \ "stderr=serial,vga\0" #elif CONFIG_DM_VIDEO -#define CONFIG_SYS_WHITE_ON_BLACK #define CONSOLE_STDOUT_SETTINGS \ "stdout=serial,vidconsole\0" \ "stderr=serial,vidconsole\0"