1 /*++ 2 3 Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR> 4 This program and the accompanying materials 5 are licensed and made available under the terms and conditions of the BSD License 6 which accompanies this distribution. The full text of the license may be found at 7 http://opensource.org/licenses/bsd-license.php 8 9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 12 Module Name: 13 14 GraphicsLib.h 15 16 Abstract: 17 18 19 --*/ 20 21 #ifndef _EFI_GRAPHICS_LIB_H_ 22 #define _EFI_GRAPHICS_LIB_H_ 23 24 #include EFI_PROTOCOL_DEFINITION (ConsoleControl) 25 #include EFI_PROTOCOL_DEFINITION (FirmwareVolume) 26 #include EFI_PROTOCOL_DEFINITION (FirmwareVolume2) 27 #include EFI_PROTOCOL_DEFINITION (GraphicsOutput) 28 #include EFI_PROTOCOL_DEFINITION (UgaDraw) 29 #include EFI_PROTOCOL_DEFINITION (EfiOemBadging) 30 31 #include EFI_GUID_DEFINITION (Bmp) 32 33 EFI_STATUS 34 GetGraphicsBitMapFromFV ( 35 IN EFI_GUID *FileNameGuid, 36 OUT VOID **Image, 37 OUT UINTN *ImageSize 38 ) 39 /*++ 40 41 Routine Description: 42 43 Return the graphics image file named FileNameGuid into Image and return it's 44 size in ImageSize. All Firmware Volumes (FV) in the system are searched for the 45 file name. 46 47 Arguments: 48 49 FileNameGuid - File Name of graphics file in the FV(s). 50 51 Image - Pointer to pointer to return graphics image. If NULL, a 52 buffer will be allocated. 53 54 ImageSize - Size of the graphics Image in bytes. Zero if no image found. 55 56 57 Returns: 58 59 EFI_SUCCESS - Image and ImageSize are valid. 60 EFI_BUFFER_TOO_SMALL - Image not big enough. ImageSize has required size 61 EFI_NOT_FOUND - FileNameGuid not found 62 63 --*/ 64 ; 65 66 EFI_STATUS 67 GetGraphicsBitMapFromFVEx ( 68 IN EFI_HANDLE ImageHandle, 69 IN EFI_GUID *FileNameGuid, 70 OUT VOID **Image, 71 OUT UINTN *ImageSize 72 ) 73 /*++ 74 75 Routine Description: 76 77 Return the graphics image file named FileNameGuid into Image and return it's 78 size in ImageSize. All Firmware Volumes (FV) in the system are searched for the 79 file name. 80 81 Arguments: 82 83 ImageHandle - The driver image handle of the caller. The parameter is used to 84 optimize the loading of the image file so that the FV from which 85 the driver image is loaded will be tried first. 86 87 FileNameGuid - File Name of graphics file in the FV(s). 88 89 Image - Pointer to pointer to return graphics image. If NULL, a 90 buffer will be allocated. 91 92 ImageSize - Size of the graphics Image in bytes. Zero if no image found. 93 94 95 Returns: 96 97 EFI_SUCCESS - Image and ImageSize are valid. 98 EFI_BUFFER_TOO_SMALL - Image not big enough. ImageSize has required size 99 EFI_NOT_FOUND - FileNameGuid not found 100 101 --*/ 102 ; 103 104 105 EFI_STATUS 106 ConvertBmpToGopBlt ( 107 IN VOID *BmpImage, 108 IN UINTN BmpImageSize, 109 IN OUT VOID **GopBlt, 110 IN OUT UINTN *GopBltSize, 111 OUT UINTN *PixelHeight, 112 OUT UINTN *PixelWidth 113 ) 114 /*++ 115 116 Routine Description: 117 118 Convert a *.BMP graphics image to a GOP/UGA blt buffer. If a NULL Blt buffer 119 is passed in a GopBlt buffer will be allocated by this routine. If a GopBlt 120 buffer is passed in it will be used if it is big enough. 121 122 Arguments: 123 124 BmpImage - Pointer to BMP file 125 126 BmpImageSize - Number of bytes in BmpImage 127 128 GopBlt - Buffer containing GOP version of BmpImage. 129 130 GopBltSize - Size of GopBlt in bytes. 131 132 PixelHeight - Height of GopBlt/BmpImage in pixels 133 134 PixelWidth - Width of GopBlt/BmpImage in pixels 135 136 137 Returns: 138 139 EFI_SUCCESS - GopBlt and GopBltSize are returned. 140 EFI_UNSUPPORTED - BmpImage is not a valid *.BMP image 141 EFI_BUFFER_TOO_SMALL - The passed in GopBlt buffer is not big enough. 142 GopBltSize will contain the required size. 143 EFI_OUT_OF_RESOURCES - No enough buffer to allocate 144 145 --*/ 146 ; 147 148 EFI_STATUS 149 EnableQuietBoot ( 150 IN EFI_GUID *LogoFile 151 ) 152 /*++ 153 154 Routine Description: 155 156 Use Console Control to turn off UGA based Simple Text Out consoles from going 157 to the UGA device. Put up LogoFile on every UGA device that is a console 158 159 Arguments: 160 161 LogoFile - File name of logo to display on the center of the screen. 162 163 164 Returns: 165 166 EFI_SUCCESS - ConsoleControl has been flipped to graphics and logo 167 displayed. 168 EFI_UNSUPPORTED - Logo not found 169 170 --*/ 171 ; 172 173 EFI_STATUS 174 EnableQuietBootEx ( 175 IN EFI_GUID *LogoFile, 176 IN EFI_HANDLE ImageHandle 177 ) 178 /*++ 179 180 Routine Description: 181 182 Use Console Control to turn off UGA based Simple Text Out consoles from going 183 to the UGA device. Put up LogoFile on every UGA device that is a console 184 185 Arguments: 186 187 LogoFile - File name of logo to display on the center of the screen. 188 ImageHandle - The driver image handle of the caller. The parameter is used to 189 optimize the loading of the logo file so that the FV from which 190 the driver image is loaded will be tried first. 191 192 193 Returns: 194 195 EFI_SUCCESS - ConsoleControl has been flipped to graphics and logo 196 displayed. 197 EFI_UNSUPPORTED - Logo not found 198 199 --*/ 200 ; 201 202 EFI_STATUS 203 DisableQuietBoot ( 204 VOID 205 ) 206 /*++ 207 208 Routine Description: 209 210 Use Console Control to turn on UGA based Simple Text Out consoles. The UGA 211 Simple Text Out screens will now be synced up with all non UGA output devices 212 213 Arguments: 214 215 NONE 216 217 Returns: 218 219 EFI_SUCCESS - UGA devices are back in text mode and synced up. 220 EFI_UNSUPPORTED - Logo not found 221 222 --*/ 223 ; 224 225 EFI_STATUS 226 LockKeyboards ( 227 IN CHAR16 *Password 228 ) 229 /*++ 230 231 Routine Description: 232 Use Console Control Protocol to lock the Console In Spliter virtual handle. 233 This is the ConInHandle and ConIn handle in the EFI system table. All key 234 presses will be ignored until the Password is typed in. The only way to 235 disable the password is to type it in to a ConIn device. 236 237 Arguments: 238 Password - Password used to lock ConIn device 239 240 241 Returns: 242 243 EFI_SUCCESS - ConsoleControl has been flipped to graphics and logo 244 displayed. 245 EFI_UNSUPPORTED - Logo not found 246 247 --*/ 248 ; 249 250 #endif 251