All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: Artem Lapkin <email2tema@gmail.com>, 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
Subject: Re: [PATCH 4/4] EFI: console: improve vidconsole unicode output
Date: Thu, 5 Aug 2021 14:01:30 +0200	[thread overview]
Message-ID: <dd0cf63c-03a9-04d8-689e-e3de78d6464f@gmx.de> (raw)
In-Reply-To: <20210804102217.2419510-5-art@khadas.com>

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 <art@khadas.com>
> ---
>   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 with '.'"
> +	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 = 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 = priv->rows;
>   	*cols = priv->cols;
> +	vidconsole_active = 1;
>   	return 0;
>   }
>
>


  reply	other threads:[~2021-08-05 12:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04 10:22 [PATCH 0/4] EFI: console: improves Artem Lapkin
2021-08-04 10:22 ` [PATCH 1/4] EFI: console: query_vidconsole: multiplex adaptation Artem Lapkin
2021-08-05 11:55   ` Heinrich Schuchardt
2021-08-06  7:33     ` Art Nikpal
2021-08-04 10:22 ` [PATCH 2/4] EFI: console: query_console_size: " Artem Lapkin
2021-08-04 10:22 ` [PATCH 3/4] EFI: console: max rows and cols user limit Artem Lapkin
2021-08-05 11:59   ` Heinrich Schuchardt
2021-08-06  7:58     ` Art Nikpal
2021-08-07  6:57       ` Heinrich Schuchardt
2021-08-04 10:22 ` [PATCH 4/4] EFI: console: improve vidconsole unicode output Artem Lapkin
2021-08-05 12:01   ` Heinrich Schuchardt [this message]
2021-08-06  7:47     ` Art Nikpal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dd0cf63c-03a9-04d8-689e-e3de78d6464f@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=agraf@csgraf.de \
    --cc=art@khadas.com \
    --cc=christianshewitt@gmail.com \
    --cc=email2tema@gmail.com \
    --cc=gouwa@khadas.com \
    --cc=narmstrong@baylibre.com \
    --cc=nick@khadas.com \
    --cc=trini@konsulko.com \
    --cc=u-boot-amlogic@groups.io \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.