From afdf49a074a5e6a41bf6db3f79ee1573584e469a Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk <48863253+khronokernel@users.noreply.github.com> Date: Sat, 18 Sep 2021 16:33:02 -0600 Subject: [PATCH] Add TeraScale 2 Acceleration for Monterey --- CHANGELOG.md | 5 ++--- OCLP-CLI.command | 3 +++ OpenCore-Patcher.command | 7 ++++--- Resources/Constants.py | 2 +- Resources/SysPatch.py | 5 ++--- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b572083d..8a8f25835 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ - AppleALC 1.6.3 release - WhateverGreen 1.5.2 release - FeatureUnlock 1.0.3 release - - PatcherSupportPkg 0.1.0 release + - PatcherSupportPkg 0.1.2 release - Allow iGPU/dGPU switching in Windows - Applicable to MacBook Pros with Intel iGPU and Nvidia/AMD dGPU - Clean up Patcher Settings @@ -29,8 +29,7 @@ - Currently supports: - Intel Ironlake and Sandy Bridge - Nvidia Tesla - - AMD TeraScale 1 - - TeraScale 2 acceleration to be added in the future + - AMD TeraScale 1 and 2 - Allow Trackpad gestures on MacBook4,1 and MacBook5,2 - System Preferences will not report settings however - Allow Root Volume Patched Systems to use FileVault 2 diff --git a/OCLP-CLI.command b/OCLP-CLI.command index a19f2933e..53fc18059 100755 --- a/OCLP-CLI.command +++ b/OCLP-CLI.command @@ -232,6 +232,9 @@ If you plan to create the USB for another machine, please select the "Change Mod if self.constants.latebloom_delay == 0: self.constants.latebloom_delay, self.constants.latebloom_range, self.constants.latebloom_debug = Utilities.latebloom_detection(model) + + if Utilities.get_nvram("gpu-power-prefs", "FA4CE28D-B62F-4C99-9CC3-6815686E30F9", decode=True): + self.constants.allow_ts2_accel = False def patch_vol(self): SysPatch.PatchSysVolume(self.constants.custom_model or self.constants.computer.real_model, self.constants).start_patch() diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command index 6a1bb7070..b776c7a9c 100755 --- a/OpenCore-Patcher.command +++ b/OpenCore-Patcher.command @@ -74,6 +74,9 @@ class OpenCoreLegacyPatcher: if Utilities.amfi_status() is False: self.constants.amfi_status = False + + if Utilities.get_nvram("gpu-power-prefs", "FA4CE28D-B62F-4C99-9CC3-6815686E30F9", decode=True): + self.constants.allow_ts2_accel = False self.constants.latebloom_delay, self.constants.latebloom_range, self.constants.latebloom_debug = Utilities.latebloom_detection(model) @@ -306,9 +309,7 @@ B. Exit - Non-Metal Graphics Accelertation - Intel: Ironlake - Sandy Bridge - Nvidia: Tesla - Fermi (8000-500 series) - - AMD: TeraScale 1 (2000-4000 series) -- Basic Framebuffer and brightness Control (No acceleration) - - AMD: TeraScale 2 (5000-6000 series) + - AMD: TeraScale 1 and 2 (2000-6000 series) - Audio support for iMac7,1 and iMac8,1 - Wifi support for BCM94328, BCM94322 and Atheros cards diff --git a/Resources/Constants.py b/Resources/Constants.py index 0bb8c00e4..837d0ed30 100644 --- a/Resources/Constants.py +++ b/Resources/Constants.py @@ -14,7 +14,7 @@ class Constants: def __init__(self): # Patcher Versioning self.patcher_version = "0.2.5" # OpenCore-Legacy-Patcher - self.patcher_support_pkg_version = "0.1.1" # PatcherSupportPkg + self.patcher_support_pkg_version = "0.1.2" # PatcherSupportPkg # OpenCore Versioning # https://github.com/acidanthera/OpenCorePkg diff --git a/Resources/SysPatch.py b/Resources/SysPatch.py index da6767334..22c8fc7ed 100644 --- a/Resources/SysPatch.py +++ b/Resources/SysPatch.py @@ -351,7 +351,7 @@ set million colour before rebooting""" print("- Installing TeraScale 2 Acceleration Kext patches for Mojave/Catalina") self.gpu_accel_legacy() self.add_new_binaries(SysPatchArray.AddAMDAccelLegacy, self.constants.legacy_amd_path) - elif self.constants.detected_os == self.constants.big_sur and self.constants.allow_ts2_accel is True: + elif self.constants.detected_os in [self.constants.big_sur, self.constants.monterey] and self.constants.allow_ts2_accel is True: # TODO: Enable for Monterey when acceleration patches proress print("- Installing TeraScale 2 Acceleration Kext patches for Big Sur") self.delete_old_binaries(SysPatchArray.DeleteAMDAccel11) @@ -498,14 +498,13 @@ set million colour before rebooting""" self.amd_ts2 is True and self.constants.detected_os in self.constants.legacy_accel_support and self.constants.allow_ts2_accel is True - and self.constants.detected_os != self.constants.monterey ): # TeraScale 2 patches must be installed after Intel HD3000 self.add_new_binaries(SysPatchArray.AddAMDAccel11TS2, self.constants.legacy_amd_path_ts2) if self.added_legacy_kexts is True and self.constants.detected_os in self.constants.legacy_accel_support: self.gpu_accel_legacy_extended() - if self.amd_ts2 is True and self.constants.allow_ts2_accel is True and self.constants.detected_os != self.constants.monterey: + if self.amd_ts2 is True and self.constants.allow_ts2_accel is True: self.gpu_accel_legacy_extended_ts2() # Misc patches