X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FConsole%2FConSplitterDxe%2FConSplitterGraphics.c;h=1a0715e1417e480cbdfe457c27c7f453d3411ba9;hb=257efb0ba32204ba983fd5eb4686280f8d975471;hp=497adfda4c985d9f649e98ec643771071c1734dc;hpb=a4d608d1f777b0675b45072967fe39492f45bb1b;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c index 497adfda4c..1a0715e141 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c @@ -20,21 +20,22 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "ConSplitter.h" -STATIC CHAR16 mCrLfString[3] = { CHAR_CARRIAGE_RETURN, CHAR_LINEFEED, CHAR_NULL }; +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 if the Std In device is locked. All the - arguments are optional and only returned if a non NULL pointer is passed in. + 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. @param This Protocol instance pointer. - @param Mode Are we in text of grahics mode. - @param GopExists TRUE if GOP Spliter has found a GOP/UGA device + @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 Mode information returned. - @retval EFI_INVALID_PARAMETER Invalid parameters. + @retval EFI_SUCCESS Video mode information is returned. + @retval EFI_INVALID_PARAMETER Invalid parameters if Mode == NULL. **/ EFI_STATUS @@ -42,7 +43,7 @@ EFIAPI ConSpliterConsoleControlGetMode ( IN EFI_CONSOLE_CONTROL_PROTOCOL *This, OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode, - OUT BOOLEAN *GopExists, + OUT BOOLEAN *GopUgaExists, OUT BOOLEAN *StdInLocked ) { @@ -57,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; } } @@ -207,7 +208,7 @@ ConSpliterGraphicsOutputQueryMode ( /** - Graphics output protocol interface to set video mode + Graphics output protocol interface to set video mode. @param This Protocol instance pointer. @param ModeNumber The mode number to be set. @@ -247,9 +248,6 @@ ConSpliterGraphicsOutputSetMode ( Private = GRAPHICS_OUTPUT_SPLITTER_PRIVATE_DATA_FROM_THIS (This); - // - // GopDevNullSetMode () - // ReturnStatus = EFI_SUCCESS; // @@ -330,6 +328,52 @@ ConSpliterGraphicsOutputSetMode ( 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 DevNullGraphicsOutputBlt ( IN TEXT_OUT_SPLITTER_PRIVATE_DATA *Private, @@ -485,8 +529,8 @@ DevNullGraphicsOutputBlt ( @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. Delta - - + @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. @@ -593,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, @@ -799,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, @@ -954,8 +1058,8 @@ DevNullUgaBlt ( @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. Delta - - + @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. @@ -1059,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, @@ -1230,7 +1347,7 @@ DevNullTextOutOutputString ( Attribute = NullAttributes + SizeAttribute; for (Index = 0; Index < MaxColumn; Index++, Screen++, Attribute++) { - *Screen = ' '; + *Screen = L' '; *Attribute = Mode->Attribute; } } else { @@ -1349,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; @@ -1426,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; } //