Closed Qonfused closed 1 year ago
As I investigate this I'd appreciate some feedback here as I don't have enough familiarity with what devices/behavior are affected by existing WhateverGreen patches. I'm not averse to fixing/re-implementing any existing WEG fixes, though I'd appreciate any help that can shrink the search space in the CFL framebuffer/controller kexts as my time is quite limited. For reference, this is the run-down on what methods/symbols are already hooked/used by WhateverGreen, applicable to CFL->CML iGPUs, etc:
A thought I had was to trace references to potential internal display flags in the CFL fb driver logic. The assumption is that there may be some blocking/conflicting behavior when an internal display is connected w/ the screenpad, similar to how some internal display flags appear to affect specific functionality for external displays. I've seen flags CNUnknownFlag_10
(#442) and CNUnknownFlag_100
(#1189) mentioned in other issues to have some side effects of disabling HDMI audio and display rotation.
Notably with the UX581GV (CFL-H) and UX582LV (CML-H) models, there were some observations of different behavior with the screenpad when the primary display isn't connected; e.g. some framebuffers that disable the primary display connector allowed the screenpad to work for those ZenBook Pro Duo models. For the case of the UX581GV, the screenpad still showed static however. You can find a breakdown of some of these reports here (most notably rogerdcarvalho's):
CC @shiecldk and @rogerdcarvalho if you have any more input here.
Unfortunately, I haven't reproduced the same behavior on the UX481FL model, which doesn't have any similar change in behavior regardless of framebuffer/busID/etc connector patches; even when the primary display is physically disconnected.
I did also experiment with some FeatureControl flags in the CFL framebuffer driver. Changing the CachedEDIDDisable and/or IgnorePanelTmings FeatureControl options on the CFL framebuffer driver doesn't change any behavior here (and probably shouldn't unless there is some EDID caching issue). Thought I should mention that as (I believe) it was suggested as a potential fix in https://github.com/wern-apfel/WhateverGreen/commit/16413cf1d9c34b4381a472ea98d9db5c52206814. Additionally, I also have tried some other workarounds that had been suggested in other issues (e.g. https://github.com/Ardentwheel/OpenCore-Hasee-X57S1/issues/3) but I haven't noticed any clear change in behavior or logs.
Are there any other mitigations currently possible with WhateverGreen that can help isolate this behavior if this may be caused by some resource conflict or read failure w/ either the CFL framebuffer driver or the framebuffer controller?
Not sure there is anything WEG can handle. if I remember correctly, there is no proper concept of power-off in Apple drivers, and it may well be that this second display is connected via some proprietary MUX thus no dice.
Yeah, there don't appear to be any current WEG patches that directly address this issue. However, this issue may require patching CFL framebuffer driver logic with hex patching or by hooking w/ WEG. Additionally, there is no MUX involved with the screenpad; display signals are split between a DDI interface with the CPU with additional sideband signals to the PCH.
Regarding hardware compatibility with macOS, the screenpad has been tested as working between @shiecldk (UX582) and @wern-apfel (UX481), albeit the latter has not yet been reproduced.
@vit9696 I'd prefer leaving this issue open until it's been resolved (for visibility), though depending on how you triage your issues it'd be fair to re-open and mark it low-priority until there is more progress.
A current blocker is a lack of observability for the UX582LV's case (unaffected by this issue); there is a unique opportunity to compare with the UX581LV (affected by this issue), which has very small hardware + firmware differences.
This is a compiled list of current reports for reference:
Model | CPU | Screenpad scrambling behavior? |
---|---|---|
UX582LV | i9-10980HK | • No - @shiecldk |
UX582LV | i7-10870H | • No - @ingener001 (ref) |
UX581LV | i9-10980HK | • No - @vayander (ref) |
UX581LV | i7-10750H | • Yes - @danperks (ref) |
UX581GV | i9-9980HK | • Yes - @ooohlalaa (ref) |
UX581GV | i7-9750H | • Yes - @rogerdcarvalho (ref) |
Model | CPU | Screenpad scrambling behavior? |
---|---|---|
UX481FL | i7-10510U i5-10210U |
• Yes - @Qonfused |
UX481FA | i7-10510U i5-10210U |
• Yes - @UsedDiscord |
Background
I've been investigating an issue with the secondary screenpad display on the ASUS Zenbook Duo notebooks that causes RGB static when the display device is initialized. This behavior only occurs during the second stage of boot into macOS or recoveryOS or upon hot-plug of the screenpad device. This appears to affect UX481FA/UX481FL (CML-U) Zenbook Duo models and UX581GV (CFL-H) + UX581LV / UX582LV (CML-H) Zenbook Pro Duo models, albeit the latter CML-H models are largely unaffected by this issue.
This does not appear to be a bug with WhateverGreen or an issue caused by/addressable with EDID patching or CSM, but a conflict w/ the framebuffer controller or CFL driver. I've verified that this is not a configuration issue suitable for support forums through my tracking in https://github.com/Qonfused/ASUS-ZenBook-Duo-14-UX481-Hackintosh/issues/4.
For clarity (as the description of 'static' is quite vague), here is a video of the display static w/ misc DDC functions like backlight, panel power, and hot-plug demonstrated as working:
Observed Behavior
The screenpad works correctly during the first stage of boot (w/ GOP before GPU driver initialization), but after the second stage of boot, the screenpad displays static. It also shows a black screen very briefly upon hot-plug (before macOS initializes the display) or when no display connector is defined for con1/index1 (disabled); this behavior is expected. Otherwise, the static issue is present regardless of the framebuffer profile or busID + connector type, coinciding w/ when the display is initialized by macOS.
I've noted some other observations that help clarify this behavior:
Testing configuration
I've tested this with a UX481FL ZenBook Duo with an i7-10510u (CML-U) CPU and UHD 620 iGPU. Connected to the iGPU (in DDI order) are an eDP primary display, a DP secondary (screenpad) display, and an HDMI 1.4 port; both the primary display and HDMI connector work fine. The DisplayPort connector/signals from the screenpad aren't at all exotic, though I've started to detail some of ASUS's implementation here. This was tested with DVMT set to 64mb in BIOS (w/ no CSM option), and across all mobile CFL/CML framebuffer ids + connector patches (busids, etc).
As hardware availibility for these laptops is limited, I'd also appreciate input + reports for this issue by anyone affected. I've created a very rudimentary debug script here for dumping kernel logs and some misc. diagnostics + ioreg output.
For reference, below is a debug build of my UX481FA/FL EFI with a copy of my current config.plist:
This is how the screenpad display shows up in System Information (also using a display override):
Additional Documentation and Logs
Logs
Below are logs dumped using
liludump=60 -liludbg -wegdbg
boot args:I've attached the output of the debug script (ref) containing some common kernel and system logs from my UX481FL:
For reference, below is a pruned log of CFL driver kernel logs containing only relevant lines for the screenpad (FB1) emitted after hot-plugging the display:
This log was synced to the device's physical behavior based on a screen + device recording.
https://user-images.githubusercontent.com/32466081/227744065-b3f8b14f-7980-4ba7-b082-c79640716785.mov
Hardware Docs
For brevity, only the most relevant resources are included below.
Display Panels
• UX582LV
You can find a list of all related hardware docs here.