From bf86619e8283ea6ad8977fc0eacb0853ccb6b81f Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 5 Dec 2021 11:29:16 -0700 Subject: [PATCH] Add Legacy GCN build support off model --- CHANGELOG.md | 1 + resources/build.py | 19 ++++++++++++++++++- resources/cli_menu.py | 14 +++++++++++--- resources/constants.py | 1 + 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b5f1ce70..ea284166c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ - Applicable for Atheros, BCM94328, BCM94322 - Fix OpenCL Acceleration on Ivy Bridge and Kepler - Add Apple RAID Card support +- Add Legacy GCN build support off model for MXM iMacs ## 0.3.1 - Increment Binaries: diff --git a/resources/build.py b/resources/build.py index c0798e1c1..4a0f09565 100644 --- a/resources/build.py +++ b/resources/build.py @@ -560,7 +560,7 @@ class BuildOpenCore: self.enable_kext("AAAMouSSE.kext", self.constants.mousse_version, self.constants.mousse_path) if self.computer and self.computer.dgpu: if self.computer.dgpu.arch == device_probe.AMD.Archs.Legacy_GCN_7000: - # Add Power Gate Patches + print("- Adding Legacy GCN Power Gate Patches") self.config["DeviceProperties"]["Add"][backlight_path].update({ "rebuild-device-tree": 1, "CAIL,CAIL_DisableDrmdmaPowerGating": 1, @@ -568,6 +568,23 @@ class BuildOpenCore: "CAIL,CAIL_DisableUVDPowerGating": 1, "CAIL,CAIL_DisableVCEPowerGating": 1, }) + elif self.constants.imac_model == "Legacy GCN": + print("- Adding Legacy GCN Power Gate Patches") + self.config["DeviceProperties"]["Add"][backlight_path].update({ + "rebuild-device-tree": 1, + "CAIL,CAIL_DisableDrmdmaPowerGating": 1, + "CAIL,CAIL_DisableGfxCGPowerGating": 1, + "CAIL,CAIL_DisableUVDPowerGating": 1, + "CAIL,CAIL_DisableVCEPowerGating": 1, + }) + if self.model == "iMac11,2": + self.config["DeviceProperties"]["Add"]["PciRoot(0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)"].update({ + "rebuild-device-tree": 1, + "CAIL,CAIL_DisableDrmdmaPowerGating": 1, + "CAIL,CAIL_DisableGfxCGPowerGating": 1, + "CAIL,CAIL_DisableUVDPowerGating": 1, + "CAIL,CAIL_DisableVCEPowerGating": 1, + }) # Check GPU Vendor if self.constants.metal_build is True: diff --git a/resources/cli_menu.py b/resources/cli_menu.py index 1e0ea5673..040d3566f 100644 --- a/resources/cli_menu.py +++ b/resources/cli_menu.py @@ -64,9 +64,10 @@ Patcher assumes based on stock configuration (ie. iMac10,x-12,x) Valid Options: -1. None(stock GPU) -2. Nvidia GPU -3. AMD GPU +1. None (stock GPU) +2. Nvidia Kepler +3. AMD Polaris +4. AMD Legacy GCN Q. Return to previous menu Note: Patcher will detect whether hardware has been upgraded regardless, this @@ -77,12 +78,19 @@ option is for those patching on a different machine or OCLP cannot detect. if change_menu == "1": self.constants.metal_build = False self.constants.imac_vendor = "None" + self.constants.imac_model = "" elif change_menu == "2": self.constants.metal_build = True self.constants.imac_vendor = "Nvidia" + self.constants.imac_model = "Kepler" elif change_menu == "3": self.constants.metal_build = True self.constants.imac_vendor = "AMD" + self.constants.imac_model = "Polaris" + elif change_menu == "4": + self.constants.metal_build = True + self.constants.imac_vendor = "AMD" + self.constants.imac_model = "Legacy GCN" elif change_menu in {"q", "Q", "Quit", "quit"}: print("Returning to previous menu") else: diff --git a/resources/constants.py b/resources/constants.py index 5b92af3e5..3b51cddc5 100644 --- a/resources/constants.py +++ b/resources/constants.py @@ -146,6 +146,7 @@ class Constants: ## Graphics Settings self.metal_build = False # Set MXM Build support self.imac_vendor = "None" # Set MXM GPU vendor + self.imac_model = "" # Set MXM GPU model self.drm_support = False # Set iMac14,x DRM support self.allow_ivy_igpu = False # Set iMac13,x iGPU support self.moj_cat_accel = False # Set Mojave/Catalina Acceleration support