Merge branch 'CloverHackyColor:master' into master

This commit is contained in:
LAbyOne 2021-07-01 00:45:05 +02:00 committed by GitHub
commit 96b93cee4f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 20 deletions

View File

@ -735,13 +735,14 @@ void ConfigManager::applySettings() const
if ( !configPlist.ACPI.SSDT.getMinMultiplier().isDefined() )
gSettings.ACPI.SSDT.MinMultiplier = 7;
}
// DBG("2: GlobalConfig.C3Latency=%x\n", GlobalConfig.C3Latency);
if ( !configPlist.ACPI.SSDT.getC3Latency().isDefined() )
gSettings.ACPI.SSDT._C3Latency = 0x00FA;
// DBG("2: gSettings.ACPI.SSDT._C3Latency=%x\n", gSettings.ACPI.SSDT._C3Latency);
}
//gSettings.CPU.Turbo = gCPUStructure.Turbo;
gSettings.CPU.SavingMode = 0xFF; //means not set
if (configPlist.CPU.dgetSavingMode() != 0xFF) { //means not set
gSettings.CPU.SavingMode = configPlist.CPU.dgetSavingMode();
}
if ( gCPUStructure.Model >= CPU_MODEL_SKYLAKE_D )
{
if ( !configPlist.CPU.getUseARTFreq().isDefined() )
@ -803,12 +804,6 @@ void ConfigManager::applySettings() const
DBG("Set MaxRatio for QEMU: %d\n", gCPUStructure.MaxRatio);
gCPUStructure.MaxRatio *= 10;
gCPUStructure.MinRatio = 60;
/* AsmWriteMsr64(MSR_FLEX_RATIO, ((6ULL << 40) + //(1ULL << 16) +
(gCPUStructure.MaxRatio << 8)));
DBG("check if flex is RW\n");
Msrflex = AsmReadMsr64(MSR_FLEX_RATIO); //0 == not Rw :(
DBG("MSR_FLEX_RATIO = %lx\n", Msrflex);
*/
gCPUStructure.FSBFrequency = DivU64x32(MultU64x32(gCPUStructure.CPUFrequency, 10),
(gCPUStructure.MaxRatio == 0) ? 1 : gCPUStructure.MaxRatio);
gCPUStructure.ExternalClock = (UINT32)DivU64x32(gCPUStructure.FSBFrequency + Kilo - 1, Kilo);
@ -897,18 +892,16 @@ EFI_STATUS ConfigManager::LoadConfig(const XStringW& ConfName)
/*Status = */ LoadSMBIOSPlist(L"smbios"_XSW); // we don't need Status. If not loaded correctly, smbiosPlist is !defined and will be ignored by AssignOldNewSettings()
MACHINE_TYPES Model = iMac132;
if ( smbiosPlist.SMBIOS.isDefined() ) {
if ( smbiosPlist.SMBIOS.hasModel() ) {
Model = smbiosPlist.SMBIOS.getModel();
}
} if ( configPlist.getSMBIOS().hasModel() ) {
Model = configPlist.getSMBIOS().getModel();
}else{
if ( smbiosPlist.SMBIOS.isDefined() && smbiosPlist.SMBIOS.hasModel()) {
Model = smbiosPlist.SMBIOS.getModel();
} else if ( configPlist.getSMBIOS().hasModel() ) {
Model = configPlist.getSMBIOS().getModel();
} else {
Model = GetDefaultModel();
}
if ( !EFI_ERROR(Status) ) {
gSettings.takeValueFrom(configPlist);
// if ( !EFI_ERROR(Status) ) {
// gSettings.takeValueFrom(configPlist);
// TODO improve this (avoid to delete settings to re-import them !)
// restore default value for SMBIOS (delete values from configPlist)
SetDMISettingsForModel(Model, &gSettings, &GlobalConfig);
@ -918,7 +911,8 @@ EFI_STATUS ConfigManager::LoadConfig(const XStringW& ConfName)
// import values from smbiosPlist if they are defined
FillSmbiosWithDefaultValue(Model, smbiosPlist.SMBIOS);
}
}
// }
gSettings.takeValueFrom(configPlist);
applySettings();
return Status;
@ -1021,6 +1015,7 @@ EFI_STATUS ConfigManager::InitialisePlatform()
GetCPUProperties();
DiscoverDevices();
// GetMacAddress(&gConf.LanCardArrayNonConst);
//SavingMode
if ( g_SmbiosDiscoveredSettings.EnabledCores ) {
GlobalConfig.EnabledCores = g_SmbiosDiscoveredSettings.EnabledCores;

View File

@ -2956,6 +2956,8 @@ RefitMain (IN EFI_HANDLE ImageHandle,
}
// DBG("0: GlobalConfig.C3Latency=%x\n", gSettings.ACPI.SSDT._C3Latency);
GlobalConfig.C3Latency = gSettings.ACPI.SSDT._C3Latency;
GlobalConfig.KPKernelPm = gSettings.KernelAndKextPatches._KPKernelPm;
// DBG("0: gSettings.CPU.SavingMode=%x\n", gSettings.CPU.SavingMode);
// ThemeX.FillByEmbedded(); //init XTheme before EarlyUserSettings
{
void *Value = NULL;
@ -3069,7 +3071,6 @@ RefitMain (IN EFI_HANDLE ImageHandle,
afterGetUserSettings(gSettings);
// dropDSM = 0xFFFF; //by default we drop all OEM _DSM. They have no sense for us.
// if (defDSM) {
// dropDSM = gSettings.DropOEM_DSM; //if set by user
@ -3113,6 +3114,7 @@ RefitMain (IN EFI_HANDLE ImageHandle,
gGuiIsReady = TRUE;
GlobalConfig.gBootChanged = TRUE;
GlobalConfig.gThemeChanged = TRUE;
do {
if (GlobalConfig.gBootChanged && GlobalConfig.gThemeChanged) { // config changed
GetListOfDsdts(); //only after GetUserSettings