Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67D67C432BE for ; Thu, 5 Aug 2021 12:01:49 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9EC076113C for ; Thu, 5 Aug 2021 12:01:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9EC076113C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D37C982DF6; Thu, 5 Aug 2021 14:01:46 +0200 (CEST) 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="fohrWtM2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8FA9082DFA; Thu, 5 Aug 2021 14:01:45 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (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 2EF8F80D17 for ; Thu, 5 Aug 2021 14:01:38 +0200 (CEST) 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=1628164891; bh=+9FexnUHRERKyBg9YlYv/wko/UXIfSJUgi2Zxslcf+o=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=fohrWtM2tIc5Y2ThiqnHhW+fD6k7D9Qxhumetw3sm5C0XWXpWoTFX3LhjlyDKEXgT LeVWRB5h6Vitzb6qSOWdMFeAMBkcJFObjfAWK4f2ojP+j0Q5TScwy6N3/IKcKwqMZi 4auERtFUeN+o1NWIhSbhDxbESMph6h96J2rUsQRQ= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.35] ([88.152.144.157]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MStCY-1maL1Z29t8-00UNmf; Thu, 05 Aug 2021 14:01:31 +0200 Subject: Re: [PATCH 4/4] EFI: console: improve vidconsole unicode output To: Artem Lapkin , narmstrong@baylibre.com Cc: u-boot@lists.denx.de, u-boot-amlogic@groups.io, agraf@csgraf.de, trini@konsulko.com, christianshewitt@gmail.com, art@khadas.com, nick@khadas.com, gouwa@khadas.com References: <20210804102217.2419510-1-art@khadas.com> <20210804102217.2419510-5-art@khadas.com> From: Heinrich Schuchardt Message-ID: Date: Thu, 5 Aug 2021 14:01:30 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210804102217.2419510-5-art@khadas.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:SQUf7/kl3iCJgJ0tIkxqcZQqQkdKH8s6IK99BugHn673c08IXuK TDxgBf8ivXXB4P4HwCkFbCF5xqZXYQGVbL3ENCxwMyf8iO90xshA83Q0UdG6AueeTWduLqu YTiCASnVLTXTL0O6/BLZqFq9Oq5etY6PvqP70g7DKgGfnFo6lq5QKuLRqB5PsSSJz7JiITW W4YkMuKFAZrI76/6hPbAw== X-UI-Out-Filterresults: notjunk:1;V03:K0:nrjZVGJHhnc=:4t+CL74eB9Nk1telhmvqgg frbFp1Hn+ks0ZRAggClcgrSJMw+9nt+PJNIoN40Ner1NyFeWO0dd+dBBtgKbq74HJZDcVBM6f rj2RU3tLBGhnkQCwegfxjGEHJ5c0o+k/opALymeiGG41hgwcNudYO9F/BAaXF6sKyEf/jV/7Z Ie9LnHOfwhqK3q3UePkvbcQI0uilBEROLcD0HSErYMvWLgumTJSSHOKApEPVPH5KQBF/4fbtl 48/KcEt/kN+gCisi35B4q74h24EAuIIqkzVr6DzF7KUUyyol/ZJxRy3mHvr8QjboO72iqIRrC Q+V+uGHs+vvaEI0Y3d8E4ORkzFLT2vPjOUYbg0RS5i2WEE+z88fBhEWMvWE3oIwRwF0EZNJ4v R/+iBPpt9CfKZkgwpa8nthT1j+udTWPhWh9Yy8jyXk2MGySG58yvaQkmd2vhLNSuKkhYVYMEo GDIi+0c7lm6us5qgpidRfsSAnjS70mF4xFSDWv1COY/ehKK+QiDK1w4gSORrwmmAOYahut3pY MIne39+WYjdyDyZ4vM+2AlwQJC9ImRZZ7nFxoGpmMqU5w7DdTHXBZOV/U/XnbG3xOk7Y48lhh 2zR6o5oJLmBHGMOhdRdGNEFQNAWqRh1P3hB1ozJvjwoIMBQ42ML+HHc2pPxEVDK/PuGXXoxFA tOtOhK8UfLtzWlL51/VLGgdyc5thlE3Zvasy9w3VCBg8E3TxWa93Phpc15jryAdbSyvvZJpl0 hmfHqlV0KGfo6Tn5Llp43hXqW5ZLXR1HjqnQ4MzIMeqDg2Bxb98dmCmolCr2fYwRCxnS4BN7b MMUC4DYT8jRumvW/yAUmTfkxh136yTDTmRU7TeB5GRpysOXIMrI4Trrnu30qbsQG5NBFVFwCZ BMds0Tb9Pg8Qla5DTToLz0MfyQyULXaygd0NG7qc1nts7MwWWnXrXCHGAGjdCX3swhdKfgyOs UuqPIRIB2n9otvD3LC8eBL0x0vwGmUeGBpTtrDJlDgIVFpV+VZqvpm6HAHeZrgIl+3XKnokcp jKLWErVUygQwp06nCfzu2GQQzYVQZyTAMxJaypwjvTv4xoYSZLWrVWtRvw+EPDlS0eVWO5mHF D+yREnU4/b8I67yl3gKZJ9kRDccSC2094D7FZdbtjyqOauXUHWcwfNHGw== 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.103.2 at phobos.denx.de X-Virus-Status: Clean On 8/4/21 12:22 PM, Artem Lapkin wrote: > If EFI_CONSOLE_UTF_SAFE is enabled and vidconsole is active, unicode > characters will be replaced with "." for all console outputs. The TrueType console is meant to support Unicode including the special characters used by GRUB like left and right triangle. So this patch is based on a wrong assumption. Best regards Heinrich > > Vidconsole does not support unicode output, and your console will suffer > display issues if EFI_CONSOLE_UTF_SAFE is disabled. > > Signed-off-by: Artem Lapkin > --- > lib/efi_loader/Kconfig | 9 +++++++++ > lib/efi_loader/efi_console.c | 6 +++++- > 2 files changed, 14 insertions(+), 1 deletion(-) > > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig > index 7d00d6cde5..886e0ce111 100644 > --- a/lib/efi_loader/Kconfig > +++ b/lib/efi_loader/Kconfig > @@ -393,4 +393,13 @@ config EFI_CONSOLE_MAX_COLS > help > Set console max rows limit or set to zero to disable limit. > > +config EFI_CONSOLE_UTF_SAFE > + bool "If vidconsole is active, unicode characters will be replaced wit= h '.'" > + default n > + help > + If EFI_CONSOLE_UTF_SAFE is enabled and vidconsole is active, unicode > + characters will be replaced with "." for all console outputs. > + Vidconsole does not support unicode output, and your console will > + suffer display issues if EFI_CONSOLE_UTF_SAFE is disabled. > + > endif > diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c > index b5d79d788f..bd1c14995d 100644 > --- a/lib/efi_loader/efi_console.c > +++ b/lib/efi_loader/efi_console.c > @@ -19,6 +19,8 @@ > #define EFI_COUT_MODE_2 2 > #define EFI_MAX_COUT_MODE 3 > > +static int vidconsole_active; > + > struct cout_mode { > unsigned long columns; > unsigned long rows; > @@ -163,7 +165,8 @@ static efi_status_t EFIAPI efi_cout_output_string( > } > pos =3D buf; > utf16_utf8_strcpy(&pos, string); > - fputs(stdout, buf); > + fputs(stdout, IS_ENABLED(CONFIG_EFI_CONSOLE_UTF_SAFE) && > + strlen(buf) > 1 && vidconsole_active ? "." : buf); > free(buf); > > /* > @@ -327,6 +330,7 @@ static int __maybe_unused query_vidconsole(int *rows= , int *cols) > return -ENODEV; > *rows =3D priv->rows; > *cols =3D priv->cols; > + vidconsole_active =3D 1; > return 0; > } > >