summaryrefslogtreecommitdiffstats
path: root/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe
diff options
context:
space:
mode:
authorOlivier Martin <olivier.martin@arm.com>2013-09-23 09:42:53 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2013-09-23 09:42:53 +0000
commit1d7b547e69b230e39bdd9a821a57c1620228612c (patch)
tree33296f25d107304e49c8b82007a6abee16c76cb7 /ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe
parent433a49a0949bef6c2d526cb9fb80fb0a443c236f (diff)
downloadedk2-1d7b547e69b230e39bdd9a821a57c1620228612c.tar.gz
edk2-1d7b547e69b230e39bdd9a821a57c1620228612c.tar.bz2
edk2-1d7b547e69b230e39bdd9a821a57c1620228612c.zip
LcdGraphicsOutputDxe: Update FrameBufferSize as per UEFI spec section 11.9
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
Diffstat (limited to 'ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe')
-rw-r--r--ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c
index f4165d0003..b42336446c 100644
--- a/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c
+++ b/ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/LcdGraphicsOutputDxe.c
@@ -133,7 +133,6 @@ InitializeDisplay (
// Setup all the relevant mode information
Instance->Gop.Mode->SizeOfInfo = sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
Instance->Gop.Mode->FrameBufferBase = VramBaseAddress;
- Instance->Gop.Mode->FrameBufferSize = VramSize;
// Set the flag before changing the mode, to avoid infinite loops
mDisplayInitialized = TRUE;
@@ -297,7 +296,8 @@ LcdGraphicsSetMode (
{
EFI_STATUS Status = EFI_SUCCESS;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL FillColour;
- LCD_INSTANCE* Instance;
+ LCD_INSTANCE* Instance;
+ LCD_BPP Bpp;
Instance = LCD_INSTANCE_FROM_GOP_THIS (This);
@@ -326,6 +326,14 @@ LcdGraphicsSetMode (
// Update the UEFI mode information
This->Mode->Mode = ModeNumber;
LcdPlatformQueryMode (ModeNumber,&Instance->ModeInfo);
+ Status = LcdPlatformGetBpp(ModeNumber, &Bpp);
+ if (EFI_ERROR(Status)) {
+ DEBUG ((DEBUG_ERROR, "LcdGraphicsSetMode: ERROR - Couldn't get bytes per pixel, status: %r\n", Status));
+ goto EXIT;
+ }
+ This->Mode->FrameBufferSize = Instance->ModeInfo.VerticalResolution
+ * Instance->ModeInfo.PixelsPerScanLine
+ * GetBytesPerPixel(Bpp);
// Set the hardware to the new mode
Status = LcdSetMode (ModeNumber);