Add Brightness Control patches

This commit is contained in:
Mykola Grymalyuk
2021-04-10 19:22:17 -06:00
parent f20c9808ed
commit 361f9767dd
8 changed files with 55 additions and 11 deletions
+2 -5
View File
@@ -27,11 +27,8 @@ If applicable, add the generated OpenCore Build to help explain your problem.
- OS Patching (ie. macOS 11.2.3, Big Sur)
- Model Patching (ie. MacPro5,1)
For in-depth hardware logs, we highly encourage users to send the following files:
```bash
ioreg -lw0 > ~/Desktop/IOReg.txt
ioreg -lw0 -a > ~/Desktop/IOReg.plist
```
For in-depth hardware logs, we highly encourage users to run [IORegistryExplorer](https://github.com/khronokernel/IORegistryClone/blob/master/ioreg-210.zip?raw=true) and send the output
* ie. `File -> SaveAs`
**Additional context**
Add any other context about the problem here.
+1
View File
@@ -8,6 +8,7 @@
- AppleALC 1a3e5cb (1.6.0 rolling - 04-10-2021)
- Enhance Wifi model detection
- Hide OpenShell.efi by default
- Add Brightness Control patches for legacy Nvidia and Intel GPUs
## 0.0.22
- Add ExFat support for models missing driver
+1 -1
View File
@@ -110,7 +110,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
utilities.header(["Patching System Volume"])
print("""Patches Root volume to fix misc issues such as:
- No patches currently avalible for any model
- Brightness control for non-Metal Nvidia and Intel GPUs
WARNING: Root Volume Patching is still in active development, please
have all important user data backed up. Note when the system volume
+28
View File
@@ -928,6 +928,15 @@ AddNvidiaAccel11 = [
"IOSurface.kext",
]
AddNvidiaBrightness11 = [
"GeForceGA.bundle",
"GeForceTesla.kext",
"GeForceTeslaGLDriver.bundle",
"GeForceTeslaVADriver.bundle",
"NVDANV50HalTesla.kext",
"NVDAResmanTesla.kext",
]
AddAMDAccel11 = [
"AMD2400Controller.kext",
"AMD2600Controller.kext",
@@ -963,6 +972,16 @@ AddIntelGen1Accel = [
"IOSurface.kext",
]
AddIntelGen1Brightness = [
"AppleIntelFramebufferAzul.kext",
"AppleIntelFramebufferCapri.kext",
"AppleIntelHDGraphics.kext",
"AppleIntelHDGraphicsFB.kext",
"AppleIntelHDGraphicsGA.plugin",
"AppleIntelHDGraphicsGLDriver.bundle",
"AppleIntelHDGraphicsVADriver.bundle",
]
AddIntelGen2Accel = [
"AppleIntelHD3000Graphics.kext",
"AppleIntelHD3000GraphicsGA.plugin",
@@ -973,6 +992,15 @@ AddIntelGen2Accel = [
"IOSurface.kext",
]
AddIntelGen2Brightness = [
"AppleIntelHD3000Graphics.kext",
"AppleIntelHD3000GraphicsGA.plugin",
"AppleIntelHD3000GraphicsGLDriver.bundle",
"AppleIntelHD3000GraphicsVADriver.bundle",
"AppleIntelSNBGraphicsFB.kext",
"AppleIntelSNBVA.bundle",
]
DeleteBrightness = [
"AppleGraphicsControl.kext/Contents/PlugIns/AGDCBacklightControl.kext"
]
+16 -3
View File
@@ -163,6 +163,7 @@ class PatchSysVolume:
def patch_root_vol(self):
print(f"- Detecting patches for {self.model}")
rebuild_required = False
# TODO: Create Backup of S*/L*/Extensions, Frameworks and PrivateFramework to easily revert changes
# APFS snapshotting seems to ignore System Volume changes inconcistently, would like a backup to avoid total brick
# Perhaps a basic py2 script to run in recovery to restore
@@ -176,15 +177,27 @@ class PatchSysVolume:
self.constants.current_gpuv = [line.strip().split(": ", 1)[1] for line in current_gpu.split("\n") if line.strip().startswith(("Vendor"))][0]
self.constants.current_gpud = [line.strip().split(": ", 1)[1] for line in current_gpu.split("\n") if line.strip().startswith(("Device ID"))][0]
if (self.model in ModelArray.LegacyGPU) and (Path(self.constants.hiddhack_path).exists()):
if self.model in ModelArray.LegacyGPU:
print(f"- Detected GPU: {self.constants.current_gpuv} {self.constants.current_gpud}")
if (self.constants.current_gpuv == "AMD (0x1002)") & (self.constants.current_gpud in ModelArray.AMDMXMGPUs):
print("- Detected Metal-based AMD GPU, skipping legacy patches")
elif (self.constants.current_gpuv == "NVIDIA (0x10de)") & (self.constants.current_gpud in ModelArray.NVIDIAMXMGPUs):
print("- Detected Metal-based Nvidia GPU, skipping legacy patches")
else:
print("- Detected legacy GPU, attempting legacy acceleration patches")
self.gpu_accel_patches_11()
if Path(self.constants.hiddhack_path).exists():
print("- Detected legacy GPU, attempting legacy acceleration patches")
self.gpu_accel_patches_11()
else:
print("- Adding Brightness Control patches")
if self.model in ModelArray.LegacyGPUNvidia:
self.add_new_binaries(ModelArray.AddNvidiaBrightness11, self.constants.legacy_nvidia_path)
#elif self.model in ModelArray.LegacyGPUNvidia:
# self.add_new_binaries(ModelArray.AddAMDBrightness11, self.constants.legacy_amd_path)
if self.model in ModelArray.LegacyGPUIntelGen1:
self.add_new_binaries(ModelArray.AddIntelGen1Brightness, self.constants.legacy_intel_gen1_path)
elif self.model in ModelArray.LegacyGPUIntelGen2:
self.add_new_binaries(ModelArray.AddIntelGen2Brightness, self.constants.legacy_intel_gen2_path)
rebuild_required = True
if rebuild_required is True:
+1 -1
View File
@@ -12,7 +12,7 @@ With OpenCore Legacy Patcher we recommend users go through the below table to un
| Supported OSes | <span style="color:#30BCD5">10.7-11</span> | <span style="color:red">10.15-11</span> |
| Firmware Patching | <span style="color:#30BCD5">None required</span> | <span style="color:red">Required for models without native APFS support</span> |
| BootCamp Switching | <span style="color:red">Requires EFI Conversion for Start Disk support, otherwise still supported</span> | <span style="color:#30BCD5">Native</span> |
| Brightness Control on Legacy GPUs | <span style="color:red">Not supported</span> | <span style="color:#30BCD5">Supported</span> |
| Brightness Control on Legacy GPUs | <span style="color:#30BCD5">Supported</span> | <span style="color:#30BCD5">Supported</span> |
| WPA Wifi Support | <span style="color:#30BCD5">Native, stable</span> | <span style="color:red">Unstable</span> |
| Legacy GPU Acceleration | <span style="color:red">Coming soon</span> | <span style="color:red">Coming soon</span> |
| Brightness Control on Legacy GPUs | <span style="color:red">Coming soon</span> | <span style="color:#30BCD5">Supported</span> |
+2 -1
View File
@@ -16,7 +16,8 @@ The below table will list all supported and unsupported functions of the patcher
* [Mac Pro](#mac-pro)
* [Xserve](#xserve)
Note: In this patcher, Brightness Control is tied to GPU acceleration
Note: Brightness Control is currently unsupported on AMD GPUs as well as on iMac7,1, iMac8,1, iMac9,1 and MacBook5,2
Note 2: For setups that require AppleHDA patching, we highly advise users instead opt of a USB Audio adapter to avoid root patching. This ensures that [DELTA](./TERMS.md) updates, FileVault, SIP and other security features can stay in-tact.
+4
View File
@@ -225,6 +225,10 @@ Note, GPU Acceleration Patches are not public yet, the below section is simply d
* Nvidia Binaries
* GeForceGA.bundle
* GeForceTesla.kext
* Skip IOFree Panic - Mojave+
* At Offset `0x5CF9A` replace following bytes with `0xEB`
* Avoids `addMemoryRegion/removeMemoryRegion` calls
* At Offset `0x5527` and `0x77993`, replace following bytes with `0x909090909090`
* GeForceTeslaGLDriver.bundle
* GeForceTeslaVADriver.bundle
* NVDANV50HalTesla.kext