From b87737f55e1541f3a4379263698c9cc30f3b3be7 Mon Sep 17 00:00:00 2001 From: Jazzzny Date: Wed, 19 Apr 2023 16:04:53 -0400 Subject: [PATCH 1/5] Create modified build without ColorSync downgrade --- resources/sys_patch/sys_patch_generate.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/sys_patch/sys_patch_generate.py b/resources/sys_patch/sys_patch_generate.py index ea4df1ba6..5a941b37b 100644 --- a/resources/sys_patch/sys_patch_generate.py +++ b/resources/sys_patch/sys_patch_generate.py @@ -53,8 +53,7 @@ class GenerateRootPatchSets: required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]}) required_patches.update({"Intel Sandy Bridge": all_hardware_patchset["Graphics"]["Intel Sandy Bridge"]}) # Patchset breaks Display Profiles, don't install if primary GPU is AMD - if self.constants.computer.real_model not in ["Macmini5,2", "iMac12,1", "iMac12,2"]: - required_patches.update({"Non-Metal ColorSync Workaround": all_hardware_patchset["Graphics"]["Non-Metal ColorSync Workaround"]}) + if self.hardware_details["Graphics: Intel Ivy Bridge"] is True: required_patches.update({"Metal 3802 Common": all_hardware_patchset["Graphics"]["Metal 3802 Common"]}) From 11a9ab7b96a4634087a21c8f8551dc4be8ed04b1 Mon Sep 17 00:00:00 2001 From: Jazzzny Date: Wed, 19 Apr 2023 16:52:24 -0400 Subject: [PATCH 2/5] Add support for disabling ColorSync patch --- resources/constants.py | 1 + resources/gui/gui_main.py | 24 +++++++++++++++++++++-- resources/sys_patch/sys_patch_generate.py | 5 +++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/resources/constants.py b/resources/constants.py index a1a7253a4..f838424c7 100644 --- a/resources/constants.py +++ b/resources/constants.py @@ -210,6 +210,7 @@ class Constants: self.set_content_caching: bool = False # Set Content Caching self.disable_xcpm: bool = False # Disable XCPM (X86PlatformPlugin.kext) self.set_vmm_cpuid: bool = False # Set VMM bit inside CPUID + self.disable_cat_colorsync: bool = False # Disable the ColorSync patch to regain Display Profiles self.set_alc_usage: bool = True # Set AppleALC usage self.allow_3rd_party_drives: bool = True # Allow ThridPartyDrives quirk self.allow_nvme_fixing: bool = True # Allow NVMe Kernel Space Patches diff --git a/resources/gui/gui_main.py b/resources/gui/gui_main.py index 6965e814f..cf3ba2965 100644 --- a/resources/gui/gui_main.py +++ b/resources/gui/gui_main.py @@ -2853,13 +2853,25 @@ class wx_python_gui: self.set_terascale_accel_checkbox.Disable() self.set_terascale_accel_checkbox.SetValue(False) + # Disable ColorSync Downgrade + self.set_colorsync_checkbox = wx.CheckBox(self.frame_modal, label="Disable ColorSync Downgrade") + self.set_colorsync_checkbox.SetValue(self.constants.disable_cat_colorsync) + self.set_colorsync_checkbox.Bind(wx.EVT_CHECKBOX, self.disable_colorsync_click) + self.set_colorsync_checkbox.SetPosition(wx.Point( + self.set_terascale_accel_checkbox.GetPosition().x, + self.set_terascale_accel_checkbox.GetPosition().y + self.set_terascale_accel_checkbox.GetSize().height)) + self.set_colorsync_checkbox.SetToolTip(wx.ToolTip("This option will disable the ColorSync patch used on HD 3000 Macs.\nMainly applicable if you need Display Profile functionality")) + if self.computer.real_model not in ["MacBookAir4,1","MacBookAir4,2","MacBookPro8,1","MacBookPro8,2","MacBookPro8,3","Macmini5,1"]: + self.set_colorsync_checkbox.Disable() + self.set_colorsync_checkbox.SetValue(False) + # Windows GMUX self.windows_gmux_checkbox = wx.CheckBox(self.frame_modal, label="Windows GMUX") self.windows_gmux_checkbox.SetValue(self.constants.dGPU_switch) self.windows_gmux_checkbox.Bind(wx.EVT_CHECKBOX, self.windows_gmux_click) self.windows_gmux_checkbox.SetPosition(wx.Point( - self.set_terascale_accel_checkbox.GetPosition().x, - self.set_terascale_accel_checkbox.GetPosition().y + self.set_terascale_accel_checkbox.GetSize().height)) + self.set_colorsync_checkbox.GetPosition().x, + self.set_colorsync_checkbox.GetPosition().y + self.set_colorsync_checkbox.GetSize().height)) self.windows_gmux_checkbox.SetToolTip(wx.ToolTip("Enable this option to allow usage of the hardware GMUX to switch between Intel and Nvidia/AMD GPUs in Windows.")) # Hibernation Workaround @@ -3142,6 +3154,14 @@ class wx_python_gui: global_settings.GlobalEnviromentSettings().write_property("MacBookPro_TeraScale_2_Accel", False) self.constants.allow_ts2_accel = False + def disable_colorsync_click(self, event=None): + if self.set_colorsync_checkbox.GetValue(): + logging.info("ColorSync Patch Enabled") + self.constants.disable_cat_colorsync = True + else: + logging.info("ColorSync Patch Disabled") + self.constants.disable_cat_colorsync = False + def force_web_drivers_click(self, event=None): if self.force_web_drivers_checkbox.GetValue(): logging.info("Force Web Drivers Enabled") diff --git a/resources/sys_patch/sys_patch_generate.py b/resources/sys_patch/sys_patch_generate.py index 5a941b37b..4443e45fa 100644 --- a/resources/sys_patch/sys_patch_generate.py +++ b/resources/sys_patch/sys_patch_generate.py @@ -52,8 +52,9 @@ class GenerateRootPatchSets: required_patches.update({"High Sierra GVA": all_hardware_patchset["Graphics"]["High Sierra GVA"]}) required_patches.update({"WebKit Monterey Common": all_hardware_patchset["Graphics"]["WebKit Monterey Common"]}) required_patches.update({"Intel Sandy Bridge": all_hardware_patchset["Graphics"]["Intel Sandy Bridge"]}) - # Patchset breaks Display Profiles, don't install if primary GPU is AMD - + # Patchset breaks Display Profiles, don't install if primary GPU is AMD. Give users option to disable patch in settings to restore Display Profiles + if self.constants.computer.real_model not in ["Macmini5,2", "iMac12,1", "iMac12,2"] or self.constants.disable_cat_colorsync is False: + required_patches.update({"Non-Metal ColorSync Workaround": all_hardware_patchset["Graphics"]["Non-Metal ColorSync Workaround"]}) if self.hardware_details["Graphics: Intel Ivy Bridge"] is True: required_patches.update({"Metal 3802 Common": all_hardware_patchset["Graphics"]["Metal 3802 Common"]}) From 6ac18b251c12fc55f67f6e2a47dac6ce8a6aab39 Mon Sep 17 00:00:00 2001 From: Jazzzny Date: Wed, 19 Apr 2023 17:10:17 -0400 Subject: [PATCH 3/5] Clean up --- resources/gui/gui_main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/gui/gui_main.py b/resources/gui/gui_main.py index cf3ba2965..56e2b09fd 100644 --- a/resources/gui/gui_main.py +++ b/resources/gui/gui_main.py @@ -3156,10 +3156,10 @@ class wx_python_gui: def disable_colorsync_click(self, event=None): if self.set_colorsync_checkbox.GetValue(): - logging.info("ColorSync Patch Enabled") + logging.info("ColorSync Patch Disabled") self.constants.disable_cat_colorsync = True else: - logging.info("ColorSync Patch Disabled") + logging.info("ColorSync Patch Enabled") self.constants.disable_cat_colorsync = False def force_web_drivers_click(self, event=None): From eeb2e6cb1afb3788cce615c7b0616d157bfbdc74 Mon Sep 17 00:00:00 2001 From: Jazzzny Date: Thu, 20 Apr 2023 20:01:05 -0400 Subject: [PATCH 4/5] Add changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c3a0dd99..888a84c41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ - Restores USB 3.0 expansion card support on USB 1.1 machines such as MacPro5,1 - Resolve OpenCL rendering on Nvidia Web Drivers - thanks [@jazzzny](https://github.com/Jazzzny) +- Implement option to disable ColorSync downgrade on HD 3000 Macs + - Allows for Display Profiles support - Increment Binaries: - PatcherSupportPkg 0.9.6 - release From aae6cc705f3768f5ead97bc76979edc7199420ba Mon Sep 17 00:00:00 2001 From: Jazzzny Date: Fri, 28 Apr 2023 18:17:23 -0400 Subject: [PATCH 5/5] Fix, thanks Slav --- resources/defaults.py | 8 ++++++++ resources/gui/gui_main.py | 2 ++ 2 files changed, 10 insertions(+) diff --git a/resources/defaults.py b/resources/defaults.py index a976db3ca..b1bdc1156 100644 --- a/resources/defaults.py +++ b/resources/defaults.py @@ -71,6 +71,14 @@ class GenerateDefaults: global_settings.GlobalEnviromentSettings().write_property("MacBookPro_TeraScale_2_Accel", False) self.constants.allow_ts2_accel = False + if self.model in ["MacBookAir4,1","MacBookAir4,2","MacBookPro8,1","MacBookPro8,2","MacBookPro8,3","Macmini5,1"]: + colorsync_status = global_settings.GlobalEnviromentSettings().read_property("Disable_ColorSync_Downgrade") + if colorsync_status is True: + self.constants.disable_cat_colorsync = True + else: + global_settings.GlobalEnviromentSettings().write_property("Disable_ColorSync_Downgrade", False) + self.constants.disable_cat_colorsync = False + if self.model in smbios_data.smbios_dictionary: if smbios_data.smbios_dictionary[self.model]["CPU Generation"] >= cpu_data.cpu_data.skylake.value: # On 2016-2017 MacBook Pros, 15" devices used a stock Samsung SSD with IONVMeController diff --git a/resources/gui/gui_main.py b/resources/gui/gui_main.py index 56e2b09fd..977d56be5 100644 --- a/resources/gui/gui_main.py +++ b/resources/gui/gui_main.py @@ -3157,9 +3157,11 @@ class wx_python_gui: def disable_colorsync_click(self, event=None): if self.set_colorsync_checkbox.GetValue(): logging.info("ColorSync Patch Disabled") + global_settings.GlobalEnviromentSettings().write_property("Disable_ColorSync_Downgrade", True) self.constants.disable_cat_colorsync = True else: logging.info("ColorSync Patch Enabled") + global_settings.GlobalEnviromentSettings().write_property("Disable_ColorSync_Downgrade", False) self.constants.disable_cat_colorsync = False def force_web_drivers_click(self, event=None):