All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Simon Glass <sjg@chromium.org>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>
Subject: Re: [PATCH v3 1/3] efi_loader: Avoid overwriting previous outputs on console screen clearing
Date: Mon, 7 Nov 2022 18:18:15 +0100	[thread overview]
Message-ID: <81f4944c-0089-ca0d-7e50-8e81f7baefc8@gmx.de> (raw)
In-Reply-To: <7c50a849-475b-b118-c458-71d16e7b0cee@siemens.com>

On 11/7/22 17:41, Jan Kiszka wrote:
> On 07.11.22 17:29, Heinrich Schuchardt wrote:
>> On 11/4/22 09:06, Jan Kiszka wrote:
>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>
>>> Before clearing the screen, ensure that no previous output of firmware
>>> or UEFI programs will be overwritten on serial devices or other
>>> streaming consoles. This helps generating complete boot logs.
>>>
>>> Tested regarding multi-output against qemu-x86_defconfig.
>>>
>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>> ---
>>>    lib/efi_loader/efi_console.c | 8 +++++++-
>>>    1 file changed, 7 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/lib/efi_loader/efi_console.c b/lib/efi_loader/efi_console.c
>>> index 4d08dd3763a..6ce0fcc168d 100644
>>> --- a/lib/efi_loader/efi_console.c
>>> +++ b/lib/efi_loader/efi_console.c
>>> @@ -461,10 +461,16 @@ static efi_status_t EFIAPI efi_cout_set_attribute(
>>>    }
>>>
>>>    /**
>>> - * efi_cout_clear_screen() - clear screen
>>> + * efi_clear_screen() - clear screen
>>>     */
>>>    static void efi_clear_screen(void)
>>>    {
>>> +    unsigned int row;
>>> +
>>> +    /* Avoid overwriting previous outputs on streaming consoles */
>>> +    for (row = 1; row < efi_cout_modes[efi_con_mode.mode].rows; row++)
>>> +        printf("\n");
>>> +
>>
>> Scrolling on a framebuffer is a very expensive operations: For each of
>> the 135 lines of an UHD display you have to copy 32 MiB. This would
>> create a delay of multiple seconds on a slow device.
>
> Thanks for explaining this - now. I didn't observe this delay in QEMU,
> but maybe that wasn't representative

My BananaPi is really slow on it.

>
>>
>> So keep the patch for your debugging purposed. But we cannot merge it
>> into upstream.
>
> It's in production - we can't afford shipping without it.
>
> To avoid that this will be the last patch between full upstream and our
> device one day: Do you see a way to confine overwrite protection to real
> streaming device, UARTs and such?

How about putting this behind a Kconfig switch?

You probably should first move the cursor to the lower right corner
before sending carriage returns and then place the cursor in the upper
left corner. Otherwise you cannot be sure that you scrolled all of the
text out of the visible area.

If you use scrolling, why would you still send an ANSI sequence for
clear screen?

Best regards

Heinrich

>
> Thanks,
> Jan
>


  reply	other threads:[~2022-11-07 17:18 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04  8:06 [PATCH v3 0/3] efi_loader: console and network dependency improvements Jan Kiszka
2022-11-04  8:06 ` [PATCH v3 1/3] efi_loader: Avoid overwriting previous outputs on console screen clearing Jan Kiszka
2022-11-04 19:08   ` Simon Glass
2022-11-07 13:50     ` Jan Kiszka
2022-11-07 15:28       ` Simon Glass
2022-11-07 16:13         ` Heinrich Schuchardt
2022-11-07 17:32           ` Simon Glass
2022-11-07 17:55             ` Heinrich Schuchardt
2022-11-07 16:29   ` Heinrich Schuchardt
2022-11-07 16:41     ` Jan Kiszka
2022-11-07 17:18       ` Heinrich Schuchardt [this message]
2022-11-07 18:27         ` Jan Kiszka
2022-11-04  8:06 ` [PATCH v3 2/3] efi_loader: Set default console colors on efi_cout_clear_screen if needed Jan Kiszka
2022-11-07 17:00   ` Jan Kiszka
2022-11-07 17:06   ` Heinrich Schuchardt
2022-11-07 18:05     ` Jan Kiszka
2022-11-04  8:06 ` [PATCH v3 3/3] efi_loader: Let networking support depend on NETDEVICES Jan Kiszka

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=81f4944c-0089-ca0d-7e50-8e81f7baefc8@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jan.kiszka@siemens.com \
    --cc=sjg@chromium.org \
    --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.