From 1799625f99d09626d22639ce0fe40ef4dd142302 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Sun, 16 May 2021 10:07:02 -0600 Subject: [PATCH 1/3] Test TeraScale 2 support --- Resources/Build.py | 2 -- Resources/ModelArray.py | 2 +- Resources/SysPatch.py | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Resources/Build.py b/Resources/Build.py index c3555d58d..de6843a11 100644 --- a/Resources/Build.py +++ b/Resources/Build.py @@ -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 diff --git a/Resources/ModelArray.py b/Resources/ModelArray.py index 041a0b6ef..37c5a6064 100644 --- a/Resources/ModelArray.py +++ b/Resources/ModelArray.py @@ -984,7 +984,7 @@ AddAMDAccel11 = [ "AMDLegacySupport.kext", "AMDRadeonVADriver.bundle", "AMDRadeonVADriver2.bundle", - "AMDRadeonX3000.kext", + #"AMDRadeonX3000.kext", "AMDRadeonX3000GLDriver.bundle", "AMDShared.bundle", "AMDSupport.kext", diff --git a/Resources/SysPatch.py b/Resources/SysPatch.py index a863036aa..abba5790c 100644 --- a/Resources/SysPatch.py +++ b/Resources/SysPatch.py @@ -127,7 +127,7 @@ class PatchSysVolume: # print("- Merging legacy Nvidia Kepler Kexts and Bundles") # self.add_new_binaries(ModelArray.AddNvidiaKeplerAccel11, self.constants.legacy_nvidia_kepler_path) elif dgpu_vendor == self.constants.pci_amd_ati: - if dgpu_device in PCIIDArray.amd_ids().terascale_1_ids: + if dgpu_device in PCIIDArray.amd_ids().terascale_1_ids or dgpu_device in PCIIDArray.amd_ids().terascale_2_ids: print("- Merging legacy AMD Kexts and Bundles") self.delete_old_binaries(ModelArray.DeleteAMDAccel11) self.add_new_binaries(ModelArray.AddGeneralAccel, self.constants.legacy_general_path) From 0a04c5c1564fb241c2351fc10046e41050fc7639 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Sun, 16 May 2021 11:31:52 -0600 Subject: [PATCH 2/3] Enable Brightness MBP8,x --- Resources/SysPatch.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Resources/SysPatch.py b/Resources/SysPatch.py index abba5790c..ed68d0e56 100644 --- a/Resources/SysPatch.py +++ b/Resources/SysPatch.py @@ -127,11 +127,26 @@ class PatchSysVolume: # print("- Merging legacy Nvidia Kepler Kexts and Bundles") # self.add_new_binaries(ModelArray.AddNvidiaKeplerAccel11, self.constants.legacy_nvidia_kepler_path) elif dgpu_vendor == self.constants.pci_amd_ati: - if dgpu_device in PCIIDArray.amd_ids().terascale_1_ids or dgpu_device in PCIIDArray.amd_ids().terascale_2_ids: + if dgpu_device in PCIIDArray.amd_ids().terascale_1_ids: 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) + 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: From d3b9b6e87a030200c45af96e21559e1278c9d8f0 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Sun, 16 May 2021 12:23:55 -0600 Subject: [PATCH 3/3] Sync changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a18babf5d..db29139dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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