]> git.proxmox.com Git - mirror_edk2.git/commitdiff
LcdGraphicsOutputDxe: Update FrameBufferSize as per UEFI spec section 11.9
authorOlivier Martin <olivier.martin@arm.com>
Mon, 23 Sep 2013 09:42:53 +0000 (09:42 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 23 Sep 2013 09:42:53 +0000 (09:42 +0000)
The shift by 1 on the left was expected. It eases the access to CSSELR and set/way operations
where the cache level field is at the BIT1 position.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14705 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c

index f4165d00030602164c524ac752b190fc4b2ae221..b42336446cdbdf6d3ab29983d874b11b9cad7288 100644 (file)
@@ -133,7 +133,6 @@ InitializeDisplay (
   // Setup all the relevant mode information\r
   Instance->Gop.Mode->SizeOfInfo      = sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);\r
   Instance->Gop.Mode->FrameBufferBase = VramBaseAddress;\r
-  Instance->Gop.Mode->FrameBufferSize = VramSize;\r
 \r
   // Set the flag before changing the mode, to avoid infinite loops\r
   mDisplayInitialized = TRUE;\r
@@ -297,7 +296,8 @@ LcdGraphicsSetMode (
 {\r
        EFI_STATUS                      Status               = EFI_SUCCESS;\r
        EFI_GRAPHICS_OUTPUT_BLT_PIXEL   FillColour;\r
-       LCD_INSTANCE* Instance;\r
+       LCD_INSTANCE*                   Instance;\r
+       LCD_BPP                         Bpp;\r
 \r
        Instance = LCD_INSTANCE_FROM_GOP_THIS (This);\r
 \r
@@ -326,6 +326,14 @@ LcdGraphicsSetMode (
        // Update the UEFI mode information\r
        This->Mode->Mode = ModeNumber;\r
        LcdPlatformQueryMode (ModeNumber,&Instance->ModeInfo);\r
+       Status = LcdPlatformGetBpp(ModeNumber, &Bpp);\r
+       if (EFI_ERROR(Status)) {\r
+         DEBUG ((DEBUG_ERROR, "LcdGraphicsSetMode: ERROR - Couldn't get bytes per pixel, status: %r\n", Status));\r
+         goto EXIT;\r
+       }\r
+       This->Mode->FrameBufferSize =  Instance->ModeInfo.VerticalResolution\r
+                                    * Instance->ModeInfo.PixelsPerScanLine\r
+                                    * GetBytesPerPixel(Bpp);\r
 \r
   // Set the hardware to the new mode\r
        Status = LcdSetMode (ModeNumber);\r