summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>2012-10-08 02:34:33 +0000
committerli-elvin <li-elvin@6f19259b-4bc3-4df7-8a09-765794883524>2012-10-08 02:34:33 +0000
commitf58fcb0a1df34c32130dc852ae083895e2e52923 (patch)
tree822db4f1b58b2d76399d9046b36eaf297dc89dd5 /MdeModulePkg
parentf330ff35dc620af1a099dd96b9dd0534f44505d7 (diff)
downloadedk2-f58fcb0a1df34c32130dc852ae083895e2e52923.zip
edk2-f58fcb0a1df34c32130dc852ae083895e2e52923.tar.gz
edk2-f58fcb0a1df34c32130dc852ae083895e2e52923.tar.bz2
Move GOP and UGA draw from Consplitter entrypoint to start(). When there is one real physical graphics device in system, Consplitter will expose GOP/UGA protocol on the virtual handle. In addition, fix a obvious logic issue in GraphicsConsole.
Signed-off-by: Li Elvin <elvin.li@intel.com> Reviewed-by: Ni Ruiyu <ruiyu.ni@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13787 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c113
-rw-r--r--MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c3
2 files changed, 58 insertions, 58 deletions
diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
index 870d429..2508273 100644
--- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
+++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c
@@ -418,49 +418,12 @@ ConSplitterDriverEntry(
//
Status = ConSplitterTextOutConstructor (&mConOut);
if (!EFI_ERROR (Status)) {
- if (!FeaturePcdGet (PcdConOutGopSupport)) {
- //
- // If Graphics Outpurt protocol not supported, UGA Draw protocol is installed
- // on the virtual handle.
- //
- Status = gBS->InstallMultipleProtocolInterfaces (
- &mConOut.VirtualHandle,
- &gEfiSimpleTextOutProtocolGuid,
- &mConOut.TextOut,
- &gEfiUgaDrawProtocolGuid,
- &mConOut.UgaDraw,
- NULL
- );
- } else if (!FeaturePcdGet (PcdConOutUgaSupport)) {
- //
- // If UGA Draw protocol not supported, Graphics Output Protocol is installed
- // on virtual handle.
- //
- Status = gBS->InstallMultipleProtocolInterfaces (
- &mConOut.VirtualHandle,
- &gEfiSimpleTextOutProtocolGuid,
- &mConOut.TextOut,
- &gEfiGraphicsOutputProtocolGuid,
- &mConOut.GraphicsOutput,
- NULL
- );
- } else {
- //
- // Boot Graphics Output protocol and UGA Draw protocol are supported,
- // both they will be installed on virtual handle.
- //
- Status = gBS->InstallMultipleProtocolInterfaces (
- &mConOut.VirtualHandle,
- &gEfiSimpleTextOutProtocolGuid,
- &mConOut.TextOut,
- &gEfiGraphicsOutputProtocolGuid,
- &mConOut.GraphicsOutput,
- &gEfiUgaDrawProtocolGuid,
- &mConOut.UgaDraw,
- NULL
- );
- }
-
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &mConOut.VirtualHandle,
+ &gEfiSimpleTextOutProtocolGuid,
+ &mConOut.TextOut,
+ NULL
+ );
if (!EFI_ERROR (Status)) {
//
// Update the EFI System Table with new virtual console
@@ -1315,7 +1278,7 @@ ConSplitterConOutDriverBindingStart (
FreePool (Info);
- } else if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {
+ } else if (UgaDraw != NULL) {
Status = UgaDraw->GetMode (
UgaDraw,
&mConOut.UgaHorizontalResolution,
@@ -2798,7 +2761,7 @@ ConSplitterAddGraphicsOutputMode (
}
}
}
- } else if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {
+ } else if (UgaDraw != NULL) {
//
// Graphics console driver can ensure the same mode for all GOP devices
// so we can get the current mode from this video device
@@ -2838,7 +2801,7 @@ Done:
if (GraphicsOutput != NULL) {
Private->CurrentNumberOfGraphicsOutput++;
}
- if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {
+ if (UgaDraw != NULL) {
Private->CurrentNumberOfUgaDraw++;
}
@@ -3061,13 +3024,13 @@ ConSplitterTextOutAddDevice (
ASSERT (MaxMode >= 1);
DeviceStatus = EFI_DEVICE_ERROR;
- if (FeaturePcdGet (PcdConOutGopSupport)) {
- //
- // If GOP is produced by Consplitter, this device display mode will be added into Graphics Ouput modes.
- //
- if ((GraphicsOutput != NULL) || (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport))) {
- DeviceStatus = ConSplitterAddGraphicsOutputMode (Private, GraphicsOutput, UgaDraw);
- }
+ Status = EFI_DEVICE_ERROR;
+
+ //
+ // This device display mode will be added into Graphics Ouput modes.
+ //
+ if ((GraphicsOutput != NULL) || (UgaDraw != NULL)) {
+ DeviceStatus = ConSplitterAddGraphicsOutputMode (Private, GraphicsOutput, UgaDraw);
}
if (FeaturePcdGet (PcdConOutUgaSupport)) {
@@ -3086,7 +3049,7 @@ ConSplitterTextOutAddDevice (
FreePool (Info);
- } else if (UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {
+ } else if (UgaDraw != NULL) {
Status = UgaDraw->GetMode (
UgaDraw,
&UgaHorizontalResolution,
@@ -3121,6 +3084,46 @@ ConSplitterTextOutAddDevice (
}
}
+ if (((!EFI_ERROR (DeviceStatus)) || (!EFI_ERROR (Status))) &&
+ ((Private->CurrentNumberOfGraphicsOutput + Private->CurrentNumberOfUgaDraw) == 1)) {
+ if (!FeaturePcdGet (PcdConOutGopSupport)) {
+ //
+ // If Graphics Outpurt protocol not supported, UGA Draw protocol is installed
+ // on the virtual handle.
+ //
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &mConOut.VirtualHandle,
+ &gEfiUgaDrawProtocolGuid,
+ &mConOut.UgaDraw,
+ NULL
+ );
+ } else if (!FeaturePcdGet (PcdConOutUgaSupport)) {
+ //
+ // If UGA Draw protocol not supported, Graphics Output Protocol is installed
+ // on virtual handle.
+ //
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &mConOut.VirtualHandle,
+ &gEfiGraphicsOutputProtocolGuid,
+ &mConOut.GraphicsOutput,
+ NULL
+ );
+ } else {
+ //
+ // Boot Graphics Output protocol and UGA Draw protocol are supported,
+ // both they will be installed on virtual handle.
+ //
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &mConOut.VirtualHandle,
+ &gEfiGraphicsOutputProtocolGuid,
+ &mConOut.GraphicsOutput,
+ &gEfiUgaDrawProtocolGuid,
+ &mConOut.UgaDraw,
+ NULL
+ );
+ }
+ }
+
//
// After adding new console device, all existing console devices should be
// synced to the current shared mode.
@@ -3161,7 +3164,7 @@ ConSplitterTextOutDeleteDevice (
TextOutList = Private->TextOutList;
while (Index >= 0) {
if (TextOutList->TextOut == TextOut) {
- if (TextOutList->UgaDraw != NULL && FeaturePcdGet (PcdUgaConsumeSupport)) {
+ if (TextOutList->UgaDraw != NULL) {
Private->CurrentNumberOfUgaDraw--;
}
if (TextOutList->GraphicsOutput != NULL) {
diff --git a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
index 7167033..52b0ec6 100644
--- a/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
+++ b/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsole.c
@@ -533,9 +533,6 @@ GraphicsConsoleControllerDriverStart (
goto Error;
}
}
- } else {
- Status = EFI_UNSUPPORTED;
- goto Error;
}
}