From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web12.4207.1571065406867439576 for ; Mon, 14 Oct 2019 08:03:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@akeo-ie.20150623.gappssmtp.com header.s=20150623 header.b=bJ5bewTS; spf=none, err=permanent DNS error (domain: akeo.ie, ip: 209.85.128.65, mailfrom: pete@akeo.ie) Received: by mail-wm1-f65.google.com with SMTP id v17so17096149wml.4 for ; Mon, 14 Oct 2019 08:03:26 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=cj2PO/qh5TbCDfTYZcf158wY649w3Do0e0ouBnKMrq8=; b=bJ5bewTSNEhVKrVp9fZuitydXw+ki7gZmDMBWlEuC3vEUMPWQhWm4ERm0ocGMQuRBJ 8vPLhVaEjQrCMG7RwZYXXalSH5Yl1KT4Al4XYV6FkZhCCDzIi3wa/7H/y0ijwQztqSwY IINT8VWPs70KSF3ymSCggbFlpqbCgmpJrJhOzzPa4nBhuJG+cvdQuXkBazyjdEu6G4aE nGxAgWNiYjZ1VdXGcrk/BnTR+yysy9SAfjdNaBUlYBPH8kVE6JoLa4YdO2B2FnrOiXRJ X2S9CkNBX4zHueyD6KhdXR1U/mrws9xFNNuGFRN06+sAwKick/U9kpTPHIF6woHjJTp4 EpOw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=cj2PO/qh5TbCDfTYZcf158wY649w3Do0e0ouBnKMrq8=; b=KMkInWWnVQFZWoFaTx9BUVsDp6WtFBCqpbxYNuhPUJOQ48Fg2Ia3V69ojzqo7UgBzq SMiNBHuJzqVBUYNXB7/pmYlgRX7e44zMFyH2NVz6Lkss+L204MZ5lUmpCqud1OyC45mr +Oi6Yc8/j/wSJXTuWMhFyYMPZMW5ELYds3TLswmZHn1N/6Z3j/HyUNcmHAyHJtFVJIh6 ir1LL9FM0g/AIodJ3uho7hRELR1ZuvRkitKASdYWeqEF5cBVehcFU+zc/djL3bEC/kM0 GFdi5fVGNoJZ2bH9zLdAoUp/JWbEZp6ZkqzfKVczzYyesNthnudcHejEoP6lZ4Yh43XW t9cA== X-Gm-Message-State: APjAAAW08rcFG5QfYYg2FF7qiiteKGOPSN/oJh//LrqECFxEHK4XETmT O6cavMNnXJD5MHcS40uElEZNrlu9PTk= X-Google-Smtp-Source: APXvYqxMZ6RDRX5bOlCgu9qqOrPT32d08akCBYlGghLCDJ0vJEyPh8EZQ+cmUcrMzvsEFOdmflmPTw== X-Received: by 2002:a1c:f709:: with SMTP id v9mr16183085wmh.62.1571065405066; Mon, 14 Oct 2019 08:03:25 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([84.203.40.122]) by smtp.gmail.com with ESMTPSA id k24sm391750wmi.1.2019.10.14.08.03.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Oct 2019 08:03:24 -0700 (PDT) From: "Pete Batard" To: devel@edk2.groups.io Cc: afish@apple.com, lersek@redhat.com, liming.gao@intel.com Subject: [PATCH v2 1/2] OvmfPkg/PlatformBootManagerLib: Don't update progress if Pcd is 0 Date: Mon, 14 Oct 2019 16:03:10 +0100 Message-Id: <20191014150311.16740-2-pete@akeo.ie> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20191014150311.16740-1-pete@akeo.ie> References: <20191014150311.16740-1-pete@akeo.ie> 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 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 ); } -- 2.21.0.windows.1