Remove some unnecessary clear screen from console drivers.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10590 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
li-elvin 2010-06-18 09:19:29 +00:00
parent 35f9e94ed4
commit 46f0e2a9ee
2 changed files with 53 additions and 30 deletions

View File

@ -2630,6 +2630,7 @@ ConSplitterAddGraphicsOutputMode (
Index = 0;
CurrentIndex = 0;
Status = EFI_SUCCESS;
if (Private->CurrentNumberOfUgaDraw != 0) {
//
@ -2834,21 +2835,48 @@ Done:
// regardless whether the console is in EfiConsoleControlScreenGraphics or EfiConsoleControlScreenText mode
//
Private->HardwareNeedsStarting = TRUE;
//
// Current mode number may need update now, so set it to an invalid mode number
//
CurrentGraphicsOutputMode->Mode = 0xffff;
//
// Graphics console can ensure all GOP devices have the same mode which can be taken as current mode.
//
Status = Private->GraphicsOutput.SetMode (&Private->GraphicsOutput, (UINT32) CurrentIndex);
if (EFI_ERROR(Status)) {
Mode = &Private->GraphicsOutputModeBuffer[CurrentIndex];
if ((GraphicsOutput != NULL) &&
(Mode->HorizontalResolution == CurrentGraphicsOutputMode->Info->HorizontalResolution) &&
(Mode->VerticalResolution == CurrentGraphicsOutputMode->Info->VerticalResolution)) {
CurrentGraphicsOutputMode->Mode = (UINT32) CurrentIndex;
if ((Mode->HorizontalResolution != GraphicsOutput->Mode->Info->HorizontalResolution) ||
(Mode->VerticalResolution != GraphicsOutput->Mode->Info->VerticalResolution)) {
//
// If all existing video device has been set to common mode, only set new GOP device to
// the common mode
//
for (NumberIndex = 0; NumberIndex < GraphicsOutput->Mode->MaxMode; NumberIndex ++) {
Status = GraphicsOutput->QueryMode (GraphicsOutput, (UINT32) NumberIndex, &SizeOfInfo, &Info);
if (EFI_ERROR (Status)) {
return Status;
}
if ((Info->HorizontalResolution == Mode->HorizontalResolution) && (Info->VerticalResolution == Mode->VerticalResolution)) {
FreePool (Info);
break;
}
FreePool (Info);
}
Status = GraphicsOutput->SetMode (GraphicsOutput, (UINT32) NumberIndex);
}
} else {
//
// If user defined mode is not valid for display device, set to the default mode 800x600.
// Current mode number may need update now, so set it to an invalid mode number
//
(Private->GraphicsOutputModeBuffer[0]).HorizontalResolution = 800;
(Private->GraphicsOutputModeBuffer[0]).VerticalResolution = 600;
Status = Private->GraphicsOutput.SetMode (&Private->GraphicsOutput, 0);
CurrentGraphicsOutputMode->Mode = 0xffff;
//
// Graphics console can ensure all GOP devices have the same mode which can be taken as current mode.
//
Status = Private->GraphicsOutput.SetMode (&Private->GraphicsOutput, (UINT32) CurrentIndex);
if (EFI_ERROR(Status)) {
//
// If user defined mode is not valid for display device, set to the default mode 800x600.
//
(Private->GraphicsOutputModeBuffer[0]).HorizontalResolution = 800;
(Private->GraphicsOutputModeBuffer[0]).VerticalResolution = 600;
Status = Private->GraphicsOutput.SetMode (&Private->GraphicsOutput, 0);
}
}
return Status;
@ -3067,11 +3095,6 @@ ConSplitterTextOutAddDevice (
}
}
//
// If ConOut, then set the mode to Mode #0 which us 80 x 25
//
Private->TextOut.SetMode (&Private->TextOut, 0);
//
// After adding new console device, all existing console devices should be
// synced to the current shared mode.
@ -4387,14 +4410,6 @@ ConSplitterTextOutSetMode (
Private->TextOutList[Index].TextOut,
TextOutModeMap[Index]
);
//
// If this console device is based on a GOP or UGA device, then sync up the bitmap from
// the GOP/UGA splitter and reclear the text portion of the display in the new mode.
//
if ((Private->TextOutList[Index].GraphicsOutput != NULL) || (Private->TextOutList[Index].UgaDraw != NULL)) {
Private->TextOutList[Index].TextOut->ClearScreen (Private->TextOutList[Index].TextOut);
}
if (EFI_ERROR (Status)) {
ReturnStatus = Status;
}

View File

@ -1,7 +1,7 @@
/** @file
This is the main routine for initializing the Graphics Console support routines.
Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -640,10 +640,18 @@ CheckModeSupported (
if (!EFI_ERROR (Status)) {
if ((Info->HorizontalResolution == HorizontalResolution) &&
(Info->VerticalResolution == VerticalResolution)) {
Status = GraphicsOutput->SetMode (GraphicsOutput, ModeNumber);
if (!EFI_ERROR (Status)) {
FreePool (Info);
if ((GraphicsOutput->Mode->Info->HorizontalResolution == HorizontalResolution) &&
(GraphicsOutput->Mode->Info->VerticalResolution == VerticalResolution)) {
//
// If video device has been set to this mode, we do not need to SetMode again
//
break;
} else {
Status = GraphicsOutput->SetMode (GraphicsOutput, ModeNumber);
if (!EFI_ERROR (Status)) {
FreePool (Info);
break;
}
}
}
FreePool (Info);