提交 519c72f5 编写于 作者: P PMheart

ocvalidate: Add check for ResizeGpuBars

上级 ccc00f3b
......@@ -111,6 +111,7 @@ Utility to validate whether a `config.plist` matches requirements and convention
- When `AudioSupport` is enabled, AudioDevice cannot be empty and must be a valid path.
#### Quirks
- When `RequestBootVarRouting` is enabled, `OpenRuntime.efi` should be loaded in `UEFI->Drivers`.
- `ResizeGpuBars` must be set to an integer value between `-1` or `19`.
#### Drivers
- When `OpenUsbKbDxe.efi` is in use, `KeySupport` in `UEFI->Input` should never be enabled altogether.
- When `Ps2KeyboardDxe.efi` is in use, `KeySupport` in `UEFI->Input` should always be enabled altogether.
......
......@@ -153,6 +153,7 @@ CheckBooterQuirks (
BOOLEAN IsDisableVariableWriteEnabled;
BOOLEAN IsEnableWriteUnprotectorEnabled;
BOOLEAN HasOpenRuntimeEfiDriver;
INT8 ResizeAppleGpuBars;
ErrorCount = 0;
UserBooter = &Config->Booter;
......@@ -164,6 +165,7 @@ CheckBooterQuirks (
IsEnableWriteUnprotectorEnabled = UserBooter->Quirks.EnableWriteUnprotector;
HasOpenRuntimeEfiDriver = FALSE;
MaxSlide = UserBooter->Quirks.ProvideMaxSlide;
ResizeAppleGpuBars = UserBooter->Quirks.ResizeAppleGpuBars;
for (Index = 0; Index < UserUefi->Drivers.Count; ++Index) {
DriverEntry = UserUefi->Drivers.Values[Index];
......@@ -208,13 +210,13 @@ CheckBooterQuirks (
}
}
if (UserBooter->Quirks.ResizeAppleGpuBars > 10) {
if (ResizeAppleGpuBars > 10) {
DEBUG ((DEBUG_WARN, "Booter->Quirks->ResizeAppleGpuBars is set to %d, which is unsupported by macOS!\n", UserBooter->Quirks.ResizeAppleGpuBars));
++ErrorCount;
} else if (UserBooter->Quirks.ResizeAppleGpuBars > 8) {
} else if (ResizeAppleGpuBars > 8) {
DEBUG ((DEBUG_WARN, "Booter->Quirks->ResizeAppleGpuBars is set to %d, which is unstable with macOS sleep-wake!\n", UserBooter->Quirks.ResizeAppleGpuBars));
++ErrorCount;
} else if (UserBooter->Quirks.ResizeAppleGpuBars > 0) {
} else if (ResizeAppleGpuBars > 0) {
DEBUG ((DEBUG_WARN, "Booter->Quirks->ResizeAppleGpuBars is set to %d, which is not useful for macOS!\n", UserBooter->Quirks.ResizeAppleGpuBars));
++ErrorCount;
}
......
......@@ -528,7 +528,20 @@ CheckUEFIQuirks (
IN OC_GLOBAL_CONFIG *Config
)
{
return 0;
UINT32 ErrorCount;
OC_UEFI_CONFIG *UserUefi;
INT8 ResizeGpuBars;
ErrorCount = 0;
UserUefi = &Config->Uefi;
ResizeGpuBars = UserUefi->Quirks.ResizeGpuBars;
if (ResizeGpuBars < -1 || ResizeGpuBars > 19) {
DEBUG ((DEBUG_WARN, "UEFI->Quirks->ResizeGpuBars is borked (Can only be between -1 and 19)!\n"));
++ErrorCount;
}
return ErrorCount;
}
STATIC
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册