From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c0b::244; helo=mail-it0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 98F57210F6223 for ; Wed, 13 Jun 2018 00:17:00 -0700 (PDT) Received: by mail-it0-x244.google.com with SMTP id 188-v6so2523989ita.5 for ; Wed, 13 Jun 2018 00:17:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=BNJzBStyGK/nGGVAWnMFYQCVGtMQVuKu60OdBGWJElg=; b=AGhqGEiwVIheeWota844iWraKtZ0Ap9ibL15J7tZ5HfwvTWFwRKihm6N8aeUo4iIsy 75AU/OaurLMKJRMdYOajqXEVWbn/rUrN60/vttCFo5OVzwtn/hl354idyShPDcpbnm6O cd6f6sc33f6cLhpBte4fDGJqzIaECmmH3nWHA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=BNJzBStyGK/nGGVAWnMFYQCVGtMQVuKu60OdBGWJElg=; b=F5bOo7MrFsU3RW/CVExTdu5ObtGoJpQ7ESHowtkgTHR3Wl06hLxNzPmeMWl3UTVZAp qvu8z3vX9hGcsiI05gTMX2j6phVA49wRA+xPbBmGn7WKo1cxZYZjkChfUIGekm8rfY1i zKYSIz4bIrDmoiT+Nv3ffse/GG4wIYY884T74TZUkA6jXGqWfEbdJUySIXyx1oggK/hf Sre/AAON9+RrSRyxyEIe1lV1Zjl/sxadKWvWbteT1XitM7teNCn9IVdomErSZOrX6LIh adp0B0wxxnEAYzPOjC8v7v4JeOt6BCoo331r0XU2fUyWdrzblmoCO30cviWeVVvXd7jA u8EA== X-Gm-Message-State: APt69E3fhOpTd4e+0zClhRZ9wPNNgCooYu+Qxvo3ZKAVOJylsS15PqKN /TadNxIu300UaipKNN1n3Gl78npW6Jgp2BcfV4DlXg== X-Google-Smtp-Source: ADUXVKJ4M3WXO1l+/tPhiQDHxM+SxBUJS134s/H3HE8Lb36Iv19qHeg45Xq+XiLO1PIc2TEQXc0+gbT3oKYhGlb9UhQ= X-Received: by 2002:a24:1d0e:: with SMTP id 14-v6mr3557006itj.50.1528874219575; Wed, 13 Jun 2018 00:16:59 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:bbc7:0:0:0:0:0 with HTTP; Wed, 13 Jun 2018 00:16:59 -0700 (PDT) In-Reply-To: <20180612225233.mxicdnyce2yfwj3i@bivouac.eciton.net> References: <20180607113203.27606-1-ard.biesheuvel@linaro.org> <20180607113203.27606-4-ard.biesheuvel@linaro.org> <20180612225233.mxicdnyce2yfwj3i@bivouac.eciton.net> From: Ard Biesheuvel Date: Wed, 13 Jun 2018 09:16:59 +0200 Message-ID: To: Leif Lindholm Cc: "edk2-devel@lists.01.org" , "Kinney, Michael D" Subject: Re: [PATCH edk2-platforms 3/3] Silicon/SynQuacerPlatformFlashAccessLib: replace progress indication X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jun 2018 07:17:00 -0000 Content-Type: text/plain; charset="UTF-8" On 13 June 2018 at 00:52, Leif Lindholm wrote: > On Thu, Jun 07, 2018 at 01:32:03PM +0200, Ard Biesheuvel wrote: >> Replace the home cooked progress indication with calls into the new >> (*Progress)() argument to PerformFlashWriteWithProgress(), which >> allows the flash access routine to report progress via a platform >> provided callback. >> >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Ard Biesheuvel > > I think 1-2 depends on changes that aren't currently happening based > on discussions. If I'm wrong, set me straight. > > However, does this one not make sense on its own? Not really. The progress reporting only works for PersistAcrossReset capsules to begin with. That is essentially what all the fuss is about. I don't necessarily agree with that, but given that Windows and Linux/x86 only use that type of capsule, it made sense for our stuff to get aligned with that. > If so, it has > Reviewed-by: Leif Lindholm > Thanks. >> --- >> Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c | 1 + >> Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c | 44 ++++++-------------- >> Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf | 1 - >> 3 files changed, 14 insertions(+), 32 deletions(-) >> >> diff --git a/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c b/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c >> index 38f1830b5c2e..c5e46dcd4ddf 100644 >> --- a/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c >> +++ b/Silicon/AMD/Styx/Library/StyxPlatformFlashAccessLib/StyxPlatformFlashAccessLib.c >> @@ -72,6 +72,7 @@ PerformFlashWriteWithProgress ( >> { >> EFI_STATUS Status; >> AMD_ISCP_DXE_PROTOCOL *IscpDxeProtocol; >> + UINTN Remaining; >> >> if (FlashAddressType != FlashAddressTypeRelativeAddress) { >> DEBUG ((DEBUG_ERROR, "%a: only FlashAddressTypeRelativeAddress supported\n", >> diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c >> index 48d385993b38..ebb6ce189aa5 100644 >> --- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c >> +++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c >> @@ -17,7 +17,6 @@ >> #include >> >> #include >> -#include >> #include >> #include >> #include >> @@ -195,17 +194,7 @@ PerformFlashWriteWithProgress ( >> EFI_LBA Lba; >> EFI_PHYSICAL_ADDRESS FvbBaseAddress; >> UINTN NumBytes; >> - EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Black; >> - EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION White; >> - UINTN Resolution; >> - UINTN CurrentProgress; >> - BOOLEAN HaveBootGraphics; >> - >> - Black.Raw = 0x00000000; >> - White.Raw = 0x00FFFFFF; >> - >> - Status = BootLogoEnableLogo (); >> - HaveBootGraphics = !EFI_ERROR (Status); >> + UINTN Remaining; >> >> if (FlashAddressType != FlashAddressTypeAbsoluteAddress) { >> DEBUG ((DEBUG_ERROR, "%a: only FlashAddressTypeAbsoluteAddress supported\n", >> @@ -274,14 +263,8 @@ PerformFlashWriteWithProgress ( >> return Status; >> } >> >> - if (HaveBootGraphics) { >> - Resolution = (BlockSize * 100) / Length + 1; >> - CurrentProgress = 0; >> - >> - Status = BootLogoUpdateProgress (White.Pixel, Black.Pixel, >> - L"Updating firmware - please wait", Black.Pixel, 100, 0); >> - } else { >> - Print (L"Updating firmware - please wait "); >> + if (Progress == NULL) { >> + Print (L"\n\nUpdating firmware - please wait "); >> } >> >> // >> @@ -298,7 +281,8 @@ PerformFlashWriteWithProgress ( >> return Status; >> } >> >> - while (Length > 0) { >> + Remaining = Length; >> + while (Remaining > 0) { >> // >> // Write the new data >> // >> @@ -315,20 +299,18 @@ PerformFlashWriteWithProgress ( >> } >> } >> >> - if (HaveBootGraphics) { >> - Status = BootLogoUpdateProgress (White.Pixel, Black.Pixel, >> - L"Updating firmware - please wait", White.Pixel, >> - CurrentProgress + Resolution, CurrentProgress); >> - CurrentProgress += Resolution; >> + Buffer += BlockSize; >> + Remaining -= BlockSize; >> + Lba++; >> + >> + if (Progress != NULL) { >> + Progress (EndPercentage - >> + (Remaining * (EndPercentage - StartPercentage)) / Length); >> } else { >> Print (L"."); >> } >> - >> - Buffer += BlockSize; >> - Length -= BlockSize; >> - Lba++; >> } >> - if (!HaveBootGraphics) { >> + if (Progress == NULL) { >> Print (L"\n"); >> } >> >> diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf >> index 4dfa11372a38..6ca34ada1d03 100644 >> --- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf >> +++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf >> @@ -33,7 +33,6 @@ [Protocols] >> >> [LibraryClasses] >> BaseMemoryLib >> - BootLogoLib >> DebugLib >> DxeServicesTableLib >> UefiBootServicesTableLib >> -- >> 2.17.0 >>