[PATCH v3 1/3] efi_loader: Avoid overwriting previous outputs on console screen clearing

Jan Kiszka jan.kiszka at siemens.com
Mon Nov 7 14:50:34 CET 2022


On 04.11.22 20:08, Simon Glass wrote:
> Hi,
> 
> On Fri, 4 Nov 2022 at 02:07, Jan Kiszka <jan.kiszka at siemens.com> wrote:
>>
>> From: Jan Kiszka <jan.kiszka at 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 at siemens.com>
>> ---
>>  lib/efi_loader/efi_console.c | 8 +++++++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> Please see this thread...some things need to be improved in this area.
> 
> https://patchwork.ozlabs.org/project/uboot/patch/20221022092058.106052-1-heinrich.schuchardt@canonical.com/
> 

Is there a conclusion already? Is there something that I can attach to
to resolve this issue here?

Jan

>>
>> 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");
>> +
>>         /*
>>          * The Linux console wants both a clear and a home command. The video
>>          * uclass does not support <ESC>[H without coordinates, yet.
>> --
>> 2.35.3
>>
> 
> Regards,
> SImon

-- 
Siemens AG, Technology
Competence Center Embedded Linux



More information about the U-Boot mailing list