@@ -313,21 +313,21 @@ def wifi_fake_id(self):
313313 if self .model in ModelArray .DualGPUPatch :
314314 print ("- Adding dual GPU patch" )
315315 if not self .constants .custom_model :
316- gfx0_path : str = subprocess .run ([self .constants .gfxutil_path ] + f"-f GFX0" .split (), stdout = subprocess .PIPE , stderr = subprocess .STDOUT ).stdout .decode ()
317- try :
318- self .gfx0_path = [line .strip ().split ("= " , 1 )[1 ] for line in gfx0_path .split ("\n " ) if "GFX0" in line .strip ()][0 ]
319- print (f"- Found GFX0 device at { self .gfx0_path } " )
320- except IndexError :
316+ dgpu_vendor ,dgpu_device ,dgpu_acpi = DeviceProbe .pci_probe ().gpu_probe ("GFX0" )
317+ self .gfx0_path = DeviceProbe .pci_probe ().deviceproperty_probe (dgpu_vendor ,dgpu_device ,dgpu_acpi )
318+ if self .gfx0_path == "" :
321319 print ("- Failed to find GFX0 Device path, falling back on known logic" )
322- gfx0_path = "PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"
320+ self .gfx0_path = "PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"
321+ else :
322+ print (f"- Found GFX0 Device Path: { self .gfx0_path } " )
323323 else :
324- gfx0_path = "PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"
324+ self . gfx0_path = "PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"
325325 if self .model in ModelArray .IntelNvidiaDRM and self .constants .drm_support is True :
326326 print ("- Prioritizing DRM support over Intel QuickSync" )
327- self .config ["DeviceProperties" ]["Add" ][gfx0_path ] = {"agdpmod" : "vit9696" , "shikigva" : 256 }
327+ self .config ["DeviceProperties" ]["Add" ][self . gfx0_path ] = {"agdpmod" : "vit9696" , "shikigva" : 256 }
328328 self .config ["DeviceProperties" ]["Add" ]["PciRoot(0x0)/Pci(0x2,0x0)" ] = {"disable-gpu-min" : "20.0.0" }
329329 else :
330- self .config ["DeviceProperties" ]["Add" ][gfx0_path ] = {"agdpmod" : "vit9696" }
330+ self .config ["DeviceProperties" ]["Add" ][self . gfx0_path ] = {"agdpmod" : "vit9696" }
331331
332332 # HiDPI OpenCanopy and FileVault
333333 if self .model in ModelArray .HiDPIpicker :
@@ -346,16 +346,17 @@ def wifi_fake_id(self):
346346
347347 def backlight_path_detection (self ):
348348 if not self .constants .custom_model :
349- gfx0_path : str = subprocess .run ([self .constants .gfxutil_path ] + f"-f GFX0" .split (), stdout = subprocess .PIPE , stderr = subprocess .STDOUT ).stdout .decode ()
350- try :
351- self .gfx0_path = [line .strip ().split ("= " , 1 )[1 ] for line in gfx0_path .split ("\n " ) if "GFX0" in line .strip ()][0 ]
352- print (f"- Found GFX0 device at { self .gfx0_path } " )
353- except IndexError :
349+ dgpu_vendor ,dgpu_device ,dgpu_acpi = DeviceProbe .pci_probe ().gpu_probe ("GFX0" )
350+ self .gfx0_path = DeviceProbe .pci_probe ().deviceproperty_probe (dgpu_vendor ,dgpu_device ,dgpu_acpi )
351+ if self .gfx0_path == "" :
354352 print ("- Failed to find GFX0 Device path, falling back on known logic" )
355353 if self .model in ["iMac11,1" , "iMac11,3" ]:
356354 self .gfx0_path = "PciRoot(0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)"
357355 else :
358356 self .gfx0_path = "PciRoot(0x0)/Pci(0x1,0x0)/Pci(0x0,0x0)"
357+ else :
358+ print (f"- Found GFX0 Device Path: { self .gfx0_path } " )
359+
359360 else :
360361 if self .model in ["iMac11,1" , "iMac11,3" ]:
361362 self .gfx0_path = "PciRoot(0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)"
0 commit comments