From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 160F7C43217 for ; Mon, 7 Nov 2022 17:18:26 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8CE8184EC7; Mon, 7 Nov 2022 18:18:24 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (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 (2048-bit key; secure) header.d=gmx.de header.i=@gmx.de header.b="diTHgE4A"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0836684E56; Mon, 7 Nov 2022 18:18:23 +0100 (CET) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) (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 AD3C680705 for ; Mon, 7 Nov 2022 18:18:20 +0100 (CET) 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.de; s=s31663417; t=1667841498; bh=H4zQI4Kjr+SCPnjbX8CI6mt9gEUzKMhUsGtB6vLkQmg=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=diTHgE4AtPJo6aWU862kOwoobbV9rpO/SuY3E1W+uAv3Fdrbtvi53JnXPYBKu/dco sc89EVRZoKZjsz1+wrEGO32EDf7CLKpxUfoH0FWieBPzq2ffVUG+/MQlLsmoFUK6cR Cbp3CIWoQfItoqLgynaQQ8BS4NWTR2+2K1Dz00xjm3wSJXMyG2QtD9NaYmblgYWx60 CunGzewYRdd/1rxrgcrpeaRjGDBjtqWG2UjNwpHfsgniCX/H/FbM8clbeT9b6PE4R7 s44GVZtcq3aryQcNJumUVaPuljwgC8C0ElzULUcopS7LL4PzyGgih+D1fCw/Qo3QrW m0qFHVJr1JyZQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.123.67] ([84.118.157.2]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MeU0k-1pSWRZ3zuO-00aYtB; Mon, 07 Nov 2022 18:18:18 +0100 Message-ID: <81f4944c-0089-ca0d-7e50-8e81f7baefc8@gmx.de> Date: Mon, 7 Nov 2022 18:18:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v3 1/3] efi_loader: Avoid overwriting previous outputs on console screen clearing Content-Language: en-US To: Jan Kiszka Cc: U-Boot Mailing List , Simon Glass , Ilias Apalodimas References: <4d7b7acff70af5aa5f356eac78c78addccafc787.1667549199.git.jan.kiszka@siemens.com> <7c50a849-475b-b118-c458-71d16e7b0cee@siemens.com> From: Heinrich Schuchardt In-Reply-To: <7c50a849-475b-b118-c458-71d16e7b0cee@siemens.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:qyUiPda54Cg6oYLB4pcaxTC8w9xOcL0tybszAcYPy0Y6TFYfNPj 230ZnIZBcEyBVP57VF82KXSCr4KXYmFfwdzmlN8pPiZ9KD6vorKJ/RlcdWYjmyDoP0U83PJ m6xO3S0wYZJQFTzJBEzPcB/Pgs3eV6GOs/8nrS0bbcAtimDwWDUoNW6kJwJhFX2TE7dDgh4 yR7RBQirjq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de X-Mailman-Version: 2.1.39 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.6 at phobos.denx.de X-Virus-Status: Clean 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 >>> >>> 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 >>> --- >>> =C2=A0 lib/efi_loader/efi_console.c | 8 +++++++- >>> =C2=A0 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_attribut= e( >>> =C2=A0 } >>> >>> =C2=A0 /** >>> - * efi_cout_clear_screen() - clear screen >>> + * efi_clear_screen() - clear screen >>> =C2=A0=C2=A0 */ >>> =C2=A0 static void efi_clear_screen(void) >>> =C2=A0 { >>> +=C2=A0=C2=A0=C2=A0 unsigned int row; >>> + >>> +=C2=A0=C2=A0=C2=A0 /* Avoid overwriting previous outputs on streaming= consoles */ >>> +=C2=A0=C2=A0=C2=A0 for (row =3D 1; row < efi_cout_modes[efi_con_mode.= mode].rows; row++) >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 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 >