24BOOLEAN mDisplayInitialized =
FALSE;
27 LCD_INSTANCE_SIGNATURE,
66 END_ENTIRE_DEVICE_PATH_SUBTYPE,
77LcdInstanceContructor (
84 if (Instance ==
NULL) {
85 return EFI_OUT_OF_RESOURCES;
88 Instance->Gop.
Mode = &Instance->Mode;
90 Instance->Mode.
Info = &Instance->ModeInfo;
92 *NewInstance = Instance;
110 if (EFI_ERROR (Status)) {
116 if (EFI_ERROR (Status)) {
117 goto EXIT_ERROR_LCD_SHUTDOWN;
121 if (EFI_ERROR (Status)) {
122 goto EXIT_ERROR_LCD_SHUTDOWN;
127 Instance->Gop.Mode->FrameBufferBase = VramBaseAddress;
130 mDisplayInitialized =
TRUE;
135EXIT_ERROR_LCD_SHUTDOWN:
136 DEBUG ((DEBUG_ERROR,
"InitializeDisplay: ERROR - Can not initialise the display. Exit Status=%r\n", Status));
146LcdGraphicsOutputDxeInitialize (
155 if (EFI_ERROR (Status)) {
159 Status = LcdInstanceContructor (&Instance);
160 if (EFI_ERROR (Status)) {
165 Status =
gBS->InstallMultipleProtocolInterfaces (
167 &gEfiGraphicsOutputProtocolGuid,
169 &gEfiDevicePathProtocolGuid,
170 &Instance->DevicePath,
174 if (EFI_ERROR (Status)) {
175 DEBUG ((DEBUG_ERROR,
"LcdGraphicsOutputDxeInitialize: Can not install the protocol. Exit Status=%r\n", Status));
183 Status =
gBS->CreateEvent (
184 EVT_SIGNAL_EXIT_BOOT_SERVICES,
188 &Instance->ExitBootServicesEvent
191 if (EFI_ERROR (Status)) {
192 DEBUG ((DEBUG_ERROR,
"LcdGraphicsOutputDxeInitialize: Can not install the ExitBootServicesEvent handler. Exit Status=%r\n", Status));
193 goto EXIT_ERROR_UNINSTALL_PROTOCOL;
199EXIT_ERROR_UNINSTALL_PROTOCOL:
204 gBS->UninstallMultipleProtocolInterfaces (
206 &gEfiGraphicsOutputProtocolGuid,
208 &gEfiDevicePathProtocolGuid,
209 &Instance->DevicePath,
244 IN UINT32 ModeNumber,
252 Instance = LCD_INSTANCE_FROM_GOP_THIS (This);
255 if (!mDisplayInitialized) {
256 Status = InitializeDisplay (Instance);
257 if (EFI_ERROR (Status)) {
263 if ((This ==
NULL) ||
265 (SizeOfInfo ==
NULL) ||
266 (ModeNumber >= This->Mode->MaxMode))
268 DEBUG ((DEBUG_ERROR,
"LcdGraphicsQueryMode: ERROR - For mode number %d : Invalid Parameter.\n", ModeNumber));
269 Status = EFI_INVALID_PARAMETER;
275 Status = EFI_OUT_OF_RESOURCES;
282 if (EFI_ERROR (Status)) {
305 Instance = LCD_INSTANCE_FROM_GOP_THIS (This);
308 if (!mDisplayInitialized) {
309 Status = InitializeDisplay (Instance);
310 if (EFI_ERROR (Status)) {
316 if (ModeNumber >= This->Mode->MaxMode) {
317 DEBUG ((DEBUG_ERROR,
"LcdGraphicsSetMode: ERROR - Unsupported mode number %d .\n", ModeNumber));
318 Status = EFI_UNSUPPORTED;
324 if (EFI_ERROR (Status)) {
325 Status = EFI_DEVICE_ERROR;
330 This->Mode->Mode = ModeNumber;
333 if (EFI_ERROR (Status)) {
334 DEBUG ((DEBUG_ERROR,
"LcdGraphicsSetMode: ERROR - Couldn't get bytes per pixel, status: %r\n", Status));
340 * GetBytesPerPixel (Bpp);
344 if (EFI_ERROR (Status)) {
345 Status = EFI_DEVICE_ERROR;
364 This->Mode->Info->HorizontalResolution,
365 This->Mode->Info->VerticalResolution,
379 case LcdBitsPerPixel_24:
382 case LcdBitsPerPixel_16_565:
383 case LcdBitsPerPixel_16_555:
384 case LcdBitsPerPixel_12_444:
387 case LcdBitsPerPixel_8:
388 case LcdBitsPerPixel_4:
389 case LcdBitsPerPixel_2:
390 case LcdBitsPerPixel_1:
VOID *EFIAPI SetMem(OUT VOID *Buffer, IN UINTN Length, IN UINT8 Value)
#define HARDWARE_DEVICE_PATH
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
EFI_STATUS EFIAPI LcdGraphicsSetMode(IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, IN UINT32 ModeNumber)
VOID LcdGraphicsExitBootServicesEvent(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS EFIAPI LcdGraphicsQueryMode(IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, IN UINT32 ModeNumber, OUT UINTN *SizeOfInfo, OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info)
EFI_STATUS LcdSetMode(IN UINT32 ModeNumber)
EFI_STATUS LcdInitialize(EFI_PHYSICAL_ADDRESS FrameBaseAddress)
EFI_STATUS LcdIdentify(VOID)
#define DEBUG(Expression)
#define FeaturePcdGet(TokenName)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
UINT64 EFI_PHYSICAL_ADDRESS
EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE * Mode
UINT32 VerticalResolution
EFI_GRAPHICS_OUTPUT_MODE_INFORMATION * Info