From: "Andrew Fish" <afish@apple.com>
To: Pete Batard <pete@akeo.ie>
Cc: devel@edk2.groups.io, lersek@redhat.com, liming.gao@intel.com
Subject: Re: [PATCH 1/1] OvmfPkg/PlatformBootManagerLib: Don't update progress if Pcd is 0
Date: Fri, 11 Oct 2019 09:13:31 -0700 [thread overview]
Message-ID: <9C673E1F-A694-4822-BBEE-309B32E480D3@apple.com> (raw)
In-Reply-To: <20191011152451.14740-1-pete@akeo.ie>
Pete,
I agree I was also thinking that and forgot to mention it in my email. Not enough coffee in my system.
Thanks,
Andrew Fish
> On Oct 11, 2019, at 8:24 AM, Pete Batard <pete@akeo.ie> wrote:
>
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2266
>
> Independently of how we decide to address other aspects of the regression
> introduced with commit 2de1f611be06ded3a59726a4052a9039be7d459b, it doesn't
> make much sense to call for a progress update if PcdPlatformBootTimeOut is
> zero.
>
> PcdPlatformBootTimeOut 0, which is the cause of the bug (division by zero)
> should be considered to indicate that a platform is not interested in
> displaying a progress report, so we alter PlatformBootManagerWaitCallback
> to behave that way.
>
> We also change one variable name to make the code more explicit.
>
> Signed-off-by: Pete Batard <pete@akeo.ie>
> ---
> OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
> index 70df6b841acc..352163436e10 100644
> --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
> +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
> @@ -1631,9 +1631,16 @@ PlatformBootManagerWaitCallback (
> {
> EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Black;
> EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION White;
> - UINT16 Timeout;
> + UINT16 TimeoutInitial;
>
> - Timeout = PcdGet16 (PcdPlatformBootTimeOut);
> + TimeoutInitial = PcdGet16 (PcdPlatformBootTimeOut);
> +
> + // If PcdPlatformBootTimeOut is set to zero, then we consider
> + // that no progress update should be enacted (since we'd only
> + // ever display a one-shot progress of either 0% or 100%).
> + if (TimeoutInitial == 0) {
> + return;
> + }
>
> Black.Raw = 0x00000000;
> White.Raw = 0x00FFFFFF;
> @@ -1643,7 +1650,7 @@ PlatformBootManagerWaitCallback (
> Black.Pixel,
> L"Start boot option",
> White.Pixel,
> - (Timeout - TimeoutRemain) * 100 / Timeout,
> + (TimeoutInitial - TimeoutRemain) * 100 / TimeoutInitial,
> 0
> );
> }
> --
> 2.21.0.windows.1
>
next prev parent reply other threads:[~2019-10-11 16:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-11 15:24 [PATCH 1/1] OvmfPkg/PlatformBootManagerLib: Don't update progress if Pcd is 0 Pete Batard
2019-10-11 16:13 ` Andrew Fish [this message]
2019-10-14 9:50 ` [edk2-devel] " Philippe Mathieu-Daudé
2019-10-14 13:29 ` Laszlo Ersek
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-list 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=9C673E1F-A694-4822-BBEE-309B32E480D3@apple.com \
--to=devel@edk2.groups.io \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox