Add Software Based deMUX

Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/559
This commit is contained in:
Mykola Grymalyuk
2021-10-11 15:50:07 -06:00
parent 47a2f71612
commit 82fe98a93c
10 changed files with 236 additions and 21 deletions

View File

@@ -721,13 +721,22 @@ set million colour before rebooting"""
self.amd_ts2 = False
self.iron_gpu = False
self.sandy_gpu = False
def check_dgpu_status(self):
dgpu = self.constants.computer.dgpu
if dgpu:
if dgpu.class_code and dgpu.class_code == 0xFFFFFFFF:
# If dGPU is disabled via class-codes, assume demuxed
return False
return True
return False
def detect_demux(self):
# If GFX0 is missing, assume machine was demuxed
# -wegnoegpu would also trigger this, so ensure arg is not present
if not "-wegnoegpu" in (utilities.get_nvram("boot-args") or ""):
igpu = self.constants.computer.igpu
dgpu = self.constants.computer.dgpu
dgpu = self.check_dgpu_status()
if igpu and not dgpu:
return True
return False