Skip to content

Commit

Permalink
Extend the Backlight Registers Alternative Fix (BLT) submodule to sup…
Browse files Browse the repository at this point in the history
…port Kaby Lake platforms (#116)
  • Loading branch information
0xFireWolf committed Jul 15, 2023
1 parent de66827 commit c7c8dc7
Show file tree
Hide file tree
Showing 6 changed files with 1,198 additions and 291 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
@@ -1,5 +1,9 @@
WhateverGreen Changelog
=======================
#### v1.6.6
- Extended the Backlight Registers Alternative Fix (BLT) submodule to support both KBL and CFL platforms. (by @0xFireWolf)
- Revised the Backlight Registers Fix (BLR) submodule to make it compatible with the Backlight Smoother (BLS) on KBL platforms. (by @0xFireWolf)

#### v1.6.5
- Added constants for macOS 14 support
- Added a new boot argument `-igfxblt` to revert the optimizations done by the compiler in backlight related functions, fixing the 3-minute dark screen issue and making Backlight Smoother (BLS) work on mobile Coffee Lake platforms running macOS 13.4 or later. (by @0xFireWolf)
Expand Down
8 changes: 4 additions & 4 deletions Manual/FAQ.IntelHD.cn.md
Expand Up @@ -2021,13 +2021,13 @@ igfx: @ (DBG) BLS: [COMM] Processing the request: Current = 0x00014ead; Target =

</details>

## 修复在 Coffee Lake 平台上运行 macOS 13.4 或以上版本的笔记本开机持续3分钟暗屏问题
## 修复在 Kaby Lake/Coffee Lake 平台上运行 macOS 13.4 或以上版本的笔记本开机持续3分钟暗屏问题

如果你之前使用“亮度寄存器修复”(也就是 `-igfxblr` 这个启动参数)来解决笔记本开机持续3分钟左右暗屏的问题,在升级到 macOS 13.4 或之后的版本后你会发现该补丁失效了。这是因为苹果简化了显卡驱动中读写寄存器相关的函数,导致编译器优化了函数调用的汇编代码,进而导致“亮度寄存器修复”以及“亮度丝滑器”注册的钩子失效。从 v1.6.5 开始,*WEG* 提供了新的补丁来撤销编译器对亮度调节相关函数的优化以及为 Coffee Lake 平台的笔记本重写了调节亮度的函数,从而解决开机持续3分钟暗屏以及“亮度丝滑器”失效的问题。
如果你之前使用“亮度寄存器修复”(也就是 `-igfxblr` 这个启动参数)来解决笔记本开机持续3分钟左右暗屏的问题,在升级到 macOS 13.4 或之后的版本后你会发现该补丁失效了。这是因为苹果简化了显卡驱动中读写寄存器相关的函数,导致编译器优化了函数调用的汇编代码,进而导致“亮度寄存器修复”以及“亮度丝滑器”注册的钩子失效。从 v1.6.5 开始,*WEG* 提供了新的补丁来撤销编译器对亮度调节相关函数的优化以及为 Coffee Lake 平台的笔记本重写了调节亮度的函数,从而解决开机持续3分钟暗屏以及“亮度丝滑器”失效的问题。从 v1.6.6 开始,*WEG* 支持 Kaby Lake 平台。

请注意这个新补丁仅适用于使用 macOS 13.4 以及以上的 Coffee Lake 核显驱动的笔记本用户。你可以为核显添加 `enable-backlight-registers-alternative-fix` 属性或者直接使用 `-igfxblt` 启动参数来启用这个新的补丁。与此同时,你可以删除原“亮度寄存器修复”的 `enable-backlight-registers-fix` 设备属性或者 `-igfxblr` 启动参数。如果你想在 macOS 13.4 或以上系统中使用“亮度丝滑器”,你需要添加 `-igfxblt` 以及 `-igfxbls` 这两个启动参数。
请注意这个新补丁仅适用于使用 macOS 13.4 以及以上的 Kaby Lake 或者 Coffee Lake 核显驱动的笔记本用户。你可以为核显添加 `enable-backlight-registers-alternative-fix` 属性或者直接使用 `-igfxblt` 启动参数来启用这个新的补丁。与此同时,你可以删除原“亮度寄存器修复”的 `enable-backlight-registers-fix` 设备属性或者 `-igfxblr` 启动参数。如果你想在 macOS 13.4 或以上系统中使用“亮度丝滑器”,你需要添加 `-igfxblt` 以及 `-igfxbls` 这两个启动参数。

Ice Lake 平台的笔记本用户不受此问题影响,然而 Kaby Lake 平台的笔记本用户可能在 macOS 13.4 或以上系统中遇到类似的3分钟暗屏问题。由于没有足够空间来覆盖读取亮度相关寄存器的汇编指令,此新补丁暂不支持 Kaby Lake 平台
请注意 Ice Lake 平台的笔记本用户不受此问题影响。

## 修复 Ice Lake 平台上笔记本开机持续花屏7到15秒的问题

Expand Down
8 changes: 4 additions & 4 deletions Manual/FAQ.IntelHD.en.md
Expand Up @@ -2671,13 +2671,13 @@ igfx: @ (DBG) BLS: [COMM] Processing the request: Current = 0x00014ead; Target =

</details>

## Fix the 3-minute black screen issue on CFL platforms running macOS 13.4 or later
## Fix the 3-minute black screen issue on KBL/CFL platforms running macOS 13.4 or later

If you have a CFL-based laptop and rely on the Backlight Registers Fix (BLR) to fix the 3-minute black screen issue, you may notice that BLR (`-igfxblr`) no longer work on macOS 13.4 or later. This is because Apple has simplified the implementation of the functions, `ReadRegister32` and `WriteRegister32`, in Coffee Lake's framebuffer driver shipped by macOS 13.4, so the compiler chose to inline invocations of those functions as many as possible. As a result, the `WriteRegister32` hooks registered by the Backlight Registers Fix (BLR) and the Backlight Smoother (BLS) submodules no longer work. Starting from v1.6.5, WEG can revert the optimizations done by the compiler in backlight related functions, provide an alternative to BLR and make BLS work properly on macOS 13.4 or later.
If you have a KBL/CFL-based laptop and rely on the Backlight Registers Fix (BLR) to fix the 3-minute black screen issue, you may notice that BLR (`-igfxblr`) no longer work on macOS 13.4 or later. This is because Apple has simplified the implementation of the functions, `ReadRegister32` and `WriteRegister32`, in Kaby/Coffee Lake's framebuffer drivers shipped by macOS 13.4, so the compiler chose to inline invocations of those functions as many as possible. As a result, the `WriteRegister32` hooks registered by the Backlight Registers Fix (BLR) and the Backlight Smoother (BLS) submodules no longer work. Starting from v1.6.5, WEG can revert the optimizations done by the compiler in backlight related functions, provide an alternative to BLR and make BLS work properly on macOS 13.4 or later. Starting from v1.6.6, WEG supports Kaby Lake platforms.

Note that this alternative fix is only available for users who have laptops using Coffee Lake's graphics driver and running macOS 13.4 or later. You can add the property `enable-backlight-registers-alternative-fix` to `IGPU` or use the boot argument `-igfxblt` to enable this new fix and remove the boot argument `-igfxblr` and/or the device property `enable-backlight-registers-fix`. If you wish to use the Backlight Smoother on macOS 13.4 or later, you need to add both `-igfxblt` and `-igfxbls` to the boot arguments.
Note that this alternative fix is only available for users who have laptops using Kaby Lake's or Coffee Lake's graphics driver and running macOS 13.4 or later. You can add the property `enable-backlight-registers-alternative-fix` to `IGPU` or use the boot argument `-igfxblt` to enable this new fix and remove the boot argument `-igfxblr` and/or the device property `enable-backlight-registers-fix`. If you wish to use the Backlight Smoother on macOS 13.4 or later, you need to add both `-igfxblt` and `-igfxbls` to the boot arguments.

Note that Ice Lake platforms are not affected because `WriteRegister32` is not inlined in backlight related functions, while Kaby Lake platforms may be affected but are not supported by this new fix at this moment, because it is hard to fix the write operation on the register `0xC8250` due to the space limit.
Note that Ice Lake platforms are not affected because `WriteRegister32` is not inlined in backlight related functions.

## Fix the issue that the builtin display remains garbled after the system boots on ICL platforms

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -94,7 +94,7 @@ Read [FAQs](./Manual/) and avoid asking any questions. No support is provided fo
|--- |--- |--- |
| `-igfxblr` | `enable-backlight-registers-fix` property on IGPU | Fix backlight registers on KBL, CFL and ICL platforms |
| `-igfxbls` | `enable-backlight-smoother` property on IGPU | Make brightness transitions smoother on IVB+ platforms. [Read the manual](./Manual/FAQ.IntelHD.en.md#customize-the-behavior-of-the-backlight-smoother-to-improve-your-experience) |
| `-igfxblt` | `enable-backlight-registers-alternative-fix` property on IGPU | An alternative to the Backlight Registers Fix and make Backlight Smoother work on CFL platform running macOS 13.4 or later. [Read the manual](./Manual/FAQ.IntelHD.en.md#fix-the-3-minute-black-screen-issue-on-cfl-platforms-running-macos-134-or-later) |
| `-igfxblt` | `enable-backlight-registers-alternative-fix` property on IGPU | An alternative to the Backlight Registers Fix and make Backlight Smoother work on KBL/CFL platforms running macOS 13.4 or later. [Read the manual](./Manual/FAQ.IntelHD.en.md#fix-the-3-minute-black-screen-issue-on-cfl-platforms-running-macos-134-or-later) |
| `-igfxcdc` | `enable-cdclk-frequency-fix` property on IGPU | Support all valid Core Display Clock (CDCLK) frequencies on ICL platforms. [Read the manual](./Manual/FAQ.IntelHD.en.md#support-all-possible-core-display-clock-cdclk-frequencies-on-icl-platforms) |
| `-igfxdbeo` | `enable-dbuf-early-optimizer` property on IGPU | Fix the Display Data Buffer (DBUF) issues on ICL+ platforms. [Read the manual](./Manual/FAQ.IntelHD.en.md#fix-the-issue-that-the-builtin-display-remains-garbled-after-the-system-boots-on-icl-platforms) |
| `-igfxdump` | N/A | Dump IGPU framebuffer kext to `/var/log/AppleIntelFramebuffer_X_Y` (available in DEBUG binaries) |
Expand Down

1 comment on commit c7c8dc7

@KazuDante89
Copy link

@KazuDante89 KazuDante89 commented on c7c8dc7 Oct 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if you are still working on this project but wanted to inform you as your work are related to blackscreen issues on skl kbl ect . There's a specific setup of laptops that I noticed refuSes to natively work with KBL graphics . It's always the same a I5-7200U with an HD620 (not UHD) which always results in internal display being left blank/black with backlight on . Many have tried all args related to this with no results . And this issue has been recorded as far back as Big Sur and maybe even further. Only solution I found is to spoof it as Skylake and use Opencore legacy patcher ( on Ventura and Sonoma ) so that it installs the Skylake drivers.

Besides me facing this issue but it was on internal laptop panel ( HDMI had to wait about 10 seconds before plugging it in , screen would go green then HDMI display would work fine ) here's another recent user with the same specs facing pretty much same issue : https://www.reddit.com/r/hackintosh/comments/178ne10/no_signal_black_screen_on_external_monitor/

Please sign in to comment.