X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FConsole%2FConSplitterDxe%2FConSplitterGraphics.c;h=1a0715e1417e480cbdfe457c27c7f453d3411ba9;hb=257efb0ba32204ba983fd5eb4686280f8d975471;hp=20f27a20fbd21f61b4f4d0c11bce32b6abee67c2;hpb=8541adab27901906118876f1acd3555666677ff9;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c index 20f27a20fb..1a0715e141 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c @@ -1,6 +1,10 @@ -/*++ +/** @file + Support for ConsoleControl protocol. Support for Graphics output spliter. + Support for DevNull Console Out. This console uses memory buffers + to represnt the console. It allows a console to start very early and + when a new console is added it is synced up with the current console. -Copyright (c) 2006 - 2008, Intel Corporation +Copyright (c) 2006 - 2008, Intel Corporation.
All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -9,50 +13,39 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - ConSplitterGraphics.c +**/ -Abstract: - Support for ConsoleControl protocol. Support for Graphics output spliter. - Support for DevNull Console Out. This console uses memory buffers - to represnt the console. It allows a console to start very early and - when a new console is added it is synced up with the current console +#include "ConSplitter.h" ---*/ -#include "ConSplitter.h" +CHAR16 mCrLfString[3] = { CHAR_CARRIAGE_RETURN, CHAR_LINEFEED, CHAR_NULL }; + +/** + Return the current video mode information. Also returns info about existence + of Graphics Output devices or UGA Draw devices in system, and whether the Std + In device is locked. GopUgaExists and StdInLocked parameters are optional, and + only returned if a non NULL pointer is passed in. -static CHAR16 mCrLfString[3] = { CHAR_CARRIAGE_RETURN, CHAR_LINEFEED, CHAR_NULL }; + @param This Protocol instance pointer. + @param Mode Current video mode. + @param GopUgaExists TRUE if GOP Spliter has found a GOP/UGA device + @param StdInLocked TRUE if StdIn device is keyboard locked + @retval EFI_SUCCESS Video mode information is returned. + @retval EFI_INVALID_PARAMETER Invalid parameters if Mode == NULL. + +**/ EFI_STATUS EFIAPI ConSpliterConsoleControlGetMode ( IN EFI_CONSOLE_CONTROL_PROTOCOL *This, OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode, - OUT BOOLEAN *GopExists, + OUT BOOLEAN *GopUgaExists, OUT BOOLEAN *StdInLocked ) -/*++ - - Routine Description: - Return the current video mode information. Also returns info about existence - of Graphics Output devices or UGA Draw devices in system, and if the Std In device is locked. All the - arguments are optional and only returned if a non NULL pointer is passed in. - - Arguments: - This - Protocol instance pointer. - Mode - Are we in text of grahics mode. - GopExists - TRUE if GOP Spliter has found a GOP/UGA device - StdInLocked - TRUE if StdIn device is keyboard locked - - Returns: - EFI_SUCCESS - Mode information returned. - EFI_INVALID_PARAMETER - Invalid parameters. - ---*/ { TEXT_OUT_SPLITTER_PRIVATE_DATA *Private; UINTN Index; @@ -65,11 +58,11 @@ ConSpliterConsoleControlGetMode ( *Mode = Private->ConsoleOutputMode; - if (GopExists != NULL) { - *GopExists = FALSE; + if (GopUgaExists != NULL) { + *GopUgaExists = FALSE; for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) { if ((Private->TextOutList[Index].GraphicsOutput != NULL) || (Private->TextOutList[Index].UgaDraw != NULL)) { - *GopExists = TRUE; + *GopUgaExists = TRUE; break; } } @@ -82,28 +75,25 @@ ConSpliterConsoleControlGetMode ( return EFI_SUCCESS; } + +/** + Set the current mode to either text or graphics. Graphics is + for Quiet Boot. + + @param This Protocol instance pointer. + @param Mode Mode to set the + + @retval EFI_SUCCESS Mode information returned. + @retval EFI_INVALID_PARAMETER Invalid parameter. + @retval EFI_UNSUPPORTED Operation unsupported. + +**/ EFI_STATUS EFIAPI ConSpliterConsoleControlSetMode ( IN EFI_CONSOLE_CONTROL_PROTOCOL *This, IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode ) -/*++ - - Routine Description: - Set the current mode to either text or graphics. Graphics is - for Quiet Boot. - - Arguments: - This - Protocol instance pointer. - Mode - Mode to set the - - Returns: - EFI_SUCCESS - Mode information returned. - EFI_INVALID_PARAMETER - Invalid parameter. - EFI_UNSUPPORTED - Operation unsupported. - ---*/ { TEXT_OUT_SPLITTER_PRIVATE_DATA *Private; UINTN Index; @@ -160,6 +150,25 @@ ConSpliterConsoleControlSetMode ( return EFI_SUCCESS; } + +/** + Return the current video mode information. + + @param This Protocol instance pointer. + @param ModeNumber The mode number to return information on. + @param SizeOfInfo A pointer to the size, in bytes, of the Info + buffer. + @param Info Caller allocated buffer that returns information + about ModeNumber. + + @retval EFI_SUCCESS Mode information returned. + @retval EFI_BUFFER_TOO_SMALL The Info buffer was too small. + @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the + video mode. + @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode () + @retval EFI_INVALID_PARAMETER One of the input args was NULL. + +**/ EFI_STATUS EFIAPI ConSpliterGraphicsOutputQueryMode ( @@ -168,25 +177,6 @@ ConSpliterGraphicsOutputQueryMode ( OUT UINTN *SizeOfInfo, OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info ) -/*++ - - Routine Description: - Return the current video mode information. - - Arguments: - This - Protocol instance pointer. - ModeNumber - The mode number to return information on. - Info - Caller allocated buffer that returns information about ModeNumber. - SizeOfInfo - A pointer to the size, in bytes, of the Info buffer. - - Returns: - EFI_SUCCESS - Mode information returned. - EFI_BUFFER_TOO_SMALL - The Info buffer was too small. - EFI_DEVICE_ERROR - A hardware error occurred trying to retrieve the video mode. - EFI_NOT_STARTED - Video display is not initialized. Call SetMode () - EFI_INVALID_PARAMETER - One of the input args was NULL. - ---*/ { TEXT_OUT_SPLITTER_PRIVATE_DATA *Private; @@ -216,28 +206,25 @@ ConSpliterGraphicsOutputQueryMode ( return EFI_SUCCESS; } + +/** + Graphics output protocol interface to set video mode. + + @param This Protocol instance pointer. + @param ModeNumber The mode number to be set. + + @retval EFI_SUCCESS Graphics mode was changed. + @retval EFI_DEVICE_ERROR The device had an error and could not complete + the request. + @retval EFI_UNSUPPORTED ModeNumber is not supported by this device. + +**/ EFI_STATUS EFIAPI ConSpliterGraphicsOutputSetMode ( IN EFI_GRAPHICS_OUTPUT_PROTOCOL * This, IN UINT32 ModeNumber ) -/*++ - -Routine Description: - - Graphics output protocol interface to set video mode - - Arguments: - This - Protocol instance pointer. - ModeNumber - The mode number to be set. - - Returns: - EFI_SUCCESS - Graphics mode was changed. - EFI_DEVICE_ERROR - The device had an error and could not complete the request. - EFI_UNSUPPORTED - ModeNumber is not supported by this device. - ---*/ { EFI_STATUS Status; TEXT_OUT_SPLITTER_PRIVATE_DATA *Private; @@ -261,9 +248,6 @@ Routine Description: Private = GRAPHICS_OUTPUT_SPLITTER_PRIVATE_DATA_FROM_THIS (This); - // - // GopDevNullSetMode () - // ReturnStatus = EFI_SUCCESS; // @@ -344,7 +328,52 @@ Routine Description: return ReturnStatus; } -STATIC +/** + The following table defines actions for BltOperations. + + EfiBltVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY) + directly to every pixel of the video display rectangle + (DestinationX, DestinationY) + (DestinationX + Width, DestinationY + Height). + Only one pixel will be used from the BltBuffer. Delta is NOT used. + EfiBltVideoToBltBuffer - Read data from the video display rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in + the BltBuffer rectangle (DestinationX, DestinationY ) + (DestinationX + Width, DestinationY + Height). If DestinationX or + DestinationY is not zero then Delta must be set to the length in bytes + of a row in the BltBuffer. + EfiBltBufferToVideo - Write data from the BltBuffer rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the + video display rectangle (DestinationX, DestinationY) + (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is + not zero then Delta must be set to the length in bytes of a row in the + BltBuffer. + EfiBltVideoToVideo - Copy from the video display rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) . + to the video display rectangle (DestinationX, DestinationY) + (DestinationX + Width, DestinationY + Height). + The BltBuffer and Delta are not used in this mode. + + @param Private Protocol instance pointer. + @param BltBuffer Buffer containing data to blit into video buffer. + This buffer has a size of + Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL) + @param BltOperation Operation to perform on BlitBuffer and video + memory + @param SourceX X coordinate of source for the BltBuffer. + @param SourceY Y coordinate of source for the BltBuffer. + @param DestinationX X coordinate of destination for the BltBuffer. + @param DestinationY Y coordinate of destination for the BltBuffer. + @param Width Width of rectangle in BltBuffer in pixels. + @param Height Hight of rectangle in BltBuffer in pixels. + @param Delta OPTIONAL. + + @retval EFI_SUCCESS The Blt operation completed. + @retval EFI_INVALID_PARAMETER BltOperation is not valid. + @retval EFI_DEVICE_ERROR A hardware error occured writting to the video + buffer. + +**/ EFI_STATUS DevNullGraphicsOutputBlt ( IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private, @@ -399,7 +428,7 @@ DevNullGraphicsOutputBlt ( BltPtr = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) ((UINT8 *) BltBuffer + DestinationY * Delta + DestinationX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); ScreenPtr = &Private->GraphicsOutputBlt[SourceY * HorizontalResolution + SourceX]; - while (Height) { + while (Height > 0) { CopyMem (BltPtr, ScreenPtr, Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); BltPtr = (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) ((UINT8 *) BltPtr + Delta); ScreenPtr += HorizontalResolution; @@ -462,6 +491,53 @@ DevNullGraphicsOutputBlt ( return EFI_SUCCESS; } + +/** + The following table defines actions for BltOperations. + + EfiBltVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY) + directly to every pixel of the video display rectangle + (DestinationX, DestinationY) + (DestinationX + Width, DestinationY + Height). + Only one pixel will be used from the BltBuffer. Delta is NOT used. + EfiBltVideoToBltBuffer - Read data from the video display rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in + the BltBuffer rectangle (DestinationX, DestinationY ) + (DestinationX + Width, DestinationY + Height). If DestinationX or + DestinationY is not zero then Delta must be set to the length in bytes + of a row in the BltBuffer. + EfiBltBufferToVideo - Write data from the BltBuffer rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the + video display rectangle (DestinationX, DestinationY) + (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is + not zero then Delta must be set to the length in bytes of a row in the + BltBuffer. + EfiBltVideoToVideo - Copy from the video display rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) . + to the video display rectangle (DestinationX, DestinationY) + (DestinationX + Width, DestinationY + Height). + The BltBuffer and Delta are not used in this mode. + + @param This Protocol instance pointer. + @param BltBuffer Buffer containing data to blit into video buffer. + This buffer has a size of + Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL) + @param BltOperation Operation to perform on BlitBuffer and video + memory + @param SourceX X coordinate of source for the BltBuffer. + @param SourceY Y coordinate of source for the BltBuffer. + @param DestinationX X coordinate of destination for the BltBuffer. + @param DestinationY Y coordinate of destination for the BltBuffer. + @param Width Width of rectangle in BltBuffer in pixels. + @param Height Hight of rectangle in BltBuffer in pixels. + @param Delta OPTIONAL. + + @retval EFI_SUCCESS The Blt operation completed. + @retval EFI_INVALID_PARAMETER BltOperation is not valid. + @retval EFI_DEVICE_ERROR A hardware error occured writting to the video + buffer. + +**/ EFI_STATUS EFIAPI ConSpliterGraphicsOutputBlt ( @@ -476,53 +552,6 @@ ConSpliterGraphicsOutputBlt ( IN UINTN Height, IN UINTN Delta OPTIONAL ) -/*++ - - Routine Description: - The following table defines actions for BltOperations: - EfiBltVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY) - directly to every pixel of the video display rectangle - (DestinationX, DestinationY) - (DestinationX + Width, DestinationY + Height). - Only one pixel will be used from the BltBuffer. Delta is NOT used. - EfiBltVideoToBltBuffer - Read data from the video display rectangle - (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in - the BltBuffer rectangle (DestinationX, DestinationY ) - (DestinationX + Width, DestinationY + Height). If DestinationX or - DestinationY is not zero then Delta must be set to the length in bytes - of a row in the BltBuffer. - EfiBltBufferToVideo - Write data from the BltBuffer rectangle - (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the - video display rectangle (DestinationX, DestinationY) - (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is - not zero then Delta must be set to the length in bytes of a row in the - BltBuffer. - EfiBltVideoToVideo - Copy from the video display rectangle - (SourceX, SourceY) (SourceX + Width, SourceY + Height) . - to the video display rectangle (DestinationX, DestinationY) - (DestinationX + Width, DestinationY + Height). - The BltBuffer and Delta are not used in this mode. - - Arguments: - This - Protocol instance pointer. - BltBuffer - Buffer containing data to blit into video buffer. This - buffer has a size of Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL) - BltOperation - Operation to perform on BlitBuffer and video memory - SourceX - X coordinate of source for the BltBuffer. - SourceY - Y coordinate of source for the BltBuffer. - DestinationX - X coordinate of destination for the BltBuffer. - DestinationY - Y coordinate of destination for the BltBuffer. - Width - Width of rectangle in BltBuffer in pixels. - Height - Hight of rectangle in BltBuffer in pixels. - Delta - - - Returns: - EFI_SUCCESS - The Blt operation completed. - EFI_INVALID_PARAMETER - BltOperation is not valid. - EFI_DEVICE_ERROR - A hardware error occured writting to the video - buffer. - ---*/ { EFI_STATUS Status; TEXT_OUT_SPLITTER_PRIVATE_DATA *Private; @@ -608,6 +637,20 @@ ConSpliterGraphicsOutputBlt ( return ReturnStatus; } +/** + Write data from the buffer to video display based on Graphics Output setting. + + @param Private Consplitter Text Out pointer. + @param GraphicsOutput Graphics Output protocol pointer. + @param UgaDraw UGA Draw protocol pointer. + + @retval EFI_UNSUPPORTED No graphics devcie available . + @retval EFI_SUCCESS The Blt operation completed. + @retval EFI_INVALID_PARAMETER BltOperation is not valid. + @retval EFI_DEVICE_ERROR A hardware error occured writting to the video buffer. + + +**/ EFI_STATUS DevNullGopSync ( IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private, @@ -646,6 +689,21 @@ DevNullGopSync ( } } + +/** + Return the current video mode information. + + @param This Protocol instance pointer. + @param HorizontalResolution Current video horizontal resolution in pixels + @param VerticalResolution Current video vertical resolution in pixels + @param ColorDepth Current video color depth in bits per pixel + @param RefreshRate Current video refresh rate in Hz. + + @retval EFI_SUCCESS Mode information returned. + @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode () + @retval EFI_INVALID_PARAMETER One of the input args was NULL. + +**/ EFI_STATUS EFIAPI ConSpliterUgaDrawGetMode ( @@ -655,28 +713,13 @@ ConSpliterUgaDrawGetMode ( OUT UINT32 *ColorDepth, OUT UINT32 *RefreshRate ) -/*++ - - Routine Description: - Return the current video mode information. - - Arguments: - This - Protocol instance pointer. - HorizontalResolution - Current video horizontal resolution in pixels - VerticalResolution - Current video vertical resolution in pixels - ColorDepth - Current video color depth in bits per pixel - RefreshRate - Current video refresh rate in Hz. - - Returns: - EFI_SUCCESS - Mode information returned. - EFI_NOT_STARTED - Video display is not initialized. Call SetMode () - EFI_INVALID_PARAMETER - One of the input args was NULL. - ---*/ { TEXT_OUT_SPLITTER_PRIVATE_DATA *Private; - if (!(HorizontalResolution && VerticalResolution && RefreshRate && ColorDepth)) { + if ((HorizontalResolution == NULL) || + (VerticalResolution == NULL) || + (RefreshRate == NULL) || + (ColorDepth == NULL)) { return EFI_INVALID_PARAMETER; } // @@ -692,6 +735,21 @@ ConSpliterUgaDrawGetMode ( return EFI_SUCCESS; } + +/** + Return the current video mode information. + + @param This Protocol instance pointer. + @param HorizontalResolution Current video horizontal resolution in pixels + @param VerticalResolution Current video vertical resolution in pixels + @param ColorDepth Current video color depth in bits per pixel + @param RefreshRate Current video refresh rate in Hz. + + @retval EFI_SUCCESS Mode information returned. + @retval EFI_NOT_STARTED Video display is not initialized. Call SetMode () + @retval EFI_OUT_OF_RESOURCES Out of resources. + +**/ EFI_STATUS EFIAPI ConSpliterUgaDrawSetMode ( @@ -701,24 +759,6 @@ ConSpliterUgaDrawSetMode ( IN UINT32 ColorDepth, IN UINT32 RefreshRate ) -/*++ - - Routine Description: - Return the current video mode information. - - Arguments: - This - Protocol instance pointer. - HorizontalResolution - Current video horizontal resolution in pixels - VerticalResolution - Current video vertical resolution in pixels - ColorDepth - Current video color depth in bits per pixel - RefreshRate - Current video refresh rate in Hz. - - Returns: - EFI_SUCCESS - Mode information returned. - EFI_NOT_STARTED - Video display is not initialized. Call SetMode () - EFI_OUT_OF_RESOURCES - Out of resources. - ---*/ { EFI_STATUS Status; TEXT_OUT_SPLITTER_PRIVATE_DATA *Private; @@ -817,6 +857,52 @@ ConSpliterUgaDrawSetMode ( return ReturnStatus; } +/** + The following table defines actions for BltOperations. + + EfiBltVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY) + directly to every pixel of the video display rectangle + (DestinationX, DestinationY) + (DestinationX + Width, DestinationY + Height). + Only one pixel will be used from the BltBuffer. Delta is NOT used. + EfiBltVideoToBltBuffer - Read data from the video display rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in + the BltBuffer rectangle (DestinationX, DestinationY ) + (DestinationX + Width, DestinationY + Height). If DestinationX or + DestinationY is not zero then Delta must be set to the length in bytes + of a row in the BltBuffer. + EfiBltBufferToVideo - Write data from the BltBuffer rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the + video display rectangle (DestinationX, DestinationY) + (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is + not zero then Delta must be set to the length in bytes of a row in the + BltBuffer. + EfiBltVideoToVideo - Copy from the video display rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) . + to the video display rectangle (DestinationX, DestinationY) + (DestinationX + Width, DestinationY + Height). + The BltBuffer and Delta are not used in this mode. + + @param Private Protocol instance pointer. + @param BltBuffer Buffer containing data to blit into video buffer. + This buffer has a size of + Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL) + @param BltOperation Operation to perform on BlitBuffer and video + memory + @param SourceX X coordinate of source for the BltBuffer. + @param SourceY Y coordinate of source for the BltBuffer. + @param DestinationX X coordinate of destination for the BltBuffer. + @param DestinationY Y coordinate of destination for the BltBuffer. + @param Width Width of rectangle in BltBuffer in pixels. + @param Height Hight of rectangle in BltBuffer in pixels. + @param Delta OPTIONAL. + + @retval EFI_SUCCESS The Blt operation completed. + @retval EFI_INVALID_PARAMETER BltOperation is not valid. + @retval EFI_DEVICE_ERROR A hardware error occured writting to the video + buffer. + +**/ EFI_STATUS DevNullUgaBlt ( IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private, @@ -871,7 +957,7 @@ DevNullUgaBlt ( BltPtr = (EFI_UGA_PIXEL *) ((UINT8 *) BltBuffer + DestinationY * Delta + DestinationX * sizeof (EFI_UGA_PIXEL)); ScreenPtr = &Private->UgaBlt[SourceY * HorizontalResolution + SourceX]; - while (Height) { + while (Height > 0) { CopyMem (BltPtr, ScreenPtr, Width * sizeof (EFI_UGA_PIXEL)); BltPtr = (EFI_UGA_PIXEL *) ((UINT8 *) BltPtr + Delta); ScreenPtr += HorizontalResolution; @@ -934,6 +1020,53 @@ DevNullUgaBlt ( return EFI_SUCCESS; } + +/** + The following table defines actions for BltOperations. + + EfiUgaVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY) + directly to every pixel of the video display rectangle + (DestinationX, DestinationY) + (DestinationX + Width, DestinationY + Height). + Only one pixel will be used from the BltBuffer. Delta is NOT used. + EfiUgaVideoToBltBuffer - Read data from the video display rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in + the BltBuffer rectangle (DestinationX, DestinationY ) + (DestinationX + Width, DestinationY + Height). If DestinationX or + DestinationY is not zero then Delta must be set to the length in bytes + of a row in the BltBuffer. + EfiUgaBltBufferToVideo - Write data from the BltBuffer rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the + video display rectangle (DestinationX, DestinationY) + (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is + not zero then Delta must be set to the length in bytes of a row in the + BltBuffer. + EfiUgaVideoToVideo - Copy from the video display rectangle + (SourceX, SourceY) (SourceX + Width, SourceY + Height) . + to the video display rectangle (DestinationX, DestinationY) + (DestinationX + Width, DestinationY + Height). + The BltBuffer and Delta are not used in this mode. + + @param This Protocol instance pointer. + @param BltBuffer Buffer containing data to blit into video buffer. + This buffer has a size of + Width*Height*sizeof(EFI_UGA_PIXEL) + @param BltOperation Operation to perform on BlitBuffer and video + memory + @param SourceX X coordinate of source for the BltBuffer. + @param SourceY Y coordinate of source for the BltBuffer. + @param DestinationX X coordinate of destination for the BltBuffer. + @param DestinationY Y coordinate of destination for the BltBuffer. + @param Width Width of rectangle in BltBuffer in pixels. + @param Height Hight of rectangle in BltBuffer in pixels. + @param Delta OPTIONAL. + + @retval EFI_SUCCESS The Blt operation completed. + @retval EFI_INVALID_PARAMETER BltOperation is not valid. + @retval EFI_DEVICE_ERROR A hardware error occured writting to the video + buffer. + +**/ EFI_STATUS EFIAPI ConSpliterUgaDrawBlt ( @@ -948,53 +1081,6 @@ ConSpliterUgaDrawBlt ( IN UINTN Height, IN UINTN Delta OPTIONAL ) -/*++ - - Routine Description: - The following table defines actions for BltOperations: - EfiUgaVideoFill - Write data from the BltBuffer pixel (SourceX, SourceY) - directly to every pixel of the video display rectangle - (DestinationX, DestinationY) - (DestinationX + Width, DestinationY + Height). - Only one pixel will be used from the BltBuffer. Delta is NOT used. - EfiUgaVideoToBltBuffer - Read data from the video display rectangle - (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in - the BltBuffer rectangle (DestinationX, DestinationY ) - (DestinationX + Width, DestinationY + Height). If DestinationX or - DestinationY is not zero then Delta must be set to the length in bytes - of a row in the BltBuffer. - EfiUgaBltBufferToVideo - Write data from the BltBuffer rectangle - (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the - video display rectangle (DestinationX, DestinationY) - (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is - not zero then Delta must be set to the length in bytes of a row in the - BltBuffer. - EfiUgaVideoToVideo - Copy from the video display rectangle - (SourceX, SourceY) (SourceX + Width, SourceY + Height) . - to the video display rectangle (DestinationX, DestinationY) - (DestinationX + Width, DestinationY + Height). - The BltBuffer and Delta are not used in this mode. - - Arguments: - This - Protocol instance pointer. - BltBuffer - Buffer containing data to blit into video buffer. This - buffer has a size of Width*Height*sizeof(EFI_UGA_PIXEL) - BltOperation - Operation to perform on BlitBuffer and video memory - SourceX - X coordinate of source for the BltBuffer. - SourceY - Y coordinate of source for the BltBuffer. - DestinationX - X coordinate of destination for the BltBuffer. - DestinationY - Y coordinate of destination for the BltBuffer. - Width - Width of rectangle in BltBuffer in pixels. - Height - Hight of rectangle in BltBuffer in pixels. - Delta - - - Returns: - EFI_SUCCESS - The Blt operation completed. - EFI_INVALID_PARAMETER - BltOperation is not valid. - EFI_DEVICE_ERROR - A hardware error occured writting to the video - buffer. - ---*/ { EFI_STATUS Status; TEXT_OUT_SPLITTER_PRIVATE_DATA *Private; @@ -1077,6 +1163,19 @@ ConSpliterUgaDrawBlt ( return ReturnStatus; } +/** + Write data from the buffer to video display based on UGA Draw setting. + + @param Private Consplitter Text Out pointer. + @param GraphicsOutput Graphics Output protocol pointer. + @param UgaDraw UGA Draw protocol pointer. + + @retval EFI_UNSUPPORTED No graphics devcie available . + @retval EFI_SUCCESS The Blt operation completed. + @retval EFI_INVALID_PARAMETER BltOperation is not valid. + @retval EFI_DEVICE_ERROR A hardware error occured writting to the video buffer. + +**/ EFI_STATUS DevNullUgaSync ( IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private, @@ -1115,34 +1214,32 @@ DevNullUgaSync ( } } + +/** + Write a Unicode string to the output device. + + @param Private Pointer to the console output splitter's private + data. It indicates the calling context. + @param WString The NULL-terminated Unicode string to be + displayed on the output device(s). All output + devices must also support the Unicode drawing + defined in this file. + + @retval EFI_SUCCESS The string was output to the device. + @retval EFI_DEVICE_ERROR The device reported an error while attempting to + output the text. + @retval EFI_UNSUPPORTED The output device's mode is not currently in a + defined text mode. + @retval EFI_WARN_UNKNOWN_GLYPH This warning code indicates that some of the + characters in the Unicode string could not be + rendered and were skipped. + +**/ EFI_STATUS DevNullTextOutOutputString ( IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private, IN CHAR16 *WString ) -/*++ - - Routine Description: - Write a Unicode string to the output device. - - Arguments: - Private - Pointer to the console output splitter's private data. It - indicates the calling context. - WString - The NULL-terminated Unicode string to be displayed on the output - device(s). All output devices must also support the Unicode - drawing defined in this file. - - Returns: - EFI_SUCCESS - The string was output to the device. - EFI_DEVICE_ERROR - The device reported an error while attempting to - output the text. - EFI_UNSUPPORTED - The output device's mode is not currently in a - defined text mode. - EFI_WARN_UNKNOWN_GLYPH - This warning code indicates that some of the - characters in the Unicode string could not be - rendered and were skipped. - ---*/ { UINTN SizeScreen; UINTN SizeAttribute; @@ -1171,7 +1268,7 @@ DevNullTextOutOutputString ( CurrentWidth = 1; } - while (*WString) { + while (*WString != L'\0') { if (*WString == CHAR_BACKSPACE) { // @@ -1199,7 +1296,7 @@ DevNullTextOutOutputString ( // InsertChar = CHAR_BACKSPACE; PStr = WString + 1; - while (*PStr) { + while (*PStr != L'\0') { TempChar = *PStr; *PStr = InsertChar; InsertChar = TempChar; @@ -1250,7 +1347,7 @@ DevNullTextOutOutputString ( Attribute = NullAttributes + SizeAttribute; for (Index = 0; Index < MaxColumn; Index++, Screen++, Attribute++) { - *Screen = ' '; + *Screen = L' '; *Attribute = Mode->Attribute; } } else { @@ -1335,28 +1432,25 @@ DevNullTextOutOutputString ( return EFI_SUCCESS; } + +/** + Sets the output device(s) to a specified mode. + + @param Private Private data structure pointer. + @param ModeNumber The mode number to set. + + @retval EFI_SUCCESS The requested text mode was set. + @retval EFI_DEVICE_ERROR The device had an error and could not complete + the request. + @retval EFI_UNSUPPORTED The mode number was not valid. + @retval EFI_OUT_OF_RESOURCES Out of resources. + +**/ EFI_STATUS DevNullTextOutSetMode ( IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private, IN UINTN ModeNumber ) -/*++ - - Routine Description: - Sets the output device(s) to a specified mode. - - Arguments: - Private - Private data structure pointer. - ModeNumber - The mode number to set. - - Returns: - EFI_SUCCESS - The requested text mode was set. - EFI_DEVICE_ERROR - The device had an error and - could not complete the request. - EFI_UNSUPPORTED - The mode number was not valid. - EFI_OUT_OF_RESOURCES - Out of resources. - ---*/ { UINTN Size; INT32 CurrentMode; @@ -1372,7 +1466,7 @@ DevNullTextOutSetMode ( if (Private->TextOutModeMap != NULL) { CurrentMode = *(Private->TextOutModeMap + Private->TextOutListCount * ModeNumber); } else { - CurrentMode = (INT32)(ModeNumber); + CurrentMode = (INT32) (ModeNumber); } Mode = &(Private->TextOutQueryData[CurrentMode]); Row = Mode->Rows; @@ -1414,26 +1508,23 @@ DevNullTextOutSetMode ( return EFI_SUCCESS; } -EFI_STATUS -DevNullTextOutClearScreen ( - IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private - ) -/*++ - Routine Description: - Clears the output device(s) display to the currently selected background - color. +/** + Clears the output device(s) display to the currently selected background + color. - Arguments: - Private - Protocol instance pointer. + @param Private Protocol instance pointer. - Returns: - EFI_SUCCESS - The operation completed successfully. - EFI_DEVICE_ERROR - The device had an error and - could not complete the request. - EFI_UNSUPPORTED - The output device is not in a valid text mode. + @retval EFI_SUCCESS The operation completed successfully. + @retval EFI_DEVICE_ERROR The device had an error and could not complete + the request. + @retval EFI_UNSUPPORTED The output device is not in a valid text mode. ---*/ +**/ +EFI_STATUS +DevNullTextOutClearScreen ( + IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private + ) { UINTN Row; UINTN Column; @@ -1452,7 +1543,7 @@ DevNullTextOutClearScreen ( for (Row = 0; Row < Private->DevNullRows; Row++) { for (Column = 0; Column < Private->DevNullColumns; Column++, Screen++, Attributes++) { - *Screen = ' '; + *Screen = L' '; *Attributes = CurrentAttribute; } // @@ -1466,31 +1557,30 @@ DevNullTextOutClearScreen ( return DevNullTextOutEnableCursor (Private, TRUE); } + +/** + Sets the current coordinates of the cursor position. + + @param Private Protocol instance pointer. + @param Column + @param Row the position to set the cursor to. Must be + greater than or equal to zero and less than the + number of columns and rows by QueryMode (). + + @retval EFI_SUCCESS The operation completed successfully. + @retval EFI_DEVICE_ERROR The device had an error and could not complete + the request. + @retval EFI_UNSUPPORTED The output device is not in a valid text mode, or + the cursor position is invalid for the current + mode. + +**/ EFI_STATUS DevNullTextOutSetCursorPosition ( IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private, IN UINTN Column, IN UINTN Row ) -/*++ - - Routine Description: - Sets the current coordinates of the cursor position - - Arguments: - Private - Protocol instance pointer. - Column, Row - the position to set the cursor to. Must be greater than or - equal to zero and less than the number of columns and rows - by QueryMode (). - - Returns: - EFI_SUCCESS - The operation completed successfully. - EFI_DEVICE_ERROR - The device had an error and - could not complete the request. - EFI_UNSUPPORTED - The output device is not in a valid text mode, or the - cursor position is invalid for the current mode. - ---*/ { // // No need to do extra check here as whether (Column, Row) is valid has @@ -1503,53 +1593,44 @@ DevNullTextOutSetCursorPosition ( return EFI_SUCCESS; } + +/** + Implements SIMPLE_TEXT_OUTPUT.EnableCursor(). + In this driver, the cursor cannot be hidden. + + @param Private Indicates the calling context. + @param Visible If TRUE, the cursor is set to be visible, If + FALSE, the cursor is set to be invisible. + + @retval EFI_SUCCESS The request is valid. + +**/ EFI_STATUS DevNullTextOutEnableCursor ( IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private, IN BOOLEAN Visible ) -/*++ - Routine Description: - - Implements SIMPLE_TEXT_OUTPUT.EnableCursor(). - In this driver, the cursor cannot be hidden. - - Arguments: - - Private - Indicates the calling context. - - Visible - If TRUE, the cursor is set to be visible, If FALSE, the cursor - is set to be invisible. - - Returns: - - EFI_SUCCESS - The request is valid. - - ---*/ { Private->TextOutMode.CursorVisible = Visible; return EFI_SUCCESS; } + +/** + Take the DevNull TextOut device and update the Simple Text Out on every + UGA device. + + @param Private Indicates the calling context. + + @retval EFI_SUCCESS The request is valid. + @retval other Return status of TextOut->OutputString () + +**/ EFI_STATUS DevNullSyncStdOut ( IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private ) -/*++ - Routine Description: - Take the DevNull TextOut device and update the Simple Text Out on every - UGA device. - - Arguments: - Private - Indicates the calling context. - - Returns: - EFI_SUCCESS - The request is valid. - other - Return status of TextOut->OutputString () - ---*/ { EFI_STATUS Status; EFI_STATUS ReturnStatus; @@ -1613,7 +1694,7 @@ DevNullSyncStdOut ( Column = 0; while (Column < MaxColumn) { - if (Screen[Column]) { + if (Screen[Column] > 0) { CurrentAttribute = Attributes[Column]; CurrentColumn = Column; ScreenStart = &Screen[Column]; @@ -1631,7 +1712,7 @@ DevNullSyncStdOut ( *BufferTail = *Str; BufferTail++; - if (Attributes[Column] & EFI_WIDE_ATTRIBUTE) { + if ((Attributes[Column] & EFI_WIDE_ATTRIBUTE) != 0) { Str++; Column++; }