mirror of https://github.com/acidanthera/audk.git
1. Update Generic BDS part to use dynamic PCD to set console output mode instead of use L"ConOutMode" and gEfiGenericPlatformVariableGuid to set console output mode.
2. Drop the menu item of set Primary Video to PCI or AGP. If some platform wishes to set AGP video option, platform BDS code needs to add this item. 3. Minor update to use Raw String to performance logging git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7575 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
589f16d2bf
commit
6aa22a177c
|
@ -31,7 +31,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#include <Protocol/UgaDraw.h>
|
||||
#include <Protocol/BlockIo.h>
|
||||
#include <Guid/GlobalVariable.h>
|
||||
#include <Guid/GenericPlatformVariable.h>
|
||||
#include <Guid/CapsuleVendor.h>
|
||||
#include <Protocol/ConsoleControl.h>
|
||||
#include <Protocol/GenericMemoryTest.h>
|
||||
|
@ -44,7 +43,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
#include <Protocol/SerialIo.h>
|
||||
#include <Protocol/LegacyBios.h>
|
||||
#include <Protocol/SimpleTextInEx.h>
|
||||
#include <Protocol/Performance.h>
|
||||
|
||||
#include <Library/UefiDriverEntryPoint.h>
|
||||
#include <Library/PrintLib.h>
|
||||
|
|
|
@ -131,8 +131,6 @@
|
|||
gEfiBootStateGuid ## SOMETIMES_PRODUCES (Produce when status has not been set yet) ## Variable:L"BootState" (Indicate the state of last boot)
|
||||
gEfiFileSystemVolumeLabelInfoIdGuid ## CONSUMES ## GUID (Indicate the information type is volume)
|
||||
gEfiFileInfoGuid ## CONSUMES ## GUID (Indicate the information type is file)
|
||||
gEfiGenericPlatformVariableGuid ## PRODUCES ## Variable:L"ConOutMode" (The mode of console out device)
|
||||
## PRODUCES ## Variable:L"VBIOS" (The option of video BIOS)
|
||||
gEfiMiscSubClassGuid ## CONSUMES ## GUID (Indicate the datahub for holding misc sub class record)
|
||||
gEfiMemorySubClassGuid ## CONSUMES ## GUID (Indicate the datahub for holding memory record)
|
||||
gEfiProcessorSubClassGuid ## CONSUMES ## GUID (Indicate the datahub for holding processor record)
|
||||
|
@ -169,6 +167,8 @@
|
|||
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes
|
||||
gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLang
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn
|
||||
|
||||
[Depex]
|
||||
gEfiHiiDatabaseProtocolGuid
|
||||
|
|
|
@ -288,8 +288,8 @@ BdsEntry (
|
|||
//
|
||||
// Insert the performance probe
|
||||
//
|
||||
PERF_END (0, DXE_TOK, NULL, 0);
|
||||
PERF_START (0, BDS_TOK, NULL, 0);
|
||||
PERF_END (0, "DXE", NULL, 0);
|
||||
PERF_START (0, "BDS", NULL, 0);
|
||||
|
||||
//
|
||||
// Initialize the global system boot option and driver option
|
||||
|
|
|
@ -918,25 +918,20 @@ GetConsoleOutMode (
|
|||
UINTN Mode;
|
||||
UINTN MaxMode;
|
||||
EFI_STATUS Status;
|
||||
CONSOLE_OUT_MODE *ModeInfo;
|
||||
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *ConOut;
|
||||
|
||||
ConOut = gST->ConOut;
|
||||
MaxMode = (UINTN) (ConOut->Mode->MaxMode);
|
||||
ModeInfo = EfiLibGetVariable (VAR_CON_OUT_MODE, &gEfiGenericPlatformVariableGuid);
|
||||
|
||||
if (ModeInfo != NULL) {
|
||||
CurrentCol = ModeInfo->Column;
|
||||
CurrentRow = ModeInfo->Row;
|
||||
for (Mode = 0; Mode < MaxMode; Mode++) {
|
||||
Status = ConOut->QueryMode (ConOut, Mode, &Col, &Row);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
if (CurrentCol == Col && CurrentRow == Row) {
|
||||
CallbackData->BmmFakeNvData.ConsoleOutMode = (UINT16) Mode;
|
||||
break;
|
||||
}
|
||||
CurrentCol = PcdGet32 (PcdConOutColumn);
|
||||
CurrentRow = PcdGet32 (PcdConOutRow);
|
||||
for (Mode = 0; Mode < MaxMode; Mode++) {
|
||||
Status = ConOut->QueryMode (ConOut, Mode, &Col, &Row);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
if (CurrentCol == Col && CurrentRow == Row) {
|
||||
CallbackData->BmmFakeNvData.ConsoleOutMode = (UINT16) Mode;
|
||||
break;
|
||||
}
|
||||
}
|
||||
FreePool (ModeInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1399,18 +1399,10 @@ Var_UpdateConMode (
|
|||
Mode = CallbackData->BmmFakeNvData.ConsoleOutMode;
|
||||
|
||||
Status = gST->ConOut->QueryMode (gST->ConOut, Mode, &(ModeInfo.Column), &(ModeInfo.Row));
|
||||
if (EFI_ERROR(Status)) {
|
||||
ModeInfo.Column = 80;
|
||||
ModeInfo.Row = 25;
|
||||
if (!EFI_ERROR(Status)) {
|
||||
PcdSet32 (PcdConOutColumn, (UINT32) ModeInfo.Column);
|
||||
PcdSet32 (PcdConOutRow, (UINT32) ModeInfo.Row);
|
||||
}
|
||||
|
||||
Status = gRT->SetVariable (
|
||||
VAR_CON_OUT_MODE,
|
||||
&gEfiGenericPlatformVariableGuid,
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||
sizeof (CONSOLE_OUT_MODE),
|
||||
&ModeInfo
|
||||
);
|
||||
|
||||
return Status;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -67,44 +67,18 @@ DeviceManagerCallback (
|
|||
OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
|
||||
)
|
||||
{
|
||||
DEVICE_MANAGER_CALLBACK_DATA *PrivateData;
|
||||
|
||||
if ((Value == NULL) || (ActionRequest == NULL)) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
PrivateData = DEVICE_MANAGER_CALLBACK_DATA_FROM_THIS (This);
|
||||
|
||||
switch (QuestionId) {
|
||||
case DEVICE_MANAGER_KEY_VBIOS:
|
||||
PrivateData->VideoBios = Value->u8;
|
||||
gRT->SetVariable (
|
||||
L"VBIOS",
|
||||
&gEfiGenericPlatformVariableGuid,
|
||||
EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE,
|
||||
sizeof (UINT8),
|
||||
&PrivateData->VideoBios
|
||||
);
|
||||
gCallbackKey = QuestionId;
|
||||
|
||||
//
|
||||
// Tell browser not to ask for confirmation of changes,
|
||||
// since we have already applied.
|
||||
//
|
||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_SUBMIT;
|
||||
break;
|
||||
//
|
||||
// Request to exit SendForm(), so as to switch to selected form
|
||||
//
|
||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
|
||||
|
||||
default:
|
||||
//
|
||||
// The key corresponds the Handle Index which was requested to be displayed
|
||||
//
|
||||
gCallbackKey = QuestionId;
|
||||
|
||||
//
|
||||
// Request to exit SendForm(), so as to switch to selected form
|
||||
//
|
||||
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
|
||||
break;
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
@ -186,9 +160,6 @@ CallDeviceManager (
|
|||
EFI_HII_UPDATE_DATA UpdateData[MENU_ITEM_NUM];
|
||||
EFI_STRING_ID Token;
|
||||
EFI_STRING_ID TokenHelp;
|
||||
IFR_OPTION *IfrOptionList;
|
||||
UINT8 *VideoOption;
|
||||
UINTN VideoOptionSize;
|
||||
EFI_HII_HANDLE *HiiHandles;
|
||||
UINTN HandleBufferLength;
|
||||
UINTN NumberOfHiiHandles;
|
||||
|
@ -199,8 +170,6 @@ CallDeviceManager (
|
|||
EFI_BROWSER_ACTION_REQUEST ActionRequest;
|
||||
EFI_HII_PACKAGE_LIST_HEADER *PackageList;
|
||||
|
||||
IfrOptionList = NULL;
|
||||
VideoOption = NULL;
|
||||
HiiHandles = NULL;
|
||||
HandleBufferLength = 0;
|
||||
|
||||
|
@ -296,47 +265,6 @@ CallDeviceManager (
|
|||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Add oneof for video BIOS selection
|
||||
//
|
||||
VideoOption = BdsLibGetVariableAndSize (
|
||||
L"VBIOS",
|
||||
&gEfiGenericPlatformVariableGuid,
|
||||
&VideoOptionSize
|
||||
);
|
||||
if (VideoOption == NULL) {
|
||||
gDeviceManagerPrivate.VideoBios = 0;
|
||||
} else {
|
||||
gDeviceManagerPrivate.VideoBios = VideoOption[0];
|
||||
FreePool (VideoOption);
|
||||
}
|
||||
|
||||
ASSERT (gDeviceManagerPrivate.VideoBios <= 1);
|
||||
|
||||
IfrOptionList = AllocatePool (2 * sizeof (IFR_OPTION));
|
||||
ASSERT (IfrOptionList != NULL);
|
||||
IfrOptionList[0].Flags = 0;
|
||||
IfrOptionList[0].StringToken = STRING_TOKEN (STR_ONE_OF_PCI);
|
||||
IfrOptionList[0].Value.u8 = 0;
|
||||
IfrOptionList[1].Flags = 0;
|
||||
IfrOptionList[1].StringToken = STRING_TOKEN (STR_ONE_OF_AGP);
|
||||
IfrOptionList[1].Value.u8 = 1;
|
||||
IfrOptionList[gDeviceManagerPrivate.VideoBios].Flags |= EFI_IFR_OPTION_DEFAULT;
|
||||
|
||||
UpdateData[0].Offset = 0;
|
||||
CreateOneOfOpCode (
|
||||
DEVICE_MANAGER_KEY_VBIOS,
|
||||
0,
|
||||
0,
|
||||
STRING_TOKEN (STR_ONE_OF_VBIOS),
|
||||
STRING_TOKEN (STR_ONE_OF_VBIOS_HELP),
|
||||
EFI_IFR_FLAG_CALLBACK,
|
||||
EFI_IFR_NUMERIC_SIZE_1,
|
||||
IfrOptionList,
|
||||
2,
|
||||
&UpdateData[0]
|
||||
);
|
||||
|
||||
IfrLibUpdateForm (
|
||||
HiiHandle,
|
||||
&mDeviceManagerGuid,
|
||||
|
|
Binary file not shown.
|
@ -26,7 +26,7 @@
|
|||
#define LABEL_END 0xffff
|
||||
|
||||
#define DEVICE_MANAGER_CLASS 0x0000
|
||||
#define FRONT_PAGE_SUBCLASS 0x0003
|
||||
#define FRONT_PAGE_SUBCLASS 0x0003
|
||||
|
||||
#define DEVICE_MANAGER_FORM_ID 0x1000
|
||||
|
||||
|
|
Loading…
Reference in New Issue