//\r
Status = ConSplitterTextOutConstructor (&mConOut);\r
if (!EFI_ERROR (Status)) {\r
- if (!FeaturePcdGet (PcdConOutGopSupport)) {\r
- //\r
- // If Graphics Outpurt protocol not supported, UGA Draw protocol is installed\r
- // on the virtual handle.\r
- //\r
- Status = gBS->InstallMultipleProtocolInterfaces (\r
- &mConOut.VirtualHandle,\r
- &gEfiSimpleTextOutProtocolGuid,\r
- &mConOut.TextOut,\r
- &gEfiUgaDrawProtocolGuid,\r
- &mConOut.UgaDraw,\r
- NULL\r
- );\r
- } else if (!FeaturePcdGet (PcdConOutUgaSupport)) {\r
- //\r
- // If UGA Draw protocol not supported, Graphics Output Protocol is installed\r
- // on virtual handle.\r
- //\r
- Status = gBS->InstallMultipleProtocolInterfaces (\r
- &mConOut.VirtualHandle,\r
- &gEfiSimpleTextOutProtocolGuid,\r
- &mConOut.TextOut,\r
- &gEfiGraphicsOutputProtocolGuid,\r
- &mConOut.GraphicsOutput,\r
- NULL\r
- );\r
- } else {\r
- //\r
- // Boot Graphics Output protocol and UGA Draw protocol are supported,\r
- // both they will be installed on virtual handle.\r
- //\r
- Status = gBS->InstallMultipleProtocolInterfaces (\r
- &mConOut.VirtualHandle,\r
- &gEfiSimpleTextOutProtocolGuid,\r
- &mConOut.TextOut,\r
- &gEfiGraphicsOutputProtocolGuid,\r
- &mConOut.GraphicsOutput,\r
- &gEfiUgaDrawProtocolGuid,\r
- &mConOut.UgaDraw,\r
- NULL\r
- );\r
- }\r
-\r
+ Status = gBS->InstallMultipleProtocolInterfaces (\r
+ &mConOut.VirtualHandle,\r
+ &gEfiSimpleTextOutProtocolGuid,\r
+ &mConOut.TextOut,\r
+ NULL\r
+ );\r
if (!EFI_ERROR (Status)) {\r
//\r
// Update the EFI System Table with new virtual console\r
\r
FreePool (Info);\r
\r
- } else if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {\r
+ } else if (UgaDraw != NULL) {\r
Status = UgaDraw->GetMode (\r
UgaDraw,\r
&mConOut.UgaHorizontalResolution,\r
}\r
}\r
}\r
- } else if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {\r
+ } else if (UgaDraw != NULL) {\r
//\r
// Graphics console driver can ensure the same mode for all GOP devices\r
// so we can get the current mode from this video device\r
if (GraphicsOutput != NULL) {\r
Private->CurrentNumberOfGraphicsOutput++;\r
}\r
- if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {\r
+ if (UgaDraw != NULL) {\r
Private->CurrentNumberOfUgaDraw++;\r
}\r
\r
ASSERT (MaxMode >= 1);\r
\r
DeviceStatus = EFI_DEVICE_ERROR;\r
- if (FeaturePcdGet (PcdConOutGopSupport)) {\r
- //\r
- // If GOP is produced by Consplitter, this device display mode will be added into Graphics Ouput modes.\r
- //\r
- if ((GraphicsOutput != NULL) || (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport))) {\r
- DeviceStatus = ConSplitterAddGraphicsOutputMode (Private, GraphicsOutput, UgaDraw);\r
- }\r
+ Status = EFI_DEVICE_ERROR;\r
+ \r
+ //\r
+ // This device display mode will be added into Graphics Ouput modes.\r
+ //\r
+ if ((GraphicsOutput != NULL) || (UgaDraw != NULL)) {\r
+ DeviceStatus = ConSplitterAddGraphicsOutputMode (Private, GraphicsOutput, UgaDraw);\r
}\r
\r
if (FeaturePcdGet (PcdConOutUgaSupport)) {\r
\r
FreePool (Info);\r
\r
- } else if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {\r
+ } else if (UgaDraw != NULL) {\r
Status = UgaDraw->GetMode (\r
UgaDraw,\r
&UgaHorizontalResolution,\r
}\r
}\r
\r
+ if (((!EFI_ERROR (DeviceStatus)) || (!EFI_ERROR (Status))) &&\r
+ ((Private->CurrentNumberOfGraphicsOutput + Private->CurrentNumberOfUgaDraw) == 1)) {\r
+ if (!FeaturePcdGet (PcdConOutGopSupport)) {\r
+ //\r
+ // If Graphics Outpurt protocol not supported, UGA Draw protocol is installed\r
+ // on the virtual handle.\r
+ //\r
+ Status = gBS->InstallMultipleProtocolInterfaces (\r
+ &mConOut.VirtualHandle,\r
+ &gEfiUgaDrawProtocolGuid,\r
+ &mConOut.UgaDraw,\r
+ NULL\r
+ );\r
+ } else if (!FeaturePcdGet (PcdConOutUgaSupport)) {\r
+ //\r
+ // If UGA Draw protocol not supported, Graphics Output Protocol is installed\r
+ // on virtual handle.\r
+ //\r
+ Status = gBS->InstallMultipleProtocolInterfaces (\r
+ &mConOut.VirtualHandle,\r
+ &gEfiGraphicsOutputProtocolGuid,\r
+ &mConOut.GraphicsOutput,\r
+ NULL\r
+ );\r
+ } else {\r
+ //\r
+ // Boot Graphics Output protocol and UGA Draw protocol are supported,\r
+ // both they will be installed on virtual handle.\r
+ //\r
+ Status = gBS->InstallMultipleProtocolInterfaces (\r
+ &mConOut.VirtualHandle,\r
+ &gEfiGraphicsOutputProtocolGuid,\r
+ &mConOut.GraphicsOutput,\r
+ &gEfiUgaDrawProtocolGuid,\r
+ &mConOut.UgaDraw,\r
+ NULL\r
+ );\r
+ }\r
+ }\r
+\r
//\r
// After adding new console device, all existing console devices should be\r
// synced to the current shared mode.\r
TextOutList = Private->TextOutList;\r
while (Index >= 0) {\r
if (TextOutList->TextOut == TextOut) {\r
- if (TextOutList->UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {\r
+ if (TextOutList->UgaDraw != NULL) {\r
Private->CurrentNumberOfUgaDraw--;\r
}\r
if (TextOutList->GraphicsOutput != NULL) {\r