]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c
fix ECC tool's warning
[mirror_edk2.git] / MdeModulePkg / Universal / Console / ConSplitterDxe / ConSplitterGraphics.c
index 497adfda4c985d9f649e98ec643771071c1734dc..1a0715e1417e480cbdfe457c27c7f453d3411ba9 100644 (file)
@@ -20,21 +20,22 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "ConSplitter.h"\r
 \r
 \r
-STATIC CHAR16 mCrLfString[3] = { CHAR_CARRIAGE_RETURN, CHAR_LINEFEED, CHAR_NULL };\r
+CHAR16 mCrLfString[3] = { CHAR_CARRIAGE_RETURN, CHAR_LINEFEED, CHAR_NULL };\r
 \r
 \r
 /**\r
   Return the current video mode information. Also returns info about existence\r
-  of Graphics Output devices or UGA Draw devices in system, and if the Std In device is locked. All the\r
-  arguments are optional and only returned if a non NULL pointer is passed in.\r
+  of Graphics Output devices or UGA Draw devices in system, and whether the Std\r
+  In device is locked. GopUgaExists and StdInLocked parameters are optional, and\r
+  only returned if a non NULL pointer is passed in.\r
 \r
   @param  This                    Protocol instance pointer.\r
-  @param  Mode                    Are we in text of grahics mode.\r
-  @param  GopExists               TRUE if GOP Spliter has found a GOP/UGA device\r
+  @param  Mode                    Current video mode.\r
+  @param  GopUgaExists            TRUE if GOP Spliter has found a GOP/UGA device\r
   @param  StdInLocked             TRUE if StdIn device is keyboard locked\r
 \r
-  @retval EFI_SUCCESS             Mode information returned.\r
-  @retval EFI_INVALID_PARAMETER   Invalid parameters.\r
+  @retval EFI_SUCCESS             Video mode information is returned.\r
+  @retval EFI_INVALID_PARAMETER   Invalid parameters if Mode == NULL.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -42,7 +43,7 @@ EFIAPI
 ConSpliterConsoleControlGetMode (\r
   IN  EFI_CONSOLE_CONTROL_PROTOCOL    *This,\r
   OUT EFI_CONSOLE_CONTROL_SCREEN_MODE *Mode,\r
-  OUT BOOLEAN                         *GopExists,\r
+  OUT BOOLEAN                         *GopUgaExists,\r
   OUT BOOLEAN                         *StdInLocked\r
   )\r
 {\r
@@ -57,11 +58,11 @@ ConSpliterConsoleControlGetMode (
 \r
   *Mode = Private->ConsoleOutputMode;\r
 \r
-  if (GopExists != NULL) {\r
-    *GopExists = FALSE;\r
+  if (GopUgaExists != NULL) {\r
+    *GopUgaExists = FALSE;\r
     for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {\r
       if ((Private->TextOutList[Index].GraphicsOutput != NULL) || (Private->TextOutList[Index].UgaDraw != NULL)) {\r
-        *GopExists = TRUE;\r
+        *GopUgaExists = TRUE;\r
         break;\r
       }\r
     }\r
@@ -207,7 +208,7 @@ ConSpliterGraphicsOutputQueryMode (
 \r
 \r
 /**\r
-  Graphics output protocol interface to set video mode\r
+  Graphics output protocol interface to set video mode.\r
 \r
   @param  This                    Protocol instance pointer.\r
   @param  ModeNumber              The mode number to be set.\r
@@ -247,9 +248,6 @@ ConSpliterGraphicsOutputSetMode (
 \r
   Private = GRAPHICS_OUTPUT_SPLITTER_PRIVATE_DATA_FROM_THIS (This);\r
 \r
-  //\r
-  // GopDevNullSetMode ()\r
-  //\r
   ReturnStatus = EFI_SUCCESS;\r
 \r
   //\r
@@ -330,6 +328,52 @@ ConSpliterGraphicsOutputSetMode (
   return ReturnStatus;\r
 }\r
 \r
+/**\r
+  The following table defines actions for BltOperations.\r
+\r
+  EfiBltVideoFill - Write data from the  BltBuffer pixel (SourceX, SourceY)\r
+  directly to every pixel of the video display rectangle\r
+  (DestinationX, DestinationY)\r
+  (DestinationX + Width, DestinationY + Height).\r
+  Only one pixel will be used from the BltBuffer. Delta is NOT used.\r
+  EfiBltVideoToBltBuffer - Read data from the video display rectangle\r
+  (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in\r
+  the BltBuffer rectangle (DestinationX, DestinationY )\r
+  (DestinationX + Width, DestinationY + Height). If DestinationX or\r
+  DestinationY is not zero then Delta must be set to the length in bytes\r
+  of a row in the BltBuffer.\r
+  EfiBltBufferToVideo - Write data from the  BltBuffer rectangle\r
+  (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the\r
+  video display rectangle (DestinationX, DestinationY)\r
+  (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is\r
+  not zero then Delta must be set to the length in bytes of a row in the\r
+  BltBuffer.\r
+  EfiBltVideoToVideo - Copy from the video display rectangle\r
+  (SourceX, SourceY) (SourceX + Width, SourceY + Height) .\r
+  to the video display rectangle (DestinationX, DestinationY)\r
+  (DestinationX + Width, DestinationY + Height).\r
+  The BltBuffer and Delta  are not used in this mode.\r
+\r
+  @param  Private                 Protocol instance pointer.\r
+  @param  BltBuffer               Buffer containing data to blit into video buffer.\r
+                                  This buffer has a size of\r
+                                  Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
+  @param  BltOperation            Operation to perform on BlitBuffer and video\r
+                                  memory\r
+  @param  SourceX                 X coordinate of source for the BltBuffer.\r
+  @param  SourceY                 Y coordinate of source for the BltBuffer.\r
+  @param  DestinationX            X coordinate of destination for the BltBuffer.\r
+  @param  DestinationY            Y coordinate of destination for the BltBuffer.\r
+  @param  Width                   Width of rectangle in BltBuffer in pixels.\r
+  @param  Height                  Hight of rectangle in BltBuffer in pixels. \r
+  @param  Delta                   OPTIONAL.\r
+\r
+  @retval EFI_SUCCESS             The Blt operation completed.\r
+  @retval EFI_INVALID_PARAMETER   BltOperation is not valid.\r
+  @retval EFI_DEVICE_ERROR        A hardware error occured writting to the video\r
+                                  buffer.\r
+\r
+**/\r
 EFI_STATUS\r
 DevNullGraphicsOutputBlt (\r
   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA                *Private,\r
@@ -485,8 +529,8 @@ DevNullGraphicsOutputBlt (
   @param  DestinationX            X coordinate of destination for the BltBuffer.\r
   @param  DestinationY            Y coordinate of destination for the BltBuffer.\r
   @param  Width                   Width of rectangle in BltBuffer in pixels.\r
-  @param  Height                  Hight of rectangle in BltBuffer in pixels. Delta\r
-                                         -\r
+  @param  Height                  Hight of rectangle in BltBuffer in pixels. \r
+  @param  Delta                   OPTIONAL.\r
 \r
   @retval EFI_SUCCESS             The Blt operation completed.\r
   @retval EFI_INVALID_PARAMETER   BltOperation is not valid.\r
@@ -593,6 +637,20 @@ ConSpliterGraphicsOutputBlt (
   return ReturnStatus;\r
 }\r
 \r
+/**\r
+  Write data from the buffer to video display based on Graphics Output setting. \r
+\r
+  @param  Private                 Consplitter Text Out pointer.\r
+  @param  GraphicsOutput          Graphics Output protocol pointer.\r
+  @param  UgaDraw                 UGA Draw protocol pointer.\r
+\r
+  @retval EFI_UNSUPPORTED         No graphics devcie available .\r
+  @retval EFI_SUCCESS             The Blt operation completed.\r
+  @retval EFI_INVALID_PARAMETER   BltOperation is not valid.\r
+  @retval EFI_DEVICE_ERROR        A hardware error occured writting to the video buffer.\r
+                 \r
+\r
+**/\r
 EFI_STATUS\r
 DevNullGopSync (\r
   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private,\r
@@ -799,6 +857,52 @@ ConSpliterUgaDrawSetMode (
   return ReturnStatus;\r
 }\r
 \r
+/**\r
+  The following table defines actions for BltOperations.\r
+\r
+  EfiBltVideoFill - Write data from the  BltBuffer pixel (SourceX, SourceY)\r
+  directly to every pixel of the video display rectangle\r
+  (DestinationX, DestinationY)\r
+  (DestinationX + Width, DestinationY + Height).\r
+  Only one pixel will be used from the BltBuffer. Delta is NOT used.\r
+  EfiBltVideoToBltBuffer - Read data from the video display rectangle\r
+  (SourceX, SourceY) (SourceX + Width, SourceY + Height) and place it in\r
+  the BltBuffer rectangle (DestinationX, DestinationY )\r
+  (DestinationX + Width, DestinationY + Height). If DestinationX or\r
+  DestinationY is not zero then Delta must be set to the length in bytes\r
+  of a row in the BltBuffer.\r
+  EfiBltBufferToVideo - Write data from the  BltBuffer rectangle\r
+  (SourceX, SourceY) (SourceX + Width, SourceY + Height) directly to the\r
+  video display rectangle (DestinationX, DestinationY)\r
+  (DestinationX + Width, DestinationY + Height). If SourceX or SourceY is\r
+  not zero then Delta must be set to the length in bytes of a row in the\r
+  BltBuffer.\r
+  EfiBltVideoToVideo - Copy from the video display rectangle\r
+  (SourceX, SourceY) (SourceX + Width, SourceY + Height) .\r
+  to the video display rectangle (DestinationX, DestinationY)\r
+  (DestinationX + Width, DestinationY + Height).\r
+  The BltBuffer and Delta  are not used in this mode.\r
+\r
+  @param  Private                 Protocol instance pointer.\r
+  @param  BltBuffer               Buffer containing data to blit into video buffer.\r
+                                  This buffer has a size of\r
+                                  Width*Height*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
+  @param  BltOperation            Operation to perform on BlitBuffer and video\r
+                                  memory\r
+  @param  SourceX                 X coordinate of source for the BltBuffer.\r
+  @param  SourceY                 Y coordinate of source for the BltBuffer.\r
+  @param  DestinationX            X coordinate of destination for the BltBuffer.\r
+  @param  DestinationY            Y coordinate of destination for the BltBuffer.\r
+  @param  Width                   Width of rectangle in BltBuffer in pixels.\r
+  @param  Height                  Hight of rectangle in BltBuffer in pixels. \r
+  @param  Delta                   OPTIONAL.\r
+\r
+  @retval EFI_SUCCESS             The Blt operation completed.\r
+  @retval EFI_INVALID_PARAMETER   BltOperation is not valid.\r
+  @retval EFI_DEVICE_ERROR        A hardware error occured writting to the video\r
+                                  buffer.\r
+\r
+**/\r
 EFI_STATUS\r
 DevNullUgaBlt (\r
   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA                *Private,\r
@@ -954,8 +1058,8 @@ DevNullUgaBlt (
   @param  DestinationX            X coordinate of destination for the BltBuffer.\r
   @param  DestinationY            Y coordinate of destination for the BltBuffer.\r
   @param  Width                   Width of rectangle in BltBuffer in pixels.\r
-  @param  Height                  Hight of rectangle in BltBuffer in pixels. Delta\r
-                                         -\r
+  @param  Height                  Hight of rectangle in BltBuffer in pixels.\r
+  @param  Delta                   OPTIONAL.\r
 \r
   @retval EFI_SUCCESS             The Blt operation completed.\r
   @retval EFI_INVALID_PARAMETER   BltOperation is not valid.\r
@@ -1059,6 +1163,19 @@ ConSpliterUgaDrawBlt (
   return ReturnStatus;\r
 }\r
 \r
+/**\r
+  Write data from the buffer to video display based on UGA Draw setting. \r
+\r
+  @param  Private                 Consplitter Text Out pointer.\r
+  @param  GraphicsOutput          Graphics Output protocol pointer.\r
+  @param  UgaDraw                 UGA Draw protocol pointer.\r
+\r
+  @retval EFI_UNSUPPORTED         No graphics devcie available .\r
+  @retval EFI_SUCCESS             The Blt operation completed.\r
+  @retval EFI_INVALID_PARAMETER   BltOperation is not valid.\r
+  @retval EFI_DEVICE_ERROR        A hardware error occured writting to the video buffer.\r
+                  \r
+**/\r
 EFI_STATUS\r
 DevNullUgaSync (\r
   IN  TEXT_OUT_SPLITTER_PRIVATE_DATA  *Private,\r
@@ -1230,7 +1347,7 @@ DevNullTextOutOutputString (
         Attribute = NullAttributes + SizeAttribute;\r
 \r
         for (Index = 0; Index < MaxColumn; Index++, Screen++, Attribute++) {\r
-          *Screen     = ' ';\r
+          *Screen     = L' ';\r
           *Attribute  = Mode->Attribute;\r
         }\r
       } else {\r
@@ -1349,7 +1466,7 @@ DevNullTextOutSetMode (
   if (Private->TextOutModeMap != NULL) {\r
     CurrentMode = *(Private->TextOutModeMap + Private->TextOutListCount * ModeNumber);\r
   } else {\r
-    CurrentMode = (INT32)(ModeNumber);\r
+    CurrentMode = (INT32) (ModeNumber);\r
   }\r
   Mode    = &(Private->TextOutQueryData[CurrentMode]);\r
   Row     = Mode->Rows;\r
@@ -1426,7 +1543,7 @@ DevNullTextOutClearScreen (
 \r
   for (Row = 0; Row < Private->DevNullRows; Row++) {\r
     for (Column = 0; Column < Private->DevNullColumns; Column++, Screen++, Attributes++) {\r
-      *Screen     = ' ';\r
+      *Screen     = L' ';\r
       *Attributes = CurrentAttribute;\r
     }\r
     //\r