From patchwork Sat Feb 27 13:08:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1445176 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=GkSxQ4a2; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dnn2L02Fhz9sBJ for ; Sun, 28 Feb 2021 00:10:33 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EE74D82789; Sat, 27 Feb 2021 14:10:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="GkSxQ4a2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4FEFD82036; Sat, 27 Feb 2021 14:09:16 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4A80E81FE7 for ; Sat, 27 Feb 2021 14:09:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1614431345; bh=DP91S9Vg6Vr07fZkMMSPOqhn75/7g3UnEiKUlS6EauU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=GkSxQ4a2KAaYgAntbPTnLh0sulXBEKSLPADDzEOzbRqUda/tTmr6njEY2iMf4mHot +UlwtZek9TxxbdMeAF+Nm5F6GGi5HaNuYW88D5PPh+unKxvq8E75zpVI32i17BmKZy 8H3IYgDu3ZqXgEB9Kx2e0LhAg7HnyA06mxIr6yxE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from LT02.fritz.box ([62.143.246.89]) by mail.gmx.net (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MS3il-1lMI2s1Mbb-00TUcE; Sat, 27 Feb 2021 14:09:05 +0100 From: Heinrich Schuchardt To: Alexander Graf , Anatolij Gustschin Cc: u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 5/6] video: use int for character in putc_xy() Date: Sat, 27 Feb 2021 14:08:39 +0100 Message-Id: <20210227130840.166193-6-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210227130840.166193-1-xypron.glpk@gmx.de> References: <20210227130840.166193-1-xypron.glpk@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:vzffYEjyHJHpMWpTAzP862l8g7CXtVsBa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2xf9dfgcHAGUzhj5vds4IssKj6e1Zz+jq5EOeV17Mcybxc+FLYkaSVkTixc8WGfg AsM8LQmqSCXJqISir0Qw== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean The truetype console expects the character to be a Unicode code point. This value cannot be passed as char. Use int instead. Signed-off-by: Heinrich Schuchardt --- drivers/video/console_normal.c | 2 +- drivers/video/console_rotate.c | 6 +++--- drivers/video/console_truetype.c | 2 +- drivers/video/vidconsole-uclass.c | 9 +++++++++ include/video_console.h | 2 +- 5 files changed, 15 insertions(+), 6 deletions(-) -- 2.30.0 diff --git a/drivers/video/console_normal.c b/drivers/video/console_normal.c index 04f022491e..9cfd11ae41 100644 --- a/drivers/video/console_normal.c +++ b/drivers/video/console_normal.c @@ -80,7 +80,7 @@ static int console_normal_move_rows(struct udevice *dev, uint rowdst, } static int console_normal_putc_xy(struct udevice *dev, uint x_frac, uint y, - char ch) + int ch) { struct vidconsole_priv *vc_priv = dev_get_uclass_priv(dev); struct udevice *vid = dev->parent; diff --git a/drivers/video/console_rotate.c b/drivers/video/console_rotate.c index 36c8d0609d..78ca36431f 100644 --- a/drivers/video/console_rotate.c +++ b/drivers/video/console_rotate.c @@ -86,7 +86,7 @@ static int console_move_rows_1(struct udevice *dev, uint rowdst, uint rowsrc, return 0; } -static int console_putc_xy_1(struct udevice *dev, uint x_frac, uint y, char ch) +static int console_putc_xy_1(struct udevice *dev, uint x_frac, uint y, int ch) { struct vidconsole_priv *vc_priv = dev_get_uclass_priv(dev); struct udevice *vid = dev->parent; @@ -221,7 +221,7 @@ static int console_move_rows_2(struct udevice *dev, uint rowdst, uint rowsrc, return 0; } -static int console_putc_xy_2(struct udevice *dev, uint x_frac, uint y, char ch) +static int console_putc_xy_2(struct udevice *dev, uint x_frac, uint y, int ch) { struct vidconsole_priv *vc_priv = dev_get_uclass_priv(dev); struct udevice *vid = dev->parent; @@ -362,7 +362,7 @@ static int console_move_rows_3(struct udevice *dev, uint rowdst, uint rowsrc, return 0; } -static int console_putc_xy_3(struct udevice *dev, uint x_frac, uint y, char ch) +static int console_putc_xy_3(struct udevice *dev, uint x_frac, uint y, int ch) { struct vidconsole_priv *vc_priv = dev_get_uclass_priv(dev); struct udevice *vid = dev->parent; diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index fa11b3bbef..293b3a5ef4 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -198,7 +198,7 @@ static int console_truetype_move_rows(struct udevice *dev, uint rowdst, } static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y, - char ch) + int ch) { struct vidconsole_priv *vc_priv = dev_get_uclass_priv(dev); struct udevice *vid = dev->parent; diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 81b65f5aae..a355328851 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include @@ -509,6 +510,14 @@ int vidconsole_put_char(struct udevice *dev, char ch) struct vidconsole_priv *priv = dev_get_uclass_priv(dev); int ret; + if (IS_ENABLED(CONFIG_EFI_LOADER)) { + static char buffer[5]; + + ch = utf8_to_cp437_stream(ch, buffer); + if (!ch) + return 0; + } + if (priv->escape) { vidconsole_escape_char(dev, ch); return 0; diff --git a/include/video_console.h b/include/video_console.h index 06b798ef10..5e6eb3cc81 100644 --- a/include/video_console.h +++ b/include/video_console.h @@ -106,7 +106,7 @@ struct vidconsole_ops { * if all is OK, -EAGAIN if we ran out of space on this line, other -ve * on error */ - int (*putc_xy)(struct udevice *dev, uint x_frac, uint y, char ch); + int (*putc_xy)(struct udevice *dev, uint x_frac, uint y, int ch); /** * move_rows() - Move text rows from one place to another