diff mbox series

[1/4] EFI: console: query_vidconsole: multiplex adaptation

Message ID 20210804102217.2419510-2-art@khadas.com
State Changes Requested, archived
Delegated to: Heinrich Schuchardt
Headers show
Series EFI: console: improves | expand

Commit Message

Art Nikpal Aug. 4, 2021, 10:22 a.m. UTC
Fixed detection of vidconsole from within a multiplexed stdout string. As
you know, a user can use a comma-separated list of devices to set stdin,
stdout and stderr. For example, "setenv stdout serial,vidconsole" is a
multiplexed string.

Signed-off-by: Artem Lapkin <art@khadas.com>
---
 lib/efi_loader/efi_console.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Heinrich Schuchardt Aug. 5, 2021, 11:55 a.m. UTC | #1
On 8/4/21 12:22 PM, Artem Lapkin wrote:
> Fixed detection of vidconsole from within a multiplexed stdout string. As
> you know, a user can use a comma-separated list of devices to set stdin,
> stdout and stderr. For example, "setenv stdout serial,vidconsole" is a
> multiplexed string.
>
> Signed-off-by: Artem Lapkin <art@khadas.com>
> ---
>   lib/efi_loader/efi_console.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
> index 3b012e1a66..2d03285f82 100644
> --- a/lib/efi_loader/efi_console.c
> +++ b/lib/efi_loader/efi_console.c
> @@ -314,7 +314,7 @@ static int __maybe_unused query_vidconsole(int *rows, int *cols)
>   	struct udevice *dev;
>   	struct vidconsole_priv *priv;
>
> -	if (!stdout_name || strncmp(stdout_name, "vidconsole", 10))
> +	if (!stdout_name || !strstr(stdout_name, "vidconsole"))

If stdout == "serial,vidconsole", serial is the primary output and we
want to determine the size of the console window from serial and not
from vidconsole.

So this change seems wrong.

Best regards

Heinrich

>   		return -ENODEV;
>   	stdout_dev = stdio_get_by_name("vidconsole");
>   	if (!stdout_dev)
>
Art Nikpal Aug. 6, 2021, 7:33 a.m. UTC | #2
> So this change seems wrong.
please check 3rd patch before
https://patchwork.ozlabs.org/project/uboot/patch/20210804102217.2419510-3-art@khadas.com/

i think its must be clarify problem with multiplex output configuration

CONFIG_CONSOLE_MUX=y
CONFIG_CONSOLE_NORMAL=y

please check more information and examples about this
+ https://dl.khadas.com/test/uboot_efi_examples/#readme
+ https://dl.khadas.com/test/uboot_efi_examples/media/01-EFI_console_example_normal_vidconsole_and_serial_as_is_without_changes_NOT_USABLE.png
+ https://dl.khadas.com/test/uboot_efi_examples/media/02-EFI_console_example_true_type_vidconsole_and_serial_as_is_NOT_USABLE.mp4
+ https://dl.khadas.com/test/uboot_efi_examples/media/02-EFI_console_example_true_type_vidconsole_and_serial_as_is_NOT_USABLE.png

On Thu, Aug 5, 2021 at 7:55 PM Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> On 8/4/21 12:22 PM, Artem Lapkin wrote:
> > Fixed detection of vidconsole from within a multiplexed stdout string. As
> > you know, a user can use a comma-separated list of devices to set stdin,
> > stdout and stderr. For example, "setenv stdout serial,vidconsole" is a
> > multiplexed string.
> >
> > Signed-off-by: Artem Lapkin <art@khadas.com>
> > ---
> >   lib/efi_loader/efi_console.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
> > index 3b012e1a66..2d03285f82 100644
> > --- a/lib/efi_loader/efi_console.c
> > +++ b/lib/efi_loader/efi_console.c
> > @@ -314,7 +314,7 @@ static int __maybe_unused query_vidconsole(int *rows, int *cols)
> >       struct udevice *dev;
> >       struct vidconsole_priv *priv;
> >
> > -     if (!stdout_name || strncmp(stdout_name, "vidconsole", 10))
> > +     if (!stdout_name || !strstr(stdout_name, "vidconsole"))
>
> If stdout == "serial,vidconsole", serial is the primary output and we
> want to determine the size of the console window from serial and not
> from vidconsole.
>
> So this change seems wrong.
>
> Best regards
>
> Heinrich
>
> >               return -ENODEV;
> >       stdout_dev = stdio_get_by_name("vidconsole");
> >       if (!stdout_dev)
> >
>
diff mbox series

Patch

diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
index 3b012e1a66..2d03285f82 100644
--- a/lib/efi_loader/efi_console.c
+++ b/lib/efi_loader/efi_console.c
@@ -314,7 +314,7 @@  static int __maybe_unused query_vidconsole(int *rows, int *cols)
 	struct udevice *dev;
 	struct vidconsole_priv *priv;
 
-	if (!stdout_name || strncmp(stdout_name, "vidconsole", 10))
+	if (!stdout_name || !strstr(stdout_name, "vidconsole"))
 		return -ENODEV;
 	stdout_dev = stdio_get_by_name("vidconsole");
 	if (!stdout_dev)