]>
Commit | Line | Data |
---|---|---|
677472aa | 1 | /** @file\r |
2 | Library supports diplaying graphical splash screen,\r | |
3 | locking of keyboard input and printing character on\r | |
4 | screen. These basic graphics operations are based on UEFI HII, \r | |
5 | Graphics Output protocol or UGA Draw protocol.\r | |
6 | \r | |
7 | Copyright (c) 2006 - 2008, Intel Corporation\r | |
8 | All rights reserved. This program and the accompanying materials\r | |
9 | are licensed and made available under the terms and conditions of the BSD License\r | |
10 | which accompanies this distribution. The full text of the license may be found at\r | |
11 | http://opensource.org/licenses/bsd-license.php\r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
15 | \r | |
16 | **/\r | |
17 | \r | |
18 | \r | |
19 | #include <PiDxe.h>\r | |
20 | \r | |
21 | #include <Protocol/SimpleTextOut.h>\r | |
22 | #include <Protocol/OEMBadging.h>\r | |
23 | #include <Protocol/ConsoleControl.h>\r | |
24 | #include <Protocol/GraphicsOutput.h>\r | |
25 | #include <Protocol/UgaDraw.h>\r | |
26 | #include <Protocol/HiiFont.h>\r | |
27 | #include <Protocol/HiiImage.h>\r | |
28 | \r | |
29 | #include <Guid/Bmp.h>\r | |
30 | \r | |
31 | #include <Library/GraphicsLib.h>\r | |
32 | #include <Library/PrintLib.h>\r | |
33 | #include <Library/BaseLib.h>\r | |
34 | #include <Library/MemoryAllocationLib.h>\r | |
35 | #include <Library/UefiBootServicesTableLib.h>\r | |
36 | #include <Library/DebugLib.h>\r | |
37 | #include <Library/BaseMemoryLib.h>\r | |
d9efa86d | 38 | #include <Library/DxeServicesLib.h>\r |
677472aa | 39 | #include <Library/PcdLib.h>\r |
40 | \r | |
677472aa | 41 | /**\r |
42 | Convert a *.BMP graphics image to a GOP blt buffer. If a NULL Blt buffer\r | |
43 | is passed in a GopBlt buffer will be allocated by this routine. If a GopBlt\r | |
44 | buffer is passed in it will be used if it is big enough.\r | |
45 | \r | |
46 | @param BmpImage Pointer to BMP file\r | |
47 | @param BmpImageSize Number of bytes in BmpImage\r | |
48 | @param GopBlt Buffer containing GOP version of BmpImage.\r | |
49 | @param GopBltSize Size of GopBlt in bytes.\r | |
50 | @param PixelHeight Height of GopBlt/BmpImage in pixels\r | |
51 | @param PixelWidth Width of GopBlt/BmpImage in pixels\r | |
52 | \r | |
53 | @retval EFI_SUCCESS GopBlt and GopBltSize are returned. \r | |
54 | @retval EFI_UNSUPPORTED BmpImage is not a valid *.BMP image\r | |
55 | @retval EFI_BUFFER_TOO_SMALL The passed in GopBlt buffer is not big enough.\r | |
56 | GopBltSize will contain the required size.\r | |
57 | @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate.\r | |
58 | \r | |
59 | **/\r | |
60 | EFI_STATUS\r | |
61 | EFIAPI\r | |
62 | ConvertBmpToGopBlt (\r | |
63 | IN VOID *BmpImage,\r | |
64 | IN UINTN BmpImageSize,\r | |
65 | IN OUT VOID **GopBlt,\r | |
66 | IN OUT UINTN *GopBltSize,\r | |
67 | OUT UINTN *PixelHeight,\r | |
68 | OUT UINTN *PixelWidth\r | |
69 | )\r | |
70 | {\r | |
71 | UINT8 *Image;\r | |
72 | UINT8 *ImageHeader;\r | |
73 | BMP_IMAGE_HEADER *BmpHeader;\r | |
74 | BMP_COLOR_MAP *BmpColorMap;\r | |
75 | EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer;\r | |
76 | EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Blt;\r | |
77 | UINTN BltBufferSize;\r | |
78 | UINTN Index;\r | |
79 | UINTN Height;\r | |
80 | UINTN Width;\r | |
81 | UINTN ImageIndex;\r | |
82 | BOOLEAN IsAllocated;\r | |
83 | \r | |
84 | BmpHeader = (BMP_IMAGE_HEADER *) BmpImage;\r | |
85 | \r | |
86 | if (BmpHeader->CharB != 'B' || BmpHeader->CharM != 'M') {\r | |
87 | return EFI_UNSUPPORTED;\r | |
88 | }\r | |
89 | \r | |
90 | //\r | |
91 | // Doesn't support compress.\r | |
92 | //\r | |
93 | if (BmpHeader->CompressionType != 0) {\r | |
94 | return EFI_UNSUPPORTED;\r | |
95 | }\r | |
96 | \r | |
97 | //\r | |
98 | // Calculate Color Map offset in the image.\r | |
99 | //\r | |
100 | Image = BmpImage;\r | |
101 | BmpColorMap = (BMP_COLOR_MAP *) (Image + sizeof (BMP_IMAGE_HEADER));\r | |
102 | \r | |
103 | //\r | |
104 | // Calculate graphics image data address in the image\r | |
105 | //\r | |
106 | Image = ((UINT8 *) BmpImage) + BmpHeader->ImageOffset;\r | |
107 | ImageHeader = Image;\r | |
108 | \r | |
109 | //\r | |
110 | // Calculate the BltBuffer needed size.\r | |
111 | //\r | |
112 | BltBufferSize = BmpHeader->PixelWidth * BmpHeader->PixelHeight * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);\r | |
113 | IsAllocated = FALSE;\r | |
114 | if (*GopBlt == NULL) {\r | |
115 | //\r | |
116 | // GopBlt is not allocated by caller.\r | |
117 | //\r | |
118 | *GopBltSize = BltBufferSize;\r | |
119 | *GopBlt = AllocatePool (*GopBltSize);\r | |
120 | IsAllocated = TRUE;\r | |
121 | if (*GopBlt == NULL) {\r | |
122 | return EFI_OUT_OF_RESOURCES;\r | |
123 | }\r | |
124 | } else {\r | |
125 | //\r | |
126 | // GopBlt has been allocated by caller.\r | |
127 | //\r | |
128 | if (*GopBltSize < BltBufferSize) {\r | |
129 | *GopBltSize = BltBufferSize;\r | |
130 | return EFI_BUFFER_TOO_SMALL;\r | |
131 | }\r | |
132 | }\r | |
133 | \r | |
134 | *PixelWidth = BmpHeader->PixelWidth;\r | |
135 | *PixelHeight = BmpHeader->PixelHeight;\r | |
136 | \r | |
137 | //\r | |
138 | // Convert image from BMP to Blt buffer format\r | |
139 | //\r | |
140 | BltBuffer = *GopBlt;\r | |
141 | for (Height = 0; Height < BmpHeader->PixelHeight; Height++) {\r | |
142 | Blt = &BltBuffer[(BmpHeader->PixelHeight - Height - 1) * BmpHeader->PixelWidth];\r | |
143 | for (Width = 0; Width < BmpHeader->PixelWidth; Width++, Image++, Blt++) {\r | |
144 | switch (BmpHeader->BitPerPixel) {\r | |
145 | case 1:\r | |
146 | //\r | |
147 | // Convert 1-bit (2 colors) BMP to 24-bit color\r | |
148 | //\r | |
149 | for (Index = 0; Index < 8 && Width < BmpHeader->PixelWidth; Index++) {\r | |
150 | Blt->Red = BmpColorMap[((*Image) >> (7 - Index)) & 0x1].Red;\r | |
151 | Blt->Green = BmpColorMap[((*Image) >> (7 - Index)) & 0x1].Green;\r | |
152 | Blt->Blue = BmpColorMap[((*Image) >> (7 - Index)) & 0x1].Blue;\r | |
153 | Blt++;\r | |
154 | Width++;\r | |
155 | }\r | |
156 | \r | |
157 | Blt --;\r | |
158 | Width --;\r | |
159 | break;\r | |
160 | \r | |
161 | case 4:\r | |
162 | //\r | |
163 | // Convert 4-bit (16 colors) BMP Palette to 24-bit color\r | |
164 | //\r | |
165 | Index = (*Image) >> 4;\r | |
166 | Blt->Red = BmpColorMap[Index].Red;\r | |
167 | Blt->Green = BmpColorMap[Index].Green;\r | |
168 | Blt->Blue = BmpColorMap[Index].Blue;\r | |
169 | if (Width < (BmpHeader->PixelWidth - 1)) {\r | |
170 | Blt++;\r | |
171 | Width++;\r | |
172 | Index = (*Image) & 0x0f;\r | |
173 | Blt->Red = BmpColorMap[Index].Red;\r | |
174 | Blt->Green = BmpColorMap[Index].Green;\r | |
175 | Blt->Blue = BmpColorMap[Index].Blue;\r | |
176 | }\r | |
177 | break;\r | |
178 | \r | |
179 | case 8:\r | |
180 | //\r | |
181 | // Convert 8-bit (256 colors) BMP Palette to 24-bit color\r | |
182 | //\r | |
183 | Blt->Red = BmpColorMap[*Image].Red;\r | |
184 | Blt->Green = BmpColorMap[*Image].Green;\r | |
185 | Blt->Blue = BmpColorMap[*Image].Blue;\r | |
186 | break;\r | |
187 | \r | |
188 | case 24:\r | |
189 | //\r | |
190 | // It is 24-bit BMP.\r | |
191 | //\r | |
192 | Blt->Blue = *Image++;\r | |
193 | Blt->Green = *Image++;\r | |
194 | Blt->Red = *Image;\r | |
195 | break;\r | |
196 | \r | |
197 | default:\r | |
198 | //\r | |
199 | // Other bit format BMP is not supported.\r | |
200 | //\r | |
201 | if (IsAllocated) {\r | |
202 | FreePool (*GopBlt);\r | |
203 | *GopBlt = NULL;\r | |
204 | }\r | |
205 | return EFI_UNSUPPORTED;\r | |
206 | break;\r | |
207 | };\r | |
208 | \r | |
209 | }\r | |
210 | \r | |
211 | ImageIndex = (UINTN) (Image - ImageHeader);\r | |
212 | if ((ImageIndex % 4) != 0) {\r | |
213 | //\r | |
214 | // Bmp Image starts each row on a 32-bit boundary!\r | |
215 | //\r | |
216 | Image = Image + (4 - (ImageIndex % 4));\r | |
217 | }\r | |
218 | }\r | |
219 | \r | |
220 | return EFI_SUCCESS;\r | |
221 | }\r | |
222 | \r | |
223 | \r | |
224 | /**\r | |
225 | Use Console Control Protocol to lock the Console In Spliter virtual handle. \r | |
226 | This is the ConInHandle and ConIn handle in the EFI system table. All key\r | |
227 | presses will be ignored until the Password is typed in. The only way to\r | |
228 | disable the password is to type it in to a ConIn device.\r | |
229 | \r | |
230 | @param Password Password used to lock ConIn device.\r | |
231 | \r | |
232 | @retval EFI_SUCCESS lock the Console In Spliter virtual handle successfully.\r | |
233 | @retval EFI_UNSUPPORTED Password not found.\r | |
234 | \r | |
235 | **/\r | |
236 | EFI_STATUS\r | |
237 | EFIAPI\r | |
238 | LockKeyboards (\r | |
239 | IN CHAR16 *Password\r | |
240 | )\r | |
241 | {\r | |
242 | EFI_STATUS Status;\r | |
243 | EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl;\r | |
244 | \r | |
245 | Status = gBS->LocateProtocol (&gEfiConsoleControlProtocolGuid, NULL, (VOID **) &ConsoleControl);\r | |
246 | if (EFI_ERROR (Status)) {\r | |
247 | return EFI_UNSUPPORTED;\r | |
248 | }\r | |
249 | \r | |
250 | Status = ConsoleControl->LockStdIn (ConsoleControl, Password);\r | |
251 | return Status;\r | |
252 | }\r | |
253 | \r | |
254 | \r | |
255 | /**\r | |
256 | Use Console Control to turn off UGA based Simple Text Out consoles from going\r | |
257 | to the UGA device. Put up LogoFile on every UGA device that is a console.\r | |
258 | \r | |
259 | @param LogoFile File name of logo to display on the center of the screen.\r | |
260 | \r | |
261 | @retval EFI_SUCCESS ConsoleControl has been flipped to graphics and logo displayed.\r | |
262 | @retval EFI_UNSUPPORTED Logo not found.\r | |
263 | \r | |
264 | **/\r | |
265 | EFI_STATUS\r | |
266 | EFIAPI\r | |
267 | EnableQuietBoot (\r | |
268 | IN EFI_GUID *LogoFile\r | |
269 | )\r | |
270 | {\r | |
271 | return EnableQuietBootEx (LogoFile, NULL);\r | |
272 | }\r | |
273 | \r | |
274 | /**\r | |
275 | Use Console Control to turn off UGA based Simple Text Out consoles from going\r | |
276 | to the UGA device. Put up LogoFile on every UGA device that is a console\r | |
277 | \r | |
278 | @param LogoFile File name of logo to display on the center of the screen.\r | |
279 | @param ImageHandle The driver image handle of the caller. The parameter is used to\r | |
280 | optimize the loading of the logo file so that the FV from which\r | |
281 | the driver image is loaded will be tried first.\r | |
282 | \r | |
283 | @retval EFI_SUCCESS ConsoleControl has been flipped to graphics and logo displayed.\r | |
284 | @retval EFI_UNSUPPORTED Logo not found.\r | |
285 | \r | |
286 | **/\r | |
287 | EFI_STATUS\r | |
288 | EFIAPI\r | |
289 | EnableQuietBootEx (\r | |
290 | IN EFI_GUID *LogoFile,\r | |
291 | IN EFI_HANDLE ImageHandle\r | |
292 | )\r | |
293 | {\r | |
294 | EFI_STATUS Status;\r | |
295 | EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl;\r | |
296 | EFI_OEM_BADGING_PROTOCOL *Badging;\r | |
297 | UINT32 SizeOfX;\r | |
298 | UINT32 SizeOfY;\r | |
299 | INTN DestX;\r | |
300 | INTN DestY;\r | |
301 | UINT8 *ImageData;\r | |
302 | UINTN ImageSize;\r | |
303 | UINTN BltSize;\r | |
304 | UINT32 Instance;\r | |
305 | EFI_BADGING_FORMAT Format;\r | |
306 | EFI_BADGING_DISPLAY_ATTRIBUTE Attribute;\r | |
307 | UINTN CoordinateX;\r | |
308 | UINTN CoordinateY;\r | |
309 | UINTN Height;\r | |
310 | UINTN Width;\r | |
311 | EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Blt;\r | |
312 | EFI_UGA_DRAW_PROTOCOL *UgaDraw;\r | |
313 | UINT32 ColorDepth;\r | |
314 | UINT32 RefreshRate;\r | |
315 | EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;\r | |
316 | \r | |
317 | Status = gBS->LocateProtocol (&gEfiConsoleControlProtocolGuid, NULL, (VOID **) &ConsoleControl);\r | |
318 | if (EFI_ERROR (Status)) {\r | |
319 | return EFI_UNSUPPORTED;\r | |
320 | }\r | |
321 | \r | |
322 | UgaDraw = NULL;\r | |
323 | //\r | |
324 | // Try to open GOP first\r | |
325 | //\r | |
326 | Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID **) &GraphicsOutput);\r | |
327 | if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {\r | |
328 | GraphicsOutput = NULL;\r | |
329 | //\r | |
330 | // Open GOP failed, try to open UGA\r | |
331 | //\r | |
332 | Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiUgaDrawProtocolGuid, (VOID **) &UgaDraw);\r | |
333 | }\r | |
334 | if (EFI_ERROR (Status)) {\r | |
335 | return EFI_UNSUPPORTED;\r | |
336 | }\r | |
337 | \r | |
338 | Badging = NULL;\r | |
339 | Status = gBS->LocateProtocol (&gEfiOEMBadgingProtocolGuid, NULL, (VOID **) &Badging);\r | |
340 | \r | |
341 | //\r | |
342 | // Set console control to graphics mode.\r | |
343 | //\r | |
344 | Status = ConsoleControl->SetMode (ConsoleControl, EfiConsoleControlScreenGraphics);\r | |
345 | if (EFI_ERROR (Status)) {\r | |
346 | return EFI_UNSUPPORTED;\r | |
347 | }\r | |
348 | \r | |
349 | if (GraphicsOutput != NULL) {\r | |
350 | SizeOfX = GraphicsOutput->Mode->Info->HorizontalResolution;\r | |
351 | SizeOfY = GraphicsOutput->Mode->Info->VerticalResolution;\r | |
352 | } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {\r | |
353 | Status = UgaDraw->GetMode (UgaDraw, &SizeOfX, &SizeOfY, &ColorDepth, &RefreshRate);\r | |
354 | if (EFI_ERROR (Status)) {\r | |
355 | return EFI_UNSUPPORTED;\r | |
356 | }\r | |
357 | } else {\r | |
358 | return EFI_UNSUPPORTED;\r | |
359 | }\r | |
360 | \r | |
361 | Instance = 0;\r | |
362 | while (1) {\r | |
363 | ImageData = NULL;\r | |
364 | ImageSize = 0;\r | |
365 | \r | |
366 | if (Badging != NULL) {\r | |
367 | //\r | |
368 | // Get image from OEMBadging protocol.\r | |
369 | //\r | |
370 | Status = Badging->GetImage (\r | |
371 | Badging,\r | |
372 | &Instance,\r | |
373 | &Format,\r | |
374 | &ImageData,\r | |
375 | &ImageSize,\r | |
376 | &Attribute,\r | |
377 | &CoordinateX,\r | |
378 | &CoordinateY\r | |
379 | );\r | |
380 | if (EFI_ERROR (Status)) {\r | |
381 | return Status;\r | |
382 | }\r | |
383 | \r | |
384 | //\r | |
385 | // Currently only support BMP format.\r | |
386 | //\r | |
387 | if (Format != EfiBadgingFormatBMP) {\r | |
676df92c | 388 | if (ImageData != NULL) {\r |
389 | FreePool (ImageData);\r | |
390 | }\r | |
677472aa | 391 | continue;\r |
392 | }\r | |
393 | } else {\r | |
394 | //\r | |
395 | // Get the specified image from FV.\r | |
396 | //\r | |
404c7958 | 397 | Status = GetSectionFromAnyFv (LogoFile, EFI_SECTION_RAW, 0, (VOID **) &ImageData, &ImageSize);\r |
677472aa | 398 | if (EFI_ERROR (Status)) {\r |
399 | return EFI_UNSUPPORTED;\r | |
400 | }\r | |
401 | \r | |
402 | CoordinateX = 0;\r | |
403 | CoordinateY = 0;\r | |
404 | Attribute = EfiBadgingDisplayAttributeCenter;\r | |
405 | }\r | |
406 | \r | |
407 | Blt = NULL;\r | |
408 | Status = ConvertBmpToGopBlt (\r | |
409 | ImageData,\r | |
410 | ImageSize,\r | |
411 | (VOID **) &Blt,\r | |
412 | &BltSize,\r | |
413 | &Height,\r | |
414 | &Width\r | |
415 | );\r | |
416 | if (EFI_ERROR (Status)) {\r | |
676df92c | 417 | if (ImageData != NULL) {\r |
418 | FreePool (ImageData);\r | |
419 | }\r | |
677472aa | 420 | if (Badging == NULL) {\r |
421 | return Status;\r | |
422 | } else {\r | |
423 | continue;\r | |
424 | }\r | |
425 | }\r | |
426 | \r | |
427 | //\r | |
428 | // Caculate the display position according to Attribute.\r | |
429 | //\r | |
430 | switch (Attribute) {\r | |
431 | case EfiBadgingDisplayAttributeLeftTop:\r | |
432 | DestX = CoordinateX;\r | |
433 | DestY = CoordinateY;\r | |
434 | break;\r | |
435 | \r | |
436 | case EfiBadgingDisplayAttributeCenterTop:\r | |
437 | DestX = (SizeOfX - Width) / 2;\r | |
438 | DestY = CoordinateY;\r | |
439 | break;\r | |
440 | \r | |
441 | case EfiBadgingDisplayAttributeRightTop:\r | |
442 | DestX = (SizeOfX - Width - CoordinateX);\r | |
443 | DestY = CoordinateY;;\r | |
444 | break;\r | |
445 | \r | |
446 | case EfiBadgingDisplayAttributeCenterRight:\r | |
447 | DestX = (SizeOfX - Width - CoordinateX);\r | |
448 | DestY = (SizeOfY - Height) / 2;\r | |
449 | break;\r | |
450 | \r | |
451 | case EfiBadgingDisplayAttributeRightBottom:\r | |
452 | DestX = (SizeOfX - Width - CoordinateX);\r | |
453 | DestY = (SizeOfY - Height - CoordinateY);\r | |
454 | break;\r | |
455 | \r | |
456 | case EfiBadgingDisplayAttributeCenterBottom:\r | |
457 | DestX = (SizeOfX - Width) / 2;\r | |
458 | DestY = (SizeOfY - Height - CoordinateY);\r | |
459 | break;\r | |
460 | \r | |
461 | case EfiBadgingDisplayAttributeLeftBottom:\r | |
462 | DestX = CoordinateX;\r | |
463 | DestY = (SizeOfY - Height - CoordinateY);\r | |
464 | break;\r | |
465 | \r | |
466 | case EfiBadgingDisplayAttributeCenterLeft:\r | |
467 | DestX = CoordinateX;\r | |
468 | DestY = (SizeOfY - Height) / 2;\r | |
469 | break;\r | |
470 | \r | |
471 | case EfiBadgingDisplayAttributeCenter:\r | |
472 | DestX = (SizeOfX - Width) / 2;\r | |
473 | DestY = (SizeOfY - Height) / 2;\r | |
474 | break;\r | |
475 | \r | |
476 | default:\r | |
477 | DestX = CoordinateX;\r | |
478 | DestY = CoordinateY;\r | |
479 | break;\r | |
480 | }\r | |
481 | \r | |
482 | if ((DestX >= 0) && (DestY >= 0)) {\r | |
483 | if (GraphicsOutput != NULL) {\r | |
484 | Status = GraphicsOutput->Blt (\r | |
485 | GraphicsOutput,\r | |
486 | Blt,\r | |
487 | EfiBltBufferToVideo,\r | |
488 | 0,\r | |
489 | 0,\r | |
490 | (UINTN) DestX,\r | |
491 | (UINTN) DestY,\r | |
492 | Width,\r | |
493 | Height,\r | |
494 | Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r | |
495 | );\r | |
496 | } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {\r | |
497 | Status = UgaDraw->Blt (\r | |
498 | UgaDraw,\r | |
499 | (EFI_UGA_PIXEL *) Blt,\r | |
500 | EfiUgaBltBufferToVideo,\r | |
501 | 0,\r | |
502 | 0,\r | |
503 | (UINTN) DestX,\r | |
504 | (UINTN) DestY,\r | |
505 | Width,\r | |
506 | Height,\r | |
507 | Width * sizeof (EFI_UGA_PIXEL)\r | |
508 | );\r | |
509 | } else {\r | |
510 | Status = EFI_UNSUPPORTED;\r | |
511 | }\r | |
512 | }\r | |
513 | \r | |
676df92c | 514 | if (ImageData != NULL) {\r |
515 | FreePool (ImageData);\r | |
516 | }\r | |
517 | if (Blt != NULL) {\r | |
518 | FreePool (Blt);\r | |
519 | }\r | |
677472aa | 520 | \r |
521 | if (Badging == NULL) {\r | |
522 | break;\r | |
523 | }\r | |
524 | }\r | |
525 | \r | |
526 | return Status;\r | |
527 | }\r | |
528 | \r | |
529 | /**\r | |
530 | Use Console Control to turn on UGA based Simple Text Out consoles. The UGA \r | |
531 | Simple Text Out screens will now be synced up with all non UGA output devices\r | |
532 | \r | |
533 | @retval EFI_SUCCESS UGA devices are back in text mode and synced up.\r | |
534 | @retval EFI_UNSUPPORTED Logo not found\r | |
535 | \r | |
536 | **/\r | |
537 | EFI_STATUS\r | |
538 | EFIAPI\r | |
539 | DisableQuietBoot (\r | |
540 | VOID\r | |
541 | )\r | |
542 | {\r | |
543 | EFI_STATUS Status;\r | |
544 | EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl;\r | |
545 | \r | |
546 | Status = gBS->LocateProtocol (&gEfiConsoleControlProtocolGuid, NULL, (VOID **) &ConsoleControl);\r | |
547 | if (EFI_ERROR (Status)) {\r | |
548 | return EFI_UNSUPPORTED;\r | |
549 | }\r | |
550 | \r | |
551 | //\r | |
552 | // Set console control to text mode.\r | |
553 | //\r | |
554 | return ConsoleControl->SetMode (ConsoleControl, EfiConsoleControlScreenText);\r | |
555 | }\r | |
556 | \r |