From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.groups.io with SMTP id smtpd.web11.4485.1571067223776910558 for ; Mon, 14 Oct 2019 08:33:43 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: philmd@redhat.com) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B62D5945E for ; Mon, 14 Oct 2019 15:33:43 +0000 (UTC) Received: by mail-wm1-f72.google.com with SMTP id m6so4454154wmf.2 for ; Mon, 14 Oct 2019 08:33:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=QBBprAMCSqZAwBU7QQmqgP6RSAof6u79rPRFqz0WPrA=; b=X3J7V/sFHjWulIsLAsrSrJVwy/UgSctb+cKj9cplMRgLwzk14Lnm6xQ5lG2eRa7zCc Yp/HB+cYo1cquS3KtGc6XPQQjC6/4YZoPbcC6kmgQ6kFI/4UeuGR5uO7GXYl3JdNxXdS sshoTk7JSEXbjIoiukA3QvZvCSGWFamlaw5624a1NlI8nRrr6igyjgTjXQsMt2dsX4ox 6l10LGuGawCJHj3d5PTafqKi4j0KWOMc2H0PqoD75LcUYscABkgcYA1MtvZeW0jjVy14 i6GDQq9eImkrPKN49mPhu8Y50YLOes7tcYCeLzRiHnlRvU9a9Z3RUFP6UM3zCR9bFy8M 3t6Q== X-Gm-Message-State: APjAAAXjiOWXv4behufjKCvmmGK3bvArpnhb/B43t/CO43XQEoJgPwYx +MrQsg6CL4BexIxIE5OHp4ZTF1r8H1BQ/HVDwEmXBq3+RufHNOe8i4J9OIfzSIPXcAmm9VkF0On reyRJOoG47b6ZRw== X-Received: by 2002:a5d:6605:: with SMTP id n5mr11431387wru.54.1571067221825; Mon, 14 Oct 2019 08:33:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyBOhCIXmfB9uPxMFCaCwCQu8yUky1+h65ZYMHYuiYzuqOwSKPMgUeadmYzy2Y+f5gco28mrQ== X-Received: by 2002:a5d:6605:: with SMTP id n5mr11431367wru.54.1571067221604; Mon, 14 Oct 2019 08:33:41 -0700 (PDT) Received: from [192.168.1.35] (46.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.46]) by smtp.gmail.com with ESMTPSA id h14sm26923635wro.44.2019.10.14.08.33.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Oct 2019 08:33:41 -0700 (PDT) Subject: Re: [edk2-devel] [PATCH v2 1/2] OvmfPkg/PlatformBootManagerLib: Don't update progress if Pcd is 0 To: devel@edk2.groups.io, pete@akeo.ie Cc: afish@apple.com, lersek@redhat.com, liming.gao@intel.com References: <20191014150311.16740-1-pete@akeo.ie> <20191014150311.16740-2-pete@akeo.ie> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Message-ID: <29454074-47d3-78c8-fff2-4bdfdac6f354@redhat.com> Date: Mon, 14 Oct 2019 17:33:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <20191014150311.16740-2-pete@akeo.ie> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 10/14/19 5:03 PM, Pete Batard 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 You can keep: Reviewed-by: Philippe Mathieu-Daude > Reviewed-by: Laszlo Ersek > --- > OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c > index 70df6b841acc..8af9b71f18a3 100644 > --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c > +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c > @@ -1631,9 +1631,18 @@ 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 +1652,7 @@ PlatformBootManagerWaitCallback ( > Black.Pixel, > L"Start boot option", > White.Pixel, > - (Timeout - TimeoutRemain) * 100 / Timeout, > + (TimeoutInitial - TimeoutRemain) * 100 / TimeoutInitial, > 0 > ); > } >