Import dosdude1 patches

This commit is contained in:
Mykola Grymalyuk
2021-05-08 22:24:05 -06:00
parent 78038b9607
commit b4ef000fc0
3 changed files with 17 additions and 8 deletions
+2
View File
@@ -304,6 +304,8 @@ class Constants:
def legacy_intel_gen2_path(self): return self.legacy_graphics / Path("Intel-Gen6-SandyBridge")
@property
def legacy_intel_gen3_path(self): return self.legacy_graphics / Path("Intel-Gen7-IvyBridge")
@property
def legacy_general_path(self): return self.legacy_graphics / Path("General-Patches")
@property
def legacy_brightness(self): return self.payload_apple_kexts_path / Path("Brightness-Control")
+10 -4
View File
@@ -962,8 +962,6 @@ AddAMDAccel11 = [
"ATIRadeonX2000GA.plugin",
"ATIRadeonX2000GLDriver.bundle",
"ATIRadeonX2000VADriver.bundle",
"IOAcceleratorFamily2.kext",
"IOSurface.kext",
]
AddIntelGen1Accel = [
@@ -972,7 +970,6 @@ AddIntelGen1Accel = [
"AppleIntelHDGraphicsGA.plugin",
"AppleIntelHDGraphicsGLDriver.bundle",
"AppleIntelHDGraphicsVADriver.bundle",
"IOSurface.kext",
]
AddIntelGen2Accel = [
@@ -982,7 +979,6 @@ AddIntelGen2Accel = [
"AppleIntelHD3000GraphicsVADriver.bundle",
"AppleIntelSNBGraphicsFB.kext",
"AppleIntelSNBVA.bundle",
"IOSurface.kext",
]
AddIntelGen3Accel = [
@@ -993,6 +989,16 @@ AddIntelGen3Accel = [
"AppleIntelHD4000GraphicsVADriver.bundle",
]
AddGeneralAccel = [
"AppleGraphicsControl.kext",
"AppleGraphicsPowerManagement.kext",
"AppleMCCSControl.kext",
"IOGraphicsFamily.kext",
"IONDRVSupport.kext",
"IOAcceleratorFamily2.kext",
"IOSurface.kext"
]
DeleteBrightness = [
"AppleGraphicsControl.kext/Contents/PlugIns/AGDCBacklightControl.kext"
]
+5 -4
View File
@@ -130,6 +130,7 @@ class PatchSysVolume:
if dgpu_device in PCIIDArray.nvidia_ids().tesla_ids or dgpu_device in PCIIDArray.nvidia_ids().fermi_ids:
print("- Merging legacy Nvidia Tesla and Fermi Kexts and Bundles")
self.delete_old_binaries(ModelArray.DeleteNvidiaAccel11)
self.add_new_binaries(ModelArray.AddGeneralAccel, self.constants.legacy_general_path)
self.add_new_binaries(ModelArray.AddNvidiaAccel11, self.constants.legacy_nvidia_path)
# TODO: Enable below code if macOS 12 drops support
#elif dgpu_device in PCIIDArray.nvidia_ids().kepler_ids and self.constants.detected_os > self.constants.big_sur:
@@ -139,6 +140,7 @@ class PatchSysVolume:
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)
self.add_new_binaries(ModelArray.AddAMDAccel11, self.constants.legacy_amd_path)
if igpu_vendor:
print(f"- Found IGPU: {igpu_vendor}:{igpu_device}")
@@ -146,15 +148,13 @@ class PatchSysVolume:
if igpu_device in PCIIDArray.intel_ids().iron_ids:
print("- Merging legacy Intel 1st Gen Kexts and Bundles")
self.delete_old_binaries(ModelArray.DeleteNvidiaAccel11)
self.add_new_binaries(ModelArray.AddGeneralAccel, self.constants.legacy_general_path)
self.add_new_binaries(ModelArray.AddIntelGen1Accel, self.constants.legacy_intel_gen1_path)
elif igpu_device in PCIIDArray.intel_ids().sandy_ids:
print("- Merging legacy Intel 2nd Gen Kexts and Bundles")
self.delete_old_binaries(ModelArray.DeleteNvidiaAccel11)
self.add_new_binaries(ModelArray.AddGeneralAccel, self.constants.legacy_general_path)
self.add_new_binaries(ModelArray.AddIntelGen2Accel, self.constants.legacy_intel_gen2_path)
#if self.model in ModelArray.LegacyGPUAMDIntelGen2:
# Swap custom AppleIntelSNBGraphicsFB-AMD.kext, required to fix linking
# subprocess.run(f"sudo rm -R {self.mount_extensions}/AppleIntelSNBGraphicsFB.kext".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
# subprocess.run(f"sudo cp -R {self.constants.legacy_amd_path}/AMD-Link/AppleIntelSNBGraphicsFB.kext {self.mount_extensions}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
# TODO: Enable below code if macOS 12 drops support
#elif igpu_device in PCIIDArray.intel_ids().ivy_ids:
@@ -165,6 +165,7 @@ class PatchSysVolume:
# Avoid patching twice, as Nvidia iGPUs will only have Nvidia dGPUs
print("- Merging legacy Nvidia Kexts and Bundles")
self.delete_old_binaries(ModelArray.DeleteNvidiaAccel11)
self.add_new_binaries(ModelArray.AddGeneralAccel, self.constants.legacy_general_path)
self.add_new_binaries(ModelArray.AddNvidiaAccel11, self.constants.legacy_nvidia_path)
# Frameworks