From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 016B0AC084B for ; Mon, 24 Jul 2023 01:05:43 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=iqPiUiFML2P7ZxP3CLOqheAiGns6VDihdtww+hTAQpM=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-Received:X-Received:X-Received:X-Received:X-WM-Sender:X-Originating-IP:X-WM-AuthFlag:X-WM-AuthUser:From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Thread-Index:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:X-Gm-Message-State:Content-Type:Content-Transfer-Encoding:Content-Language; s=20140610; t=1690160742; v=1; b=EGDy4GGofC2NlNKhGziyZVGuZlMY0kXawAMY2axCXY8S64RmdYwk53lPLszHxw7caXZ66pHl 0W2v7AwAXn3LmTFbQeIPJiWarY5LoTWMFnAr9ogcP+bef3QhXdrOHy19X8uo9PukFlt9u9U1CWv DbrmtANiIrtOofx0cVBpbcUA= X-Received: by 127.0.0.2 with SMTP id eZi5YY7687511xkgh7gEVZRU; Sun, 23 Jul 2023 18:05:42 -0700 X-Received: from zrleap.intel-email.com (zrleap.intel-email.com [114.80.218.36]) by mx.groups.io with SMTP id smtpd.web11.38493.1690160741119941680 for ; Sun, 23 Jul 2023 18:05:41 -0700 X-Received: from zrleap.intel-email.com (localhost [127.0.0.1]) by zrleap.intel-email.com (Postfix) with ESMTP id 284F5A32DFCB for ; Mon, 24 Jul 2023 09:05:35 +0800 (CST) X-Received: from localhost (localhost [127.0.0.1]) by zrleap.intel-email.com (Postfix) with ESMTP id DCA2CA32DFFC for ; Mon, 24 Jul 2023 09:05:34 +0800 (CST) X-Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by zrleap.intel-email.com (Postfix) with SMTP id 07547A32E1A1 for ; Mon, 24 Jul 2023 09:05:30 +0800 (CST) X-Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Mon, 24 Jul 2023 09:05:28 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming via groups.io" To: , Cc: "'Ray Ni'" , "'Zhichao Gao'" , "'Ashraf Ali S'" , "'Chinni B Duggapu'" References: In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIXSBNZGVNb2R1bGVQa2c6IEFsbG9jYXRlUGFnZXMgZm9yIFRyYW5zbGF0ZUJtcFRvR29wQmx0?= Date: Mon, 24 Jul 2023 09:05:29 +0800 Message-ID: <002201d9bdca$f0307010$d0915030$@byosoft.com.cn> MIME-Version: 1.0 Thread-Index: AQJbxWTR5ClvlJgdKNczpGOp7bhgpa7ECsMw Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,gaoliming@byosoft.com.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: hw15XIa4mmQHuoWOiD1eXzAax7686176AA= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=EGDy4GGo; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Chitralekha: I understand this limitation is PEI version AllocatePool. Do you meet wit= h the usage that TranslateBmpToGopBlt is consumed in PEI phase? Thanks Liming > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > =B7=A2=BC=FE=C8=CB: devel@edk2.groups.io =B4=FA=B1= =ED chitralekha > ck > =B7=A2=CB=CD=CA=B1=BC=E4: 2023=C4=EA7=D4=C221=C8=D5 20:13 > =CA=D5=BC=FE=C8=CB: devel@edk2.groups.io > =B3=AD=CB=CD: chitralekha ck ; Ray Ni ; > Zhichao Gao ; Ashraf Ali S ; > Chinni B Duggapu > =D6=F7=CC=E2: [edk2-devel] [PATCH] MdeModulePkg: AllocatePages for > TranslateBmpToGopBlt >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D4507 > AllocatePool limits to allocate memory of 64 KB at most. > if the the image size is higher than that it will fail to allocate. > change the function debug string to __func__ >=20 > Cc: Ray Ni > Cc: Zhichao Gao > Cc: Ashraf Ali S > Cc: Chinni B Duggapu > Signed-off-by: chitralekha ck > --- > .../Library/BaseBmpSupportLib/BmpSupportLib.c | 58 +++++++++++-------- > 1 file changed, 33 insertions(+), 25 deletions(-) >=20 > diff --git a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c > b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c > index c5e885d7a6..d0833a721f 100644 > --- a/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c > +++ b/MdeModulePkg/Library/BaseBmpSupportLib/BmpSupportLib.c > @@ -52,7 +52,7 @@ const BMP_IMAGE_HEADER > mBmpImageHeaderTemplate =3D { > /** > 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. >=20 > @param[in] BmpImage Pointer to BMP file. > @@ -113,14 +113,14 @@ TranslateBmpToGopBlt ( > } >=20 > if (BmpImageSize < sizeof (BMP_IMAGE_HEADER)) { > - DEBUG ((DEBUG_ERROR, "TranslateBmpToGopBlt: BmpImageSize too > small\n")); > + DEBUG ((DEBUG_ERROR, "%a: BmpImageSize too small\n", __func__)); > return RETURN_UNSUPPORTED; > } >=20 > BmpHeader =3D (BMP_IMAGE_HEADER *)BmpImage; >=20 > if ((BmpHeader->CharB !=3D 'B') || (BmpHeader->CharM !=3D 'M')) { > - DEBUG ((DEBUG_ERROR, "TranslateBmpToGopBlt: BmpHeader->Char > fields incorrect\n")); > + DEBUG ((DEBUG_ERROR, "%a: BmpHeader->Char fields incorrect\n", > __func__)); > return RETURN_UNSUPPORTED; > } >=20 > @@ -128,12 +128,12 @@ TranslateBmpToGopBlt ( > // Doesn't support compress. > // > if (BmpHeader->CompressionType !=3D 0) { > - DEBUG ((DEBUG_ERROR, "TranslateBmpToGopBlt: Compression Type > unsupported.\n")); > + DEBUG ((DEBUG_ERROR, "%a: Compression Type unsupported\n", > __func__)); > return RETURN_UNSUPPORTED; > } >=20 > if ((BmpHeader->PixelHeight =3D=3D 0) || (BmpHeader->PixelWidth =3D=3D= 0)) { > - DEBUG ((DEBUG_ERROR, "TranslateBmpToGopBlt: > BmpHeader->PixelHeight or BmpHeader->PixelWidth is 0.\n")); > + DEBUG ((DEBUG_ERROR, "%a: BmpHeader PixelHeight or PixelWidth is > 0\n", __func__)); > return RETURN_UNSUPPORTED; > } >=20 > @@ -144,7 +144,8 @@ TranslateBmpToGopBlt ( > if (BmpHeader->HeaderSize !=3D sizeof (BMP_IMAGE_HEADER) - > OFFSET_OF (BMP_IMAGE_HEADER, HeaderSize)) { > DEBUG (( > DEBUG_ERROR, > - "TranslateBmpToGopBlt: BmpHeader->Headership is not as expected. > Headersize is 0x%x\n", > + "%a: BmpHeader->Headership is not as expected. Headersize is > 0x%x\n", > + __func__, > BmpHeader->HeaderSize > )); > return RETURN_UNSUPPORTED; > @@ -161,7 +162,8 @@ TranslateBmpToGopBlt ( > if (EFI_ERROR (Status)) { > DEBUG (( > DEBUG_ERROR, > - "TranslateBmpToGopBlt: invalid BmpImage... PixelWidth:0x%x > BitPerPixel:0x%x\n", > + "%a: invalid BmpImage. PixelWidth:0x%x BitPerPixel:0x%x\n", > + __func__, > BmpHeader->PixelWidth, > BmpHeader->BitPerPixel > )); > @@ -172,7 +174,8 @@ TranslateBmpToGopBlt ( > if (EFI_ERROR (Status)) { > DEBUG (( > DEBUG_ERROR, > - "TranslateBmpToGopBlt: invalid BmpImage... > DataSizePerLine:0x%x\n", > + "%a: invalid BmpImage. DataSizePerLine:0x%x\n", > + __func__, > DataSizePerLine > )); >=20 > @@ -189,7 +192,8 @@ TranslateBmpToGopBlt ( > if (EFI_ERROR (Status)) { > DEBUG (( > DEBUG_ERROR, > - "TranslateBmpToGopBlt: invalid BmpImage... DataSizePerLine:0x%x > PixelHeight:0x%x\n", > + "%a: invalid BmpImage. DataSizePerLine:0x%x PixelHeight:0x%x\n", > + __func__, > DataSizePerLine, > BmpHeader->PixelHeight > )); > @@ -206,7 +210,8 @@ TranslateBmpToGopBlt ( > if (EFI_ERROR (Status)) { > DEBUG (( > DEBUG_ERROR, > - "TranslateBmpToGopBlt: invalid BmpImage... PixelHeight:0x%x > DataSizePerLine:0x%x\n", > + "%a: invalid BmpImage. PixelHeight:0x%x DataSizePerLine:0x%x\n", > + __func__, > BmpHeader->PixelHeight, > DataSizePerLine > )); > @@ -218,11 +223,11 @@ TranslateBmpToGopBlt ( > (BmpHeader->Size < BmpHeader->ImageOffset) || > (BmpHeader->Size - BmpHeader->ImageOffset !=3D DataSize)) > { > - DEBUG ((DEBUG_ERROR, "TranslateBmpToGopBlt: invalid BmpImage... > \n")); > - DEBUG ((DEBUG_ERROR, " BmpHeader->Size: 0x%x\n", > BmpHeader->Size)); > - DEBUG ((DEBUG_ERROR, " BmpHeader->ImageOffset: 0x%x\n", > BmpHeader->ImageOffset)); > - DEBUG ((DEBUG_ERROR, " BmpImageSize: 0x%lx\n", > (UINTN)BmpImageSize)); > - DEBUG ((DEBUG_ERROR, " DataSize: 0x%lx\n", (UINTN)DataSize)); > + DEBUG ((DEBUG_ERROR, "%a: invalid BmpImage... \n", __func__)); > + DEBUG ((DEBUG_ERROR, " Size: 0x%x\n", BmpHeader->Size)); > + DEBUG ((DEBUG_ERROR, " ImageOffset: 0x%x\n", > BmpHeader->ImageOffset)); > + DEBUG ((DEBUG_ERROR, " BmpImageSize: 0x%lx\n", > (UINTN)BmpImageSize)); > + DEBUG ((DEBUG_ERROR, " DataSize: 0x%lx\n", (UINTN)DataSize)); >=20 > return RETURN_UNSUPPORTED; > } > @@ -279,7 +284,8 @@ TranslateBmpToGopBlt ( > if (EFI_ERROR (Status)) { > DEBUG (( > DEBUG_ERROR, > - "TranslateBmpToGopBlt: invalid BltBuffer needed size... > PixelWidth:0x%x PixelHeight:0x%x\n", > + "%a: invalid BltBuffer needed size. PixelWidth:0x%x > PixelHeight:0x%x\n", > + __func__, > BmpHeader->PixelWidth, > BmpHeader->PixelHeight > )); > @@ -297,7 +303,8 @@ TranslateBmpToGopBlt ( > if (EFI_ERROR (Status)) { > DEBUG (( > DEBUG_ERROR, > - "TranslateBmpToGopBlt: invalid BltBuffer needed size... PixelWidth x > PixelHeight:0x%x struct size:0x%x\n", > + "%a: invalid BltBuffer needed size. PixelWidth x PixelHeight:0x%x > struct size:0x%x\n", > + __func__, > Temp, > sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) > )); > @@ -312,7 +319,7 @@ TranslateBmpToGopBlt ( > // > DEBUG ((DEBUG_INFO, "Bmp Support: Allocating 0x%X bytes of > memory\n", BltBufferSize)); > *GopBltSize =3D (UINTN)BltBufferSize; > - *GopBlt =3D AllocatePool (*GopBltSize); > + *GopBlt =3D AllocatePages (*GopBltSize); > IsAllocated =3D TRUE; > if (*GopBlt =3D=3D NULL) { > return RETURN_OUT_OF_RESOURCES; > @@ -329,13 +336,14 @@ TranslateBmpToGopBlt ( >=20 > *PixelWidth =3D BmpHeader->PixelWidth; > *PixelHeight =3D BmpHeader->PixelHeight; > - DEBUG ((DEBUG_INFO, "BmpHeader->ImageOffset 0x%X\n", > BmpHeader->ImageOffset)); > - DEBUG ((DEBUG_INFO, "BmpHeader->PixelWidth 0x%X\n", > BmpHeader->PixelWidth)); > - DEBUG ((DEBUG_INFO, "BmpHeader->PixelHeight 0x%X\n", > BmpHeader->PixelHeight)); > - DEBUG ((DEBUG_INFO, "BmpHeader->BitPerPixel 0x%X\n", > BmpHeader->BitPerPixel)); > - DEBUG ((DEBUG_INFO, "BmpHeader->ImageSize 0x%X\n", > BmpHeader->ImageSize)); > - DEBUG ((DEBUG_INFO, "BmpHeader->HeaderSize 0x%X\n", > BmpHeader->HeaderSize)); > - DEBUG ((DEBUG_INFO, "BmpHeader->Size 0x%X\n", BmpHeader->Size)); > + DEBUG ((DEBUG_INFO, "BmpHeader :\n")); > + DEBUG ((DEBUG_INFO, " ImageOffset 0x%X\n", > BmpHeader->ImageOffset)); > + DEBUG ((DEBUG_INFO, " PixelWidth 0x%X\n", BmpHeader->PixelWidth)); > + DEBUG ((DEBUG_INFO, " PixelHeight 0x%X\n", BmpHeader->PixelHeight)); > + DEBUG ((DEBUG_INFO, " BitPerPixel 0x%X\n", BmpHeader->BitPerPixel)); > + DEBUG ((DEBUG_INFO, " ImageSize 0x%X\n", BmpHeader->ImageSize)); > + DEBUG ((DEBUG_INFO, " HeaderSize 0x%X\n", > BmpHeader->HeaderSize)); > + DEBUG ((DEBUG_INFO, " Size 0x%X\n", BmpHeader->Size)); >=20 > // > // Translate image from BMP to Blt buffer format > -- > 2.38.1.windows.1 >=20 >=20 >=20 >=20 >=20 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#107146): https://edk2.groups.io/g/devel/message/107146 Mute This Topic: https://groups.io/mt/100321390/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-