FB_VIDEO_DEV *FbGopPrivate;\r
PCI_TYPE00 Pci;\r
ACPI_ADR_DEVICE_PATH AcpiDeviceNode;\r
- BOOLEAN ProtocolInstalled;\r
\r
//\r
// Allocate the private device structure for video device\r
//goto Done; \r
}\r
\r
- ProtocolInstalled = FALSE;\r
- \r
//\r
// Creat child handle and install Graphics Output Protocol,EDID Discovered/Active Protocol\r
//\r
if (EFI_ERROR (Status)) {\r
goto Done;\r
}\r
- ProtocolInstalled = TRUE;\r
}\r
\r
Done:\r
EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer;\r
UINTN EntryCount;\r
BOOLEAN HasChild;\r
- EFI_STATUS Status;\r
\r
EntryCount = 0;\r
HasChild = FALSE;\r
- Status = gBS->OpenProtocolInformation (\r
- Controller,\r
- &gEfiPciIoProtocolGuid,\r
- &OpenInfoBuffer,\r
- &EntryCount\r
- );\r
+ gBS->OpenProtocolInformation (\r
+ Controller,\r
+ &gEfiPciIoProtocolGuid,\r
+ &OpenInfoBuffer,\r
+ &EntryCount\r
+ );\r
for (Index = 0; Index < EntryCount; Index++) {\r
if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER) != 0) {\r
HasChild = TRUE;\r
BitsPerPixel = pFbInfo->BitsPerPixel;\r
HorizontalResolution = pFbInfo->HorizontalResolution;\r
VerticalResolution = pFbInfo->VerticalResolution;\r
- BytesPerScanLine = HorizontalResolution * (BitsPerPixel / 8);\r
+ BytesPerScanLine = pFbInfo->BytesPerScanLine;\r
\r
ModeBuffer = (FB_VIDEO_MODE_DATA *) AllocatePool (\r
ModeNumber * sizeof (FB_VIDEO_MODE_DATA)\r
FbGopPrivate->GraphicsOutput.Mode->Info->VerticalResolution = VerticalResolution; \r
FbGopPrivate->GraphicsOutput.Mode->Info->PixelFormat = CurrentModeData->PixelFormat;\r
CopyMem (&(FbGopPrivate->GraphicsOutput.Mode->Info->PixelInformation), &mPixelBitMask, sizeof (EFI_PIXEL_BITMASK)); \r
- FbGopPrivate->GraphicsOutput.Mode->Info->PixelsPerScanLine = HorizontalResolution; \r
+ FbGopPrivate->GraphicsOutput.Mode->Info->PixelsPerScanLine = (UINT32)(BytesPerScanLine * 8 / BitsPerPixel);\r
FbGopPrivate->GraphicsOutput.Mode->SizeOfInfo = sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);\r
FbGopPrivate->GraphicsOutput.Mode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS) (UINTN) CurrentModeData->LinearFrameBuffer;\r
FbGopPrivate->GraphicsOutput.Mode->FrameBufferSize = CurrentModeData->FrameBufferSize;\r