Merge pull request #227 from dortania/terascale-2-test

Add basic MacBookPro8,2/3 Brightness Control
This commit is contained in:
Mykola Grymalyuk
2021-05-16 13:07:51 -06:00
committed by GitHub
4 changed files with 18 additions and 4 deletions

View File

@@ -9,7 +9,8 @@
- Support space in path when downloading Root Patches
- Enable PanicNoKextDump by default
- Expand AppleGraphicsPowerManagement and AppleGraphicsDeviceControl Override support
- Fix MacBookPro8,2/3 Hibernation wake
- Fix MacBookPro8,2/3 Brightness Control
- dGPU must be disabled via NVRAM or deMUXed
## 0.1.4
- Fix Device Path formatting on 2012+ iMacs

View File

@@ -541,8 +541,6 @@ class BuildOpenCore:
print("- Adding CPU Name Patch")
if self.get_kext_by_bundle_path("RestrictEvents.kext")["Enabled"] is False:
self.enable_kext("RestrictEvents.kext", self.constants.restrictevents_version, self.constants.restrictevents_path)
if self.model in ModelArray.AMCSupport:
self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x2,0x0)"] = {"wegnoegpu": binascii.unhexlify("01000000")}
def set_smbios(self):
spoofed_model = self.model

View File

@@ -984,7 +984,7 @@ AddAMDAccel11 = [
"AMDLegacySupport.kext",
"AMDRadeonVADriver.bundle",
"AMDRadeonVADriver2.bundle",
"AMDRadeonX3000.kext",
#"AMDRadeonX3000.kext",
"AMDRadeonX3000GLDriver.bundle",
"AMDShared.bundle",
"AMDSupport.kext",

View File

@@ -132,6 +132,21 @@ class PatchSysVolume:
self.delete_old_binaries(ModelArray.DeleteAMDAccel11)
self.add_new_binaries(ModelArray.AddGeneralAccel, self.constants.legacy_general_path)
self.add_new_binaries(ModelArray.AddAMDAccel11, self.constants.legacy_amd_path)
if self.model in ["MacBookPro8,2", "MacBookPro8,3"]:
# This is used for MacBookPro8,2/3 where dGPU is disabled via NVRAM and still requires AMD framebuffer
# For reference:
#- deMUX: Don't need the AMD patches
#- dGPUs enabled: Don't install the AMD patches (Infinite login loop otherwise)
#- dGPUs disabled: Do need the AMD patches (Restores Brightness control)
dgpu_status: str = subprocess.run("nvram FA4CE28D-B62F-4C99-9CC3-6815686E30F9:gpu-power-prefs".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode()
if dgpu_status.startswith("FA4CE28D-B62F-4C99-9CC3-6815686E30F9:gpu-power-prefs %01"):
print("- Detected dGPU is disabled via NVRAM")
print("- Merging legacy AMD Kexts and Bundles")
self.delete_old_binaries(ModelArray.DeleteAMDAccel11)
self.add_new_binaries(ModelArray.AddGeneralAccel, self.constants.legacy_general_path)
self.add_new_binaries(ModelArray.AddAMDAccel11, self.constants.legacy_amd_path)
else:
print("- Cannot install Brightness Control, pleas ensure the dGPU is disabled via NVRAM")
if igpu_vendor:
print(f"- Found IGPU: {igpu_vendor}:{igpu_device}")
if igpu_vendor == self.constants.pci_intel: