From nobody Fri Nov 1 12:30:23 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1517240698087898.7514352901627; Mon, 29 Jan 2018 07:44:58 -0800 (PST) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A95992035D315; Mon, 29 Jan 2018 07:39:21 -0800 (PST) Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) (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 A284821E48F2B for ; Mon, 29 Jan 2018 07:39:19 -0800 (PST) Received: by mail-wr0-x244.google.com with SMTP id g21so7702690wrb.13 for ; Mon, 29 Jan 2018 07:44:53 -0800 (PST) Received: from localhost.localdomain ([160.90.205.229]) by smtp.gmail.com with ESMTPSA id m191sm8670928wma.42.2018.01.29.07.44.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jan 2018 07:44:50 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c0c::244; helo=mail-wr0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iNAOdb3XWRVWX4YCO9O/FHMGe6RxWsxYOo6032STq1M=; b=C9yNP3NtR5haO/XioQrgGAKf2EX0fiI2guYpUISTr78OIYsaOZTu85Rn9qHGtBsogQ sPXExzcCF8PCq/ICyNnVtJYQ14aCW9+Tes4Dtmby1uSn6TiR+b95Xl2YpypwpW9vKZzI oCdO6y/kRJ1d6Jc7W8dqc7A1bQICs2QXOSqhE= 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; bh=iNAOdb3XWRVWX4YCO9O/FHMGe6RxWsxYOo6032STq1M=; b=Uoq4H8PdWjwjOZde7JlEeTnK4QyiR7lttblBbtrHYy3Cle5vUEDaXDgvHEQMt+BFQK 4LZr49G3mWW5A5xn+S9oq9tEK77PLKqMtXiseKR7TSBxQ8ul4Vl1qBxTg+X5jyDhdg0h FnEivNSYCFNqlYEDKcw/ckqUuWLccCRpprd6yu6Y84n5cQiDsbirMxPjcyqccktnmbT1 +2RamMSr0LUR9F9pvilwjEs+MJlDbQx/RVPF39EIPATChFftObbWSpIlwO2Ae/5sDFIZ A9nICKu4dBe0sPQ35fUNQAOXknlmQ/7gdeSVZ5DU8bLS61sufOJjqyuTSy819Xqf/AP2 Fmkg== X-Gm-Message-State: AKwxytfySImpR9TM4rjCp1NRRuggveGE/DPnGijbnh0Wio+jrMyDPnfe qtCQfoqesoiq74JgDwS5ok0dhcI3Pqw= X-Google-Smtp-Source: AH8x224RPfCpLlqJEqBpkrfA2/3j4rhMkWrhYhtjgij7s0F2gK3zTMdkNxIasDDeh3eHRJi527mcQA== X-Received: by 10.223.199.207 with SMTP id y15mr18538986wrg.114.1517240691809; Mon, 29 Jan 2018 07:44:51 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 29 Jan 2018 15:44:16 +0000 Message-Id: <20180129154416.3622-5-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180129154416.3622-1-ard.biesheuvel@linaro.org> References: <20180129154416.3622-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH edk2-platforms 4/4] Silicon/SynQuacerPlatformFlashAccessLib: add capsule update progress bar X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Reuse the BootLogoLib graphical progress bar to show the progress of a capsule update, and in absence of a graphical console, write a period to the text console for each block updated. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQua= cerPlatformFlashAccessLib.c | 35 ++++++++++++++++++++ Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/SynQua= cerPlatformFlashAccessLib.inf | 3 ++ 2 files changed, 38 insertions(+) diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAcce= ssLib/SynQuacerPlatformFlashAccessLib.c b/Silicon/Socionext/SynQuacer/Libra= ry/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.c index 5a67f8c00995..fbb8f1f9e48c 100644 --- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/S= ynQuacerPlatformFlashAccessLib.c +++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/S= ynQuacerPlatformFlashAccessLib.c @@ -16,11 +16,13 @@ #include =20 #include +#include #include #include #include #include #include +#include =20 #include =20 @@ -145,6 +147,17 @@ PerformFlashWrite ( 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 Progress; + BOOLEAN HaveBootGraphics; + + Black.Raw =3D 0x00000000; + White.Raw =3D 0x00FFFFFF; + + Status =3D BootLogoEnableLogo (); + HaveBootGraphics =3D !EFI_ERROR (Status); =20 if (FlashAddressType !=3D FlashAddressTypeAbsoluteAddress) { DEBUG ((DEBUG_ERROR, "%a: only FlashAddressTypeAbsoluteAddress support= ed\n", @@ -213,6 +226,16 @@ PerformFlashWrite ( return Status; } =20 + if (HaveBootGraphics) { + Resolution =3D (BlockSize * 100) / Length + 1; + Progress =3D 0; + + Status =3D BootLogoUpdateProgress (White.Pixel, Black.Pixel, + L"Updating firmware - please wait", Black.Pixel, 100, 0); + } else { + Print (L"Updating firmware - please wait "); + } + // // Erase the region // @@ -242,10 +265,22 @@ PerformFlashWrite ( __FUNCTION__, Lba, Status, NumBytes)); } =20 + if (HaveBootGraphics) { + Status =3D BootLogoUpdateProgress (White.Pixel, Black.Pixel, + L"Updating firmware - please wait", White.Pixel, + Progress + Resolution, Progress); + Progress +=3D Resolution; + } else { + Print (L"."); + } + Buffer +=3D BlockSize; Length -=3D BlockSize; Lba++; } + if (!HaveBootGraphics) { + Print (L"\n"); + } =20 return EFI_SUCCESS; } diff --git a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAcce= ssLib/SynQuacerPlatformFlashAccessLib.inf b/Silicon/Socionext/SynQuacer/Lib= rary/SynQuacerPlatformFlashAccessLib/SynQuacerPlatformFlashAccessLib.inf index 33f4795ddcf9..4dfa11372a38 100644 --- a/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/S= ynQuacerPlatformFlashAccessLib.inf +++ b/Silicon/Socionext/SynQuacer/Library/SynQuacerPlatformFlashAccessLib/S= ynQuacerPlatformFlashAccessLib.inf @@ -24,6 +24,7 @@ [Sources] SynQuacerPlatformFlashAccessLib.c =20 [Packages] + MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec SignedCapsulePkg/SignedCapsulePkg.dec =20 @@ -32,7 +33,9 @@ [Protocols] =20 [LibraryClasses] BaseMemoryLib + BootLogoLib DebugLib DxeServicesTableLib UefiBootServicesTableLib + UefiLib =20 --=20 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel