]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterGraphics.c
apply for doxgen format.
[mirror_edk2.git] / MdeModulePkg / Universal / Console / ConSplitterDxe / ConSplitterGraphics.c
index 3f720ac380aef0f4a94bd3cc6ace17932438a9b4..28de49c773b1633d511412c85de85dfa2494f182 100644 (file)
@@ -1,6 +1,10 @@
-/*++\r
+/** @file\r
+  Support for ConsoleControl protocol. Support for Graphics output spliter.\r
+  Support for DevNull Console Out. This console uses memory buffers\r
+  to represnt the console. It allows a console to start very early and\r
+  when a new console is added it is synced up with the current console.\r
 \r
-Copyright (c) 2006 - 2008, Intel Corporation\r
+Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -9,18 +13,8 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-Module Name:\r
-\r
-  ConSplitterGraphics.c\r
-\r
-Abstract:\r
-\r
-  Support for ConsoleControl protocol. Support for Graphics output spliter.\r
-  Support for DevNull Console Out. This console uses memory buffers\r
-  to represnt the console. It allows a console to start very early and\r
-  when a new console is added it is synced up with the current console\r
+**/\r
 \r
---*/\r
 \r
 #include "ConSplitter.h"\r
 \r
@@ -311,7 +305,7 @@ Routine Description:
       }\r
     }\r
 \r
-    if (EFI_ERROR (ReturnStatus)) {\r
+    if (EFI_ERROR (ReturnStatus) && FeaturePcdGet (PcdUgaConsumeSupport)) {\r
       UgaDraw = Private->TextOutList[Index].UgaDraw;\r
       if (UgaDraw != NULL) {\r
         Status = UgaDraw->SetMode (\r
@@ -581,7 +575,7 @@ ConSpliterGraphicsOutputBlt (
     }\r
 \r
     UgaDraw = Private->TextOutList[Index].UgaDraw;\r
-    if (UgaDraw != NULL) {\r
+    if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {\r
       Status = UgaDraw->Blt (\r
                               UgaDraw,\r
                               (EFI_UGA_PIXEL *) BltBuffer,\r
@@ -628,7 +622,7 @@ DevNullGopSync (
                       Private->GraphicsOutput.Mode->Info->VerticalResolution,\r
                       0\r
                       );\r
-  } else {\r
+  } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {\r
     return UgaDraw->Blt (\r
                       UgaDraw,\r
                       (EFI_UGA_PIXEL *) Private->GraphicsOutputBlt,\r
@@ -641,6 +635,8 @@ DevNullGopSync (
                       Private->GraphicsOutput.Mode->Info->VerticalResolution,\r
                       0\r
                       );\r
+  } else {\r
+    return EFI_UNSUPPORTED;\r
   }\r
 }\r
 \r
@@ -767,17 +763,22 @@ ConSpliterUgaDrawSetMode (
   // return the worst status met\r
   //\r
   for (Index = 0; Index < Private->CurrentNumberOfConsoles; Index++) {\r
-    UgaDraw = Private->TextOutList[Index].UgaDraw;\r
-    if (UgaDraw != NULL) {\r
-      Status = UgaDraw->SetMode (\r
-                          UgaDraw,\r
-                          HorizontalResolution,\r
-                          VerticalResolution,\r
-                          ColorDepth,\r
-                          RefreshRate\r
-                          );\r
-      if (EFI_ERROR (Status)) {\r
-        ReturnStatus = Status;\r
+\r
+    ReturnStatus = EFI_UNSUPPORTED;\r
+\r
+    if (FeaturePcdGet (PcdUgaConsumeSupport)) {\r
+      UgaDraw = Private->TextOutList[Index].UgaDraw;\r
+      if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {\r
+        Status = UgaDraw->SetMode (\r
+                            UgaDraw,\r
+                            HorizontalResolution,\r
+                            VerticalResolution,\r
+                            ColorDepth,\r
+                            RefreshRate\r
+                            );\r
+        if (EFI_ERROR (Status)) {\r
+          ReturnStatus = Status;\r
+        }\r
       }\r
     }\r
 \r
@@ -1043,7 +1044,7 @@ ConSpliterUgaDrawBlt (
       }\r
     }\r
 \r
-    if (Private->TextOutList[Index].UgaDraw != NULL) {\r
+    if (Private->TextOutList[Index].UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {\r
       Status = Private->TextOutList[Index].UgaDraw->Blt (\r
                                                       Private->TextOutList[Index].UgaDraw,\r
                                                       BltBuffer,\r
@@ -1077,7 +1078,7 @@ DevNullUgaSync (
   IN  EFI_UGA_DRAW_PROTOCOL           *UgaDraw\r
   )\r
 {\r
-  if (UgaDraw != NULL) {\r
+  if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {\r
     return UgaDraw->Blt (\r
                       UgaDraw,\r
                       Private->UgaBlt,\r
@@ -1090,7 +1091,7 @@ DevNullUgaSync (
                       Private->UgaVerticalResolution,\r
                       Private->UgaHorizontalResolution * sizeof (EFI_UGA_PIXEL)\r
                       );\r
-  } else {\r
+  } else if (GraphicsOutput != NULL) {\r
     return GraphicsOutput->Blt (\r
                       GraphicsOutput,\r
                       (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) Private->UgaBlt,\r
@@ -1103,6 +1104,8 @@ DevNullUgaSync (
                       Private->UgaVerticalResolution,\r
                       0\r
                       );\r
+  } else {\r
+    return EFI_UNSUPPORTED;\r
   }\r
 }\r
 \r
@@ -1350,6 +1353,7 @@ DevNullTextOutSetMode (
 --*/\r
 {\r
   UINTN                         Size;\r
+  INT32                         CurrentMode;\r
   UINTN                         Row;\r
   UINTN                         Column;\r
   TEXT_OUT_SPLITTER_QUERY_DATA  *Mode;\r
@@ -1357,8 +1361,14 @@ DevNullTextOutSetMode (
   //\r
   // No extra check for ModeNumber here, as it has been checked in\r
   // ConSplitterTextOutSetMode. And mode 0 should always be supported.\r
+  // Row and Column should be fetched from intersection map.\r
   //\r
-  Mode    = &(Private->TextOutQueryData[ModeNumber]);\r
+  if (Private->TextOutModeMap != NULL) {\r
+    CurrentMode = *(Private->TextOutModeMap + Private->TextOutListCount * ModeNumber);\r
+  } else {\r
+    CurrentMode = (INT32)(ModeNumber);\r
+  }\r
+  Mode    = &(Private->TextOutQueryData[CurrentMode]);\r
   Row     = Mode->Rows;\r
   Column  = Mode->Columns;\r
 \r
@@ -1366,7 +1376,7 @@ DevNullTextOutSetMode (
     return EFI_UNSUPPORTED;\r
   }\r
 \r
-  if (Private->DevNullColumns != Column || Private->DevNullRows != Row) {\r
+  if (Private->TextOutMode.Mode != (INT32) ModeNumber) {\r
 \r
     Private->TextOutMode.Mode = (INT32) ModeNumber;\r
     Private->DevNullColumns   = Column;\r