diff options
Diffstat (limited to 'IntelFrameworkModulePkg/Library/GraphicsLib/Graphics.c')
-rw-r--r-- | IntelFrameworkModulePkg/Library/GraphicsLib/Graphics.c | 265 |
1 files changed, 108 insertions, 157 deletions
diff --git a/IntelFrameworkModulePkg/Library/GraphicsLib/Graphics.c b/IntelFrameworkModulePkg/Library/GraphicsLib/Graphics.c index ea8c7d5157..f75963e712 100644 --- a/IntelFrameworkModulePkg/Library/GraphicsLib/Graphics.c +++ b/IntelFrameworkModulePkg/Library/GraphicsLib/Graphics.c @@ -37,37 +37,30 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Library/DebugLib.h>
#include <Library/PcdLib.h>
-EFI_STATUS
-GetGraphicsBitMapFromFV (
- IN EFI_GUID *FileNameGuid,
- OUT VOID **Image,
- OUT UINTN *ImageSize
- )
-/*++
-
-Routine Description:
-
+/**
Return the graphics image file named FileNameGuid into Image and return it's
size in ImageSize. All Firmware Volumes (FV) in the system are searched for the
file name.
-Arguments:
-
- FileNameGuid - File Name of graphics file in the FV(s).
+ @param FileNameGuid - File Name of graphics file in the FV(s).
- Image - Pointer to pointer to return graphics image. If NULL, a
- buffer will be allocated.
+ @param Image - Pointer to pointer to return graphics image. If NULL, a
+ buffer will be allocated.
- ImageSize - Size of the graphics Image in bytes. Zero if no image found.
+ @param ImageSize - Size of the graphics Image in bytes. Zero if no image found.
+ @retval EFI_SUCCESS - Image and ImageSize are valid.
+ @retval EFI_BUFFER_TOO_SMALL - Image not big enough. ImageSize has required size
+ @retval EFI_NOT_FOUND - FileNameGuid not found
-Returns:
-
- EFI_SUCCESS - Image and ImageSize are valid.
- EFI_BUFFER_TOO_SMALL - Image not big enough. ImageSize has required size
- EFI_NOT_FOUND - FileNameGuid not found
+**/
---*/
+EFI_STATUS
+GetGraphicsBitMapFromFV (
+ IN EFI_GUID *FileNameGuid,
+ OUT VOID **Image,
+ OUT UINTN *ImageSize
+ )
{
EFI_STATUS Status;
UINTN FvProtocolCount;
@@ -120,48 +113,42 @@ Returns: return EFI_NOT_FOUND;
}
-STATIC
-EFI_STATUS
-ConvertBmpToGopBlt (
- IN VOID *BmpImage,
- IN UINTN BmpImageSize,
- IN OUT VOID **GopBlt,
- IN OUT UINTN *GopBltSize,
- OUT UINTN *PixelHeight,
- OUT UINTN *PixelWidth
- )
-/*++
-
-Routine Description:
-
+/**
Convert a *.BMP graphics image to a GOP/UGA blt buffer. If a NULL Blt buffer
is passed in a GopBlt buffer will be allocated by this routine. If a GopBlt
buffer is passed in it will be used if it is big enough.
-Arguments:
+ @param BmpImage - Pointer to BMP file
- BmpImage - Pointer to BMP file
+ @param BmpImageSize - Number of bytes in BmpImage
- BmpImageSize - Number of bytes in BmpImage
+ @param GopBlt - Buffer containing GOP version of BmpImage.
- GopBlt - Buffer containing GOP version of BmpImage.
+ @param GopBltSize - Size of GopBlt in bytes.
- GopBltSize - Size of GopBlt in bytes.
+ @param PixelHeight - Height of GopBlt/BmpImage in pixels
- PixelHeight - Height of GopBlt/BmpImage in pixels
+ @param PixelWidth - Width of GopBlt/BmpImage in pixels
- PixelWidth - Width of GopBlt/BmpImage in pixels
+ @retval EFI_SUCCESS - GopBlt and GopBltSize are returned.
+ @retval EFI_UNSUPPORTED - BmpImage is not a valid *.BMP image
+ @retval EFI_BUFFER_TOO_SMALL - The passed in GopBlt buffer is not big enough.
+ GopBltSize will contain the required size.
+ @retval EFI_OUT_OF_RESOURCES - No enough buffer to allocate
-Returns:
-
- EFI_SUCCESS - GopBlt and GopBltSize are returned.
- EFI_UNSUPPORTED - BmpImage is not a valid *.BMP image
- EFI_BUFFER_TOO_SMALL - The passed in GopBlt buffer is not big enough.
- GopBltSize will contain the required size.
- EFI_OUT_OF_RESOURCES - No enough buffer to allocate
+**/
+STATIC
+EFI_STATUS
+ConvertBmpToGopBlt (
+ IN VOID *BmpImage,
+ IN UINTN BmpImageSize,
+ IN OUT VOID **GopBlt,
+ IN OUT UINTN *GopBltSize,
+ OUT UINTN *PixelHeight,
+ OUT UINTN *PixelWidth
+ )
---*/
{
UINT8 *Image;
UINT8 *ImageHeader;
@@ -296,30 +283,23 @@ Returns: return EFI_SUCCESS;
}
-
-EFI_STATUS
-LockKeyboards (
- IN CHAR16 *Password
- )
-/*++
-
-Routine Description:
+/**
Use Console Control Protocol to lock the Console In Spliter virtual handle.
This is the ConInHandle and ConIn handle in the EFI system table. All key
presses will be ignored until the Password is typed in. The only way to
disable the password is to type it in to a ConIn device.
-Arguments:
- Password - Password used to lock ConIn device
-
+ @param Password - Password used to lock ConIn device
-Returns:
-
- EFI_SUCCESS - ConsoleControl has been flipped to graphics and logo
+ @retval EFI_SUCCESS - ConsoleControl has been flipped to graphics and logo
displayed.
- EFI_UNSUPPORTED - Logo not found
+ @retval EFI_UNSUPPORTED - Logo not found
---*/
+**/
+EFI_STATUS
+LockKeyboards (
+ IN CHAR16 *Password
+ )
{
EFI_STATUS Status;
EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl;
@@ -333,30 +313,22 @@ Returns: return Status;
}
-
-EFI_STATUS
-EnableQuietBoot (
- IN EFI_GUID *LogoFile
- )
-/*++
-
-Routine Description:
-
+/**
Use Console Control to turn off UGA based Simple Text Out consoles from going
to the UGA device. Put up LogoFile on every UGA device that is a console
-Arguments:
-
- LogoFile - File name of logo to display on the center of the screen.
+ @param LogoFile - File name of logo to display on the center of the screen.
+ @retval EFI_SUCCESS - ConsoleControl has been flipped to graphics and logo
+ displayed.
+ @retval EFI_UNSUPPORTED - Logo not found
-Returns:
-
- EFI_SUCCESS - ConsoleControl has been flipped to graphics and logo
- displayed.
- EFI_UNSUPPORTED - Logo not found
+**/
+EFI_STATUS
+EnableQuietBoot (
+ IN EFI_GUID *LogoFile
+ )
---*/
{
EFI_STATUS Status;
EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl;
@@ -571,28 +543,18 @@ Returns: return Status;
}
+/**
+ Use Console Control to turn on GOP/UGA based Simple Text Out consoles. The GOP/UGA
+ Simple Text Out screens will now be synced up with all non GOP/UGA output devices
+ @retval EFI_SUCCESS - GOP/UGA devices are back in text mode and synced up.
+ @retval EFI_UNSUPPORTED - Logo not found
+**/
EFI_STATUS
DisableQuietBoot (
VOID
)
-/*++
-
-Routine Description:
- Use Console Control to turn on GOP/UGA based Simple Text Out consoles. The GOP/UGA
- Simple Text Out screens will now be synced up with all non GOP/UGA output devices
-
-Arguments:
-
- NONE
-
-Returns:
-
- EFI_SUCCESS - GOP/UGA devices are back in text mode and synced up.
- EFI_UNSUPPORTED - Logo not found
-
---*/
{
EFI_STATUS Status;
EFI_CONSOLE_CONTROL_PROTOCOL *ConsoleControl;
@@ -624,51 +586,46 @@ static EFI_GRAPHICS_OUTPUT_BLT_PIXEL mEfiColors[16] = { { 0xff, 0xff, 0xff, 0x00 }
};
-STATIC
-UINTN
-_IPrint (
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,
- IN EFI_UGA_DRAW_PROTOCOL *UgaDraw,
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Sto,
- IN UINTN X,
- IN UINTN Y,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Foreground,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Background,
- IN CHAR16 *fmt,
- IN VA_LIST args
- )
-/*++
-
-Routine Description:
-
+/**
Display string worker for: Print, PrintAt, IPrint, IPrintAt
-Arguments:
+ @param GraphicsOutput - Graphics output protocol interface
- GraphicsOutput - Graphics output protocol interface
+ @param UgaDraw - UGA draw protocol interface
- UgaDraw - UGA draw protocol interface
+ @param Sto - Simple text out protocol interface
- Sto - Simple text out protocol interface
+ @param X - X coordinate to start printing
- X - X coordinate to start printing
+ @param Y - Y coordinate to start printing
- Y - Y coordinate to start printing
+ @param Foreground - Foreground color
- Foreground - Foreground color
+ @param Background - Background color
- Background - Background color
+ @param fmt - Format string
- fmt - Format string
+ @param args - Print arguments
- args - Print arguments
-Returns:
+ @retval EFI_SUCCESS - success
+ @retval EFI_OUT_OF_RESOURCES - out of resources
- EFI_SUCCESS - success
- EFI_OUT_OF_RESOURCES - out of resources
+**/
+STATIC
+UINTN
+_IPrint (
+ IN EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,
+ IN EFI_UGA_DRAW_PROTOCOL *UgaDraw,
+ IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Sto,
+ IN UINTN X,
+ IN UINTN Y,
+ IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Foreground,
+ IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Background,
+ IN CHAR16 *fmt,
+ IN VA_LIST args
+ )
---*/
{
VOID *Buffer;
EFI_STATUS Status;
@@ -812,7 +769,25 @@ Error: return Status;
}
+/**
+ Prints a formatted unicode string to the default console
+
+ @param X - X coordinate to start printing
+
+ @param Y - Y coordinate to start printing
+
+ @param ForeGround - Foreground color
+
+ @param BackGround - Background color
+
+ @param Fmt - Format string
+
+ @param ... - Print arguments
+
+ @retval Length of string printed to the console
+
+**/
UINTN
PrintXY (
IN UINTN X,
@@ -822,31 +797,6 @@ PrintXY ( IN CHAR16 *Fmt,
...
)
-/*++
-
-Routine Description:
-
- Prints a formatted unicode string to the default console
-
-Arguments:
-
- X - X coordinate to start printing
-
- Y - Y coordinate to start printing
-
- ForeGround - Foreground color
-
- BackGround - Background color
-
- Fmt - Format string
-
- ... - Print arguments
-
-Returns:
-
- Length of string printed to the console
-
---*/
{
EFI_HANDLE Handle;
@@ -894,3 +844,4 @@ Returns: return _IPrint (GraphicsOutput, UgaDraw, Sto, X, Y, ForeGround, BackGround, Fmt, Args);
}
+
|