From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::22a; helo=mail-wr0-x22a.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x22a.google.com (mail-wr0-x22a.google.com [IPv6:2a00:1450:400c:c0c::22a]) (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 79238210F3773 for ; Tue, 12 Jun 2018 15:52:37 -0700 (PDT) Received: by mail-wr0-x22a.google.com with SMTP id w7-v6so683646wrn.6 for ; Tue, 12 Jun 2018 15:52:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4ZoDtH0yRZ1h/HhEkr0nR511mUXVjqMles/rnzQlHVc=; b=d32GkPNVLOubwnRTmi2UqyNKYWb43fIHO/1xNtZ47L8RViiPEYmbE2acG3H2jAjl/O Rkke8f4dlv6vm7CD4r9pR86r/dCk3vbOTXcxLLUv8PTeeoRYFdawQplDwtj0vhU2JgME UY19vK+/oQZ/ZLx6Dr6g6n82laX+OYuZRfSwc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=4ZoDtH0yRZ1h/HhEkr0nR511mUXVjqMles/rnzQlHVc=; b=MfU3P9hDo16TYX4Nfn0OgaNbeOOkvBylt0X75iyuBOoajLjQwrChgW47bbyOXM8w/V OKPORwHKUIggRUeXoxiTVy1oVNqobfA3KDXlJM3cGU6fWUU7fLeAiJgBPlR6VbNEMkPb j249EHJa9RDruILC2MB0vSBAEZVDTvJRlAydVbuPYV2kkSV2HKpyqoX0TFTiSUX71dct qKoqnj8Z9d7EFAgmeu5zU1O1+u7bNELNuBI7nJzqjoaafcbvtCPa5zC6fInnQXduCwn3 jDdEVljwMtDY8X7td45KHjkYg2MvsNc9lFFjIu9h/ZYy74Vv8tGCR5ZtynKrwOrHLRay W0Bg== X-Gm-Message-State: APt69E0FMsJd9EzFE2wbFEp+lVz09xKFeo9Q9qBaO46LXHthoLfi39xF HtDiP3ZVoA90qFN9vaZOPSRP8g== X-Google-Smtp-Source: ADUXVKLnTkikLcoLGngZYFrB7i18TYLXB6USVxyQESnjwhn0KQPUU/a8jp6NDqyv7YqVA2R4vp1pSg== X-Received: by 2002:adf:8f70:: with SMTP id p103-v6mr2205220wrb.181.1528843955978; Tue, 12 Jun 2018 15:52:35 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id r75-v6sm1554517wmg.31.2018.06.12.15.52.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Jun 2018 15:52:34 -0700 (PDT) Date: Tue, 12 Jun 2018 23:52:33 +0100 From: Leif Lindholm To: Ard Biesheuvel Cc: edk2-devel@lists.01.org, michael.d.kinney@intel.com Message-ID: <20180612225233.mxicdnyce2yfwj3i@bivouac.eciton.net> References: <20180607113203.27606-1-ard.biesheuvel@linaro.org> <20180607113203.27606-4-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20180607113203.27606-4-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) 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: Tue, 12 Jun 2018 22:52:38 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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? If so, it has Reviewed-by: Leif Lindholm > --- > 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 >