mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-19 22:00:00 +10:00
Limit MacBookPro6,2 G State
Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/520
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
- Applicable for dual GPU MacBookPro5,x and demuxed MacBookPro8,x
|
- Applicable for dual GPU MacBookPro5,x and demuxed MacBookPro8,x
|
||||||
- Increment Binaries:
|
- Increment Binaries:
|
||||||
- PatcherSupportPkg 0.1.5 release
|
- PatcherSupportPkg 0.1.5 release
|
||||||
|
- Limit MacBookPro6,2 G State
|
||||||
|
|
||||||
## 0.2.5
|
## 0.2.5
|
||||||
|
|
||||||
|
|||||||
@@ -867,11 +867,26 @@ class BuildOpenCore:
|
|||||||
new_amc_ls = Path(self.constants.amc_contents_folder) / Path("Info.plist")
|
new_amc_ls = Path(self.constants.amc_contents_folder) / Path("Info.plist")
|
||||||
amc_config = plistlib.load(Path(new_amc_ls).open("rb"))
|
amc_config = plistlib.load(Path(new_amc_ls).open("rb"))
|
||||||
amc_config["IOKitPersonalities"]["AppleMuxControl"]["ConfigMap"][self.spoofed_board] = amc_config["IOKitPersonalities"]["AppleMuxControl"]["ConfigMap"].pop(self.model)
|
amc_config["IOKitPersonalities"]["AppleMuxControl"]["ConfigMap"][self.spoofed_board] = amc_config["IOKitPersonalities"]["AppleMuxControl"]["ConfigMap"].pop(self.model)
|
||||||
|
for entry in list(amc_config["IOKitPersonalities"]["AppleMuxControl"]["ConfigMap"]):
|
||||||
|
if not entry.startswith(self.spoofed_board):
|
||||||
|
amc_config["IOKitPersonalities"]["AppleMuxControl"]["ConfigMap"].pop(entry)
|
||||||
plistlib.dump(amc_config, Path(new_amc_ls).open("wb"), sort_keys=True)
|
plistlib.dump(amc_config, Path(new_amc_ls).open("wb"), sort_keys=True)
|
||||||
if self.model not in ModelArray.NoAGPMSupport:
|
if self.model not in ModelArray.NoAGPMSupport:
|
||||||
new_agpm_ls = Path(self.constants.agpm_contents_folder) / Path("Info.plist")
|
new_agpm_ls = Path(self.constants.agpm_contents_folder) / Path("Info.plist")
|
||||||
agpm_config = plistlib.load(Path(new_agpm_ls).open("rb"))
|
agpm_config = plistlib.load(Path(new_agpm_ls).open("rb"))
|
||||||
agpm_config["IOKitPersonalities"]["AGPM"]["Machines"][self.spoofed_board] = agpm_config["IOKitPersonalities"]["AGPM"]["Machines"].pop(self.model)
|
agpm_config["IOKitPersonalities"]["AGPM"]["Machines"][self.spoofed_board] = agpm_config["IOKitPersonalities"]["AGPM"]["Machines"].pop(self.model)
|
||||||
|
if self.model == "MacBookPro6,2":
|
||||||
|
# Force G State to not exceed moderate state
|
||||||
|
# Ref: https://github.com/fabioiop/MBP-2010-GPU-Panic-fix
|
||||||
|
print("- Patching G State for MacBookPro6,2")
|
||||||
|
for gpu in ["Vendor10deDevice0a34", "Vendor10deDevice0a29"]:
|
||||||
|
agpm_config["IOKitPersonalities"]["AGPM"]["Machines"][self.spoofed_board][gpu]["BoostPState"] = [2, 2, 2, 2]
|
||||||
|
agpm_config["IOKitPersonalities"]["AGPM"]["Machines"][self.spoofed_board][gpu]["BoostTime"] = [2, 2, 2, 2]
|
||||||
|
|
||||||
|
for entry in list(agpm_config["IOKitPersonalities"]["AGPM"]["Machines"]):
|
||||||
|
if not entry.startswith(self.spoofed_board):
|
||||||
|
agpm_config["IOKitPersonalities"]["AGPM"]["Machines"].pop(entry)
|
||||||
|
|
||||||
plistlib.dump(agpm_config, Path(new_agpm_ls).open("wb"), sort_keys=True)
|
plistlib.dump(agpm_config, Path(new_agpm_ls).open("wb"), sort_keys=True)
|
||||||
if self.model in ModelArray.AGDPSupport:
|
if self.model in ModelArray.AGDPSupport:
|
||||||
new_agdp_ls = Path(self.constants.agdp_contents_folder) / Path("Info.plist")
|
new_agdp_ls = Path(self.constants.agdp_contents_folder) / Path("Info.plist")
|
||||||
@@ -879,6 +894,9 @@ class BuildOpenCore:
|
|||||||
agdp_config["IOKitPersonalities"]["AppleGraphicsDevicePolicy"]["ConfigMap"][self.spoofed_board] = agdp_config["IOKitPersonalities"]["AppleGraphicsDevicePolicy"]["ConfigMap"].pop(
|
agdp_config["IOKitPersonalities"]["AppleGraphicsDevicePolicy"]["ConfigMap"][self.spoofed_board] = agdp_config["IOKitPersonalities"]["AppleGraphicsDevicePolicy"]["ConfigMap"].pop(
|
||||||
self.model
|
self.model
|
||||||
)
|
)
|
||||||
|
for entry in list(agdp_config["IOKitPersonalities"]["AppleGraphicsDevicePolicy"]["ConfigMap"]):
|
||||||
|
if not entry.startswith(self.spoofed_board):
|
||||||
|
agdp_config["IOKitPersonalities"]["AppleGraphicsDevicePolicy"]["ConfigMap"].pop(entry)
|
||||||
plistlib.dump(agdp_config, Path(new_agdp_ls).open("wb"), sort_keys=True)
|
plistlib.dump(agdp_config, Path(new_agdp_ls).open("wb"), sort_keys=True)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user