From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by mx.groups.io with SMTP id smtpd.web12.1713.1570807504899909092 for ; Fri, 11 Oct 2019 08:25:05 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=Cc1pjoqb; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.221.67, mailfrom: pete@akeo.ie) Received: by mail-wr1-f67.google.com with SMTP id j18so12374641wrq.10 for ; Fri, 11 Oct 2019 08:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akeo-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hCxYnFxY9xrLtB4GwUvcBdI05YSXPMH+lKDQ9BuhbXg=; b=Cc1pjoqbTHHwY7F2uyWDp4kWU8YKPNkU5nR5x5Vml/zB4GMstjZDpT6LRnNbkZplmW 2qGyNs73NZsky7Hg+5GrLDT/OqpUKXZx/wzVaPd5YI2TvHvQViQNXgQMVIvKm+OCj/7y usH9psQAq40wQQJvHAjD3vbDfKV4jElud0LY/b8ecaYR3Jsh75yE96EgiwtgWuJAzGw3 KaUCsIUIyy9R+C4ukv5XlAdgGMF1/RVmyGBZi1NtMfwcuZlq2sppexMcaGRuuqpE2HFv yRwnePKB4W1V+pOLwwMTrJOgPYR8VMhIBjLXHtWxprd3muWppBiSoum0EkCdMvUVsdGg +9GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hCxYnFxY9xrLtB4GwUvcBdI05YSXPMH+lKDQ9BuhbXg=; b=X6I+fRC6TJrt/QlwdzS9gUXMiOfQ0I77i50zo5YWw7bfXZzWtYS96PUh2eg405C41v yFMt//9DBykzBewB2iwXd1fzT3UzIMcsSpnwsI6tgfiU30KCOJUpbghG5c5fSWp5pgwJ vraalTi8AMZ3ppzz+4Srxn6ev42SN75Ge8j2+fKtZNPCqaJeHykfebW0+dMp6RXm1Tav 1QvKBcrB3Kvb+2h0Rhl2pEx5RSdXwBT/7RxTpom9NG14iUIjB4w+Ris2bYj5sjiMRbNf QDp1Rab/hf3J3UVhllXYzyGeRRsLQTVzu/tmOESN19O3Z9JFnZzbJALqt3wAU7SOExx0 pM0Q== X-Gm-Message-State: APjAAAWmUHGzPO4tsKhj91CxufRbeBCokaUfZE8Dn+N3J7yMMiiRp4hz MqcIgJX/sweUoJNnodQkajovbJrvre8= X-Google-Smtp-Source: APXvYqyWdNJ6L3VUx1dMJVpDhyF5E8ZWAzBzhjcTMwFCCLmi0fHoUj8Fyv/K8EEAROlvXCHtwf+73w== X-Received: by 2002:a5d:4b01:: with SMTP id v1mr13532143wrq.67.1570807503090; Fri, 11 Oct 2019 08:25:03 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([84.203.40.122]) by smtp.gmail.com with ESMTPSA id x16sm6092485wrl.32.2019.10.11.08.25.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Oct 2019 08:25:02 -0700 (PDT) From: "Pete Batard" To: devel@edk2.groups.io Cc: afish@apple.com, lersek@redhat.com, liming.gao@intel.com Subject: [PATCH 1/1] OvmfPkg/PlatformBootManagerLib: Don't update progress if Pcd is 0 Date: Fri, 11 Oct 2019 16:24:51 +0100 Message-Id: <20191011152451.14740-1-pete@akeo.ie> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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