detect: Set new class for Lexa GPUs

As these cards require spoofing, OCLP needs to treat them differently. Primarily due to root volume patching checking against the same class, and prevent users from believing the root patches failed (when their card’s actually unsupported by their Device ID)
This commit is contained in:
Mykola Grymalyuk
2023-03-11 11:11:24 -07:00
parent 8d3ab82ddd
commit 9bfcf78ff9
4 changed files with 14 additions and 6 deletions
+3
View File
@@ -794,6 +794,9 @@ class amd_ids:
0x67CA, # Unknown 0x67CA, # Unknown
0x67CC, # Unknown 0x67CC, # Unknown
0x67CF, # Unknown 0x67CF, # Unknown
]
polaris_spoof_ids = [
# Polaris 12 (Lexa) # Polaris 12 (Lexa)
0x6981, # Lexa XT [Radeon PRO WX 3200] 0x6981, # Lexa XT [Radeon PRO WX 3200]
] ]
+5 -6
View File
@@ -106,7 +106,7 @@ class build_graphics_audio:
self.config["NVRAM"]["Delete"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"] += ["nvda_drv"] self.config["NVRAM"]["Delete"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"] += ["nvda_drv"]
def backlight_path_detection(self): def backlight_path_detection(self):
# self.constants.custom_model: iMac has been modded with new dGPU # self.constants.custom_model: iMac has been modded with new dGPU
# self.computer.dgpu: dGPU has been found using the GFX0 path # self.computer.dgpu: dGPU has been found using the GFX0 path
# self.computer.dgpu.pci_path: # self.computer.dgpu.pci_path:
@@ -114,7 +114,7 @@ class build_graphics_audio:
for i, device in enumerate(self.computer.gpus): for i, device in enumerate(self.computer.gpus):
logging.info(f"- Found dGPU ({i + 1}): {utilities.friendly_hex(device.vendor_id)}:{utilities.friendly_hex(device.device_id)}") logging.info(f"- Found dGPU ({i + 1}): {utilities.friendly_hex(device.vendor_id)}:{utilities.friendly_hex(device.device_id)}")
self.config["#Revision"][f"Hardware-iMac-dGPU-{i + 1}"] = f"{utilities.friendly_hex(device.vendor_id)}:{utilities.friendly_hex(device.device_id)}" self.config["#Revision"][f"Hardware-iMac-dGPU-{i + 1}"] = f"{utilities.friendly_hex(device.vendor_id)}:{utilities.friendly_hex(device.device_id)}"
if device.pci_path != self.computer.dgpu.pci_path: if device.pci_path != self.computer.dgpu.pci_path:
logging.info("- device path and GFX0 Device path are different") logging.info("- device path and GFX0 Device path are different")
self.gfx0_path = device.pci_path self.gfx0_path = device.pci_path
@@ -409,7 +409,6 @@ class build_graphics_audio:
self.backlight_path_detection() self.backlight_path_detection()
# Check GPU Vendor # Check GPU Vendor
if self.constants.metal_build is True: if self.constants.metal_build is True:
# self.backlight_path_detection()
logging.info("- Adding Metal GPU patches on request") logging.info("- Adding Metal GPU patches on request")
if self.constants.imac_vendor == "AMD": if self.constants.imac_vendor == "AMD":
self.amd_mxm_patch(self.gfx0_path) self.amd_mxm_patch(self.gfx0_path)
@@ -418,20 +417,18 @@ class build_graphics_audio:
else: else:
logging.info("- Failed to find vendor") logging.info("- Failed to find vendor")
elif not self.constants.custom_model and self.model in model_array.LegacyGPU and self.computer.dgpu: elif not self.constants.custom_model and self.model in model_array.LegacyGPU and self.computer.dgpu:
# self.backlight_path_detection()
logging.info(f"- Detected dGPU: {utilities.friendly_hex(self.computer.dgpu.vendor_id)}:{utilities.friendly_hex(self.computer.dgpu.device_id)}") logging.info(f"- Detected dGPU: {utilities.friendly_hex(self.computer.dgpu.vendor_id)}:{utilities.friendly_hex(self.computer.dgpu.device_id)}")
if self.computer.dgpu.arch in [ if self.computer.dgpu.arch in [
device_probe.AMD.Archs.Legacy_GCN_7000, device_probe.AMD.Archs.Legacy_GCN_7000,
device_probe.AMD.Archs.Legacy_GCN_8000, device_probe.AMD.Archs.Legacy_GCN_8000,
device_probe.AMD.Archs.Legacy_GCN_9000, device_probe.AMD.Archs.Legacy_GCN_9000,
device_probe.AMD.Archs.Polaris, device_probe.AMD.Archs.Polaris,
device_probe.AMD.Archs.Polaris_Spoof,
device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Vega,
device_probe.AMD.Archs.Navi, device_probe.AMD.Archs.Navi,
]: ]:
# self.backlight_path_detection()
self.amd_mxm_patch(self.gfx0_path) self.amd_mxm_patch(self.gfx0_path)
elif self.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler: elif self.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler:
# self.backlight_path_detection()
self.nvidia_mxm_patch(self.gfx0_path) self.nvidia_mxm_patch(self.gfx0_path)
def ioaccel_workaround(self): def ioaccel_workaround(self):
@@ -486,6 +483,7 @@ class build_graphics_audio:
if gpu in [ if gpu in [
# Metal KDK (pre-AVX2.0) # Metal KDK (pre-AVX2.0)
device_probe.AMD.Archs.Polaris, device_probe.AMD.Archs.Polaris,
device_probe.AMD.Archs.Polaris_Spoof,
device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Vega,
device_probe.AMD.Archs.Navi, device_probe.AMD.Archs.Navi,
]: ]:
@@ -510,6 +508,7 @@ class build_graphics_audio:
gpu = gpu.arch gpu = gpu.arch
if gpu in [ if gpu in [
device_probe.AMD.Archs.Polaris, device_probe.AMD.Archs.Polaris,
device_probe.AMD.Archs.Polaris_Spoof,
device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Vega,
device_probe.AMD.Archs.Navi, device_probe.AMD.Archs.Navi,
]: ]:
+3
View File
@@ -196,6 +196,7 @@ class generate_defaults:
device_probe.AMD.Archs.Legacy_GCN_8000, device_probe.AMD.Archs.Legacy_GCN_8000,
device_probe.AMD.Archs.Legacy_GCN_9000, device_probe.AMD.Archs.Legacy_GCN_9000,
device_probe.AMD.Archs.Polaris, device_probe.AMD.Archs.Polaris,
device_probe.AMD.Archs.Polaris_Spoof,
device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Vega,
device_probe.AMD.Archs.Navi, device_probe.AMD.Archs.Navi,
]: ]:
@@ -204,6 +205,7 @@ class generate_defaults:
device_probe.AMD.Archs.Legacy_GCN_8000, device_probe.AMD.Archs.Legacy_GCN_8000,
device_probe.AMD.Archs.Legacy_GCN_9000, device_probe.AMD.Archs.Legacy_GCN_9000,
device_probe.AMD.Archs.Polaris, device_probe.AMD.Archs.Polaris,
device_probe.AMD.Archs.Polaris_Spoof,
device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Vega,
device_probe.AMD.Archs.Navi, device_probe.AMD.Archs.Navi,
]: ]:
@@ -221,6 +223,7 @@ class generate_defaults:
# See if system can use the native AMD stack in Ventura # See if system can use the native AMD stack in Ventura
if gpu in [ if gpu in [
device_probe.AMD.Archs.Polaris, device_probe.AMD.Archs.Polaris,
device_probe.AMD.Archs.Polaris_Spoof,
device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Vega,
device_probe.AMD.Archs.Navi, device_probe.AMD.Archs.Navi,
]: ]:
+3
View File
@@ -242,6 +242,7 @@ class AMD(GPU):
Legacy_GCN_8000 = "Legacy GCN v2" Legacy_GCN_8000 = "Legacy GCN v2"
Legacy_GCN_9000 = "Legacy GCN v3" Legacy_GCN_9000 = "Legacy GCN v3"
Polaris = "Polaris" Polaris = "Polaris"
Polaris_Spoof = "Polaris (Spoofed)"
Vega = "Vega" Vega = "Vega"
Navi = "Navi" Navi = "Navi"
Unknown = "Unknown" Unknown = "Unknown"
@@ -263,6 +264,8 @@ class AMD(GPU):
self.arch = AMD.Archs.TeraScale_2 self.arch = AMD.Archs.TeraScale_2
elif self.device_id in pci_data.amd_ids.polaris_ids: elif self.device_id in pci_data.amd_ids.polaris_ids:
self.arch = AMD.Archs.Polaris self.arch = AMD.Archs.Polaris
elif self.device_id in pci_data.amd_ids.polaris_spoof_ids:
self.arch = AMD.Archs.Polaris_Spoof
elif self.device_id in pci_data.amd_ids.vega_ids: elif self.device_id in pci_data.amd_ids.vega_ids:
self.arch = AMD.Archs.Vega self.arch = AMD.Archs.Vega
elif self.device_id in pci_data.amd_ids.navi_ids: elif self.device_id in pci_data.amd_ids.navi_ids: