Revision: 13959
          http://edk2.svn.sourceforge.net/edk2/?rev=13959&view=rev
Author:   li-elvin
Date:     2012-11-23 08:24:19 +0000 (Fri, 23 Nov 2012)
Log Message:
-----------
Update FrameBufferSize aligned with UEFI spec.

Signed-off-by: Li Elvin <[email protected]>
Reviewed-by: Ni Ruiyu <[email protected]>

Modified Paths:
--------------
    trunk/edk2/IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c

Modified: trunk/edk2/IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c
===================================================================
--- trunk/edk2/IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c       
2012-11-22 05:07:22 UTC (rev 13958)
+++ trunk/edk2/IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c       
2012-11-23 08:24:19 UTC (rev 13959)
@@ -1662,14 +1662,18 @@
     CurrentModeData->PixelBitMask.GreenMask = ((UINT32) 
CurrentModeData->Green.Mask) << CurrentModeData->Green.Position;
     CurrentModeData->PixelBitMask.BlueMask = ((UINT32) 
CurrentModeData->Blue.Mask) << CurrentModeData->Blue.Position;
     CurrentModeData->PixelBitMask.ReservedMask = ((UINT32) 
CurrentModeData->Reserved.Mask) << CurrentModeData->Reserved.Position;
-    CurrentModeData->FrameBufferSize = 
BiosVideoPrivate->VbeInformationBlock->TotalMemory * 64 * 1024;
 
     CurrentModeData->LinearFrameBuffer = (VOID *) 
(UINTN)BiosVideoPrivate->VbeModeInformationBlock->PhysBasePtr;
     CurrentModeData->HorizontalResolution = 
BiosVideoPrivate->VbeModeInformationBlock->XResolution;
     CurrentModeData->VerticalResolution = 
BiosVideoPrivate->VbeModeInformationBlock->YResolution;
 
     CurrentModeData->BitsPerPixel  = 
BiosVideoPrivate->VbeModeInformationBlock->BitsPerPixel;
-
+    CurrentModeData->FrameBufferSize = CurrentModeData->BytesPerScanLine * 
CurrentModeData->VerticalResolution;
+    //
+    // Make sure the FrameBufferSize does not exceed the max available frame 
buffer size reported by VEB.
+    //
+    ASSERT (CurrentModeData->FrameBufferSize <= 
BiosVideoPrivate->VbeInformationBlock->TotalMemory * 64 * 1024);
+    
     BiosVideoPrivate->ModeData = ModeBuffer;
   }
   //
@@ -2067,12 +2071,8 @@
   CopyMem (&(This->Mode->Info->PixelInformation), &(ModeData->PixelBitMask), 
sizeof (ModeData->PixelBitMask));
   This->Mode->Info->PixelsPerScanLine =  (ModeData->BytesPerScanLine * 8) / 
ModeData->BitsPerPixel;
   This->Mode->SizeOfInfo = sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
-
-  //
-  // Frame BufferSize remain unchanged
-  //
+  This->Mode->FrameBufferSize = ModeData->FrameBufferSize;
   This->Mode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS) (UINTN) 
ModeData->LinearFrameBuffer;
-  This->Mode->FrameBufferSize = ModeData->FrameBufferSize;
 
   BiosVideoPrivate->HardwareNeedsStarting = FALSE;
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to