-    *GopBlt     = AllocatePool (*GopBltSize);
+    *GopBlt     = AllocatePages (*GopBltSize);

It doesn't look right. You cannot pass in the same value origilly passed to AllocatePool().

Thanks,
Ray

From: Ck, Chitralekha <chitralekha.ck@intel.com>
Sent: Thursday, August 3, 2023 5:29 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Ck, Chitralekha <chitralekha.ck@intel.com>; Ni, Ray <ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>; S, Ashraf Ali <ashraf.ali.s@intel.com>; Duggapu, Chinni B <chinni.b.duggapu@intel.com>
Subject: [PATCH v3] MdeModulePkg: AllocatePages for TranslateBmpToGopBlt
 
https://bugzilla.tianocore.org/show_bug.cgi?id=4507
AllocatePool limits to allocate memory of 64 KB at most in PEI Phase.
AllocatePool() is being avoided due to its 64k allocation size limit
when the library is incorporated into a PEI component.

Cc: Ray Ni <ray.ni@intel.com>
Cc: Zhichao Gao <zhichao.gao@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Cc: Chinni B Duggapu <chinni.b.duggapu@intel.com>
Signed-off-by: chitralekha ck <chitralekha.ck@intel.com>
---
 MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
index c5e885d7a6..a7ebcd1d65 100644
--- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
+++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c
@@ -52,7 +52,7 @@ const BMP_IMAGE_HEADER  mBmpImageHeaderTemplate = {
 /**
   Translate a *.BMP graphics image to a GOP blt buffer. If a NULL Blt buffer
   is passed in a GopBlt buffer will be allocated by this routine using
-  EFI_BOOT_SERVICES.AllocatePool(). If a GopBlt buffer is passed in it will be
+  EFI_BOOT_SERVICES.AllocatePages(). If a GopBlt buffer is passed in it will be
   used if it is big enough.
 
   @param[in]       BmpImage      Pointer to BMP file.
@@ -312,7 +312,7 @@ TranslateBmpToGopBlt (
     //
     DEBUG ((DEBUG_INFO, "Bmp Support: Allocating 0x%X bytes of memory\n", BltBufferSize));
     *GopBltSize = (UINTN)BltBufferSize;
-    *GopBlt     = AllocatePool (*GopBltSize);
+    *GopBlt     = AllocatePages (*GopBltSize);
     IsAllocated = TRUE;
     if (*GopBlt == NULL) {
       return RETURN_OUT_OF_RESOURCES;
--
2.38.1.windows.1

_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#108225) | | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_