patchsets: Avoid downgrading AppleGVA on AMD Polaris+ GPUs

This commit is contained in:
Mykola Grymalyuk
2024-09-23 09:45:56 -06:00
parent 192dfb79ae
commit 753cd6cf3f
4 changed files with 30 additions and 6 deletions
@@ -139,10 +139,9 @@ class AMDPolaris(BaseHardware):
**AMDOpenCL(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
})
if self._is_gpu_architecture_present(gpu_architectures=[device_probe.Intel.Archs.Skylake]) is False:
# Monterey GVA is not required for Intel Skylake iGPUs
_base.update({
**MontereyGVA(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
})
# Polaris and Vega GPUs still use the native GVA stack
_base.update({
**MontereyGVA(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).revert_patches(),
})
return _base
@@ -122,7 +122,9 @@ class AMDVega(BaseHardware):
return {}
return {
**MontereyGVA(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
# Polaris and Vega GPUs still use the native GVA stack
**MontereyGVA(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).revert_patches(),
**MontereyOpenCL(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
**AMDOpenCL(self._xnu_major, self._xnu_minor, self._constants.detected_os_version).patches(),
**self._model_specific_patches(),
@@ -39,4 +39,25 @@ class MontereyGVA(BaseSharedPatchSet):
},
},
},
}
def revert_patches(self) -> dict:
"""
Revert if patches are no longer required/misapplied
"""
if self._os_requires_patches() is False:
return {}
return {
"Revert Monterey GVA": {
PatchType.REMOVE_SYSTEM_VOLUME: {
"/System/Library/PrivateFrameworks/AppleGVA.framework/Versions/A": [
"AppleGVA"
],
"/System/Library/PrivateFrameworks/AppleGVACore.framework/Versions/A": [
"AppleGVACore"
],
}
}
}