Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Kernel/FB] ScreenPad display static on FB initialization #4

Open
11 of 19 tasks
Qonfused opened this issue Aug 15, 2022 · 325 comments · Fixed by #1
Open
11 of 19 tasks

[Kernel/FB] ScreenPad display static on FB initialization #4

Qonfused opened this issue Aug 15, 2022 · 325 comments · Fixed by #1
Assignees
Labels
help wanted Extra attention is needed project:UX481 For variants UX481FA (14", 2019) and UX481FL (14", 2019) project:UX581 For variants UX581GV (15.6", 2019) and UX581LV (15.6", 2020) status:investigating Issue is currently being investigated. type:bug Something isn't working

Comments

@Qonfused
Copy link
Owner

Qonfused commented Aug 15, 2022

Follow up to shiecldk/ASUS-ZenBook-Pro-Duo-15-OLED-UX582-Hackintosh#2 investigating scrambled screenpad plus display-out.

IMG_0838-H264_Proxy_half_size.mov

Current tasks:

  • Display output
  • Pre-OS (OpenCore verbose)
    • GOP (UEFI feature)
  • iGPU Framebuffer
    • Proper RGB screenspace
    • QE/CI acceleration
  • Display metadata (EDID)
    • Device Name (Cosmetic)
    • Device and Vendor IDs
    • Valid resolution data
      • Native resolution
      • Default resolution
      • Scaled resolutions
    • Valid clock/timings data
    • Physical size info (Cosmetic)
      • Panel dimensions
      • Correct default ppmm
  • PCH Sideband signals
    • Display Hotplug
    • Panel power and backlight
    • GMBUS I2C GPIO
@Qonfused
Copy link
Owner Author

Qonfused commented Aug 15, 2022

Found a few item details from https://en.accessoires-asus.com/ regarding the Screenpad Plus:

Item Image
Asus Screen module blue touch screenpad FHD 12

SKU: MODULESCREENPADUX481BLUEFHD
P/N: 90NB0P61-R20010

EDP Cable reference: 1422-03ER0AS
back-screenpad-topcase
(For main display)

Asus Screen cable EDP for UX481FLY

SKU: EDPCBLUX481
P/N: 14005-03210100

EDP Cable reference: 1422-03EK0AS
long-edp-cable
Asus Touch controller card for UX481FLY

SKU: TOUCHCONTBDUX481
P/N: 90NB0P60-R10020
Model: 60NB0P60-TP1020
touch-controller

^ Both the screenpad plus assembly and actual primary display cable have an 'EDP cable reference' id, which appear only to deviate by the length of the cable. There however appears to not be any individual catalog item for the screenpad plus's EDP cable (probably only included in the whole top-case assembly linked above).

This also verifies the connector type from the datasheet @UsedDiscord provided, analyzed in #1 (comment) w/ the device schematic however pointing out a DP interface:

I noticed that the screenpad plus is designated as DP (also listed as DDI1) in the device's schematic w/ a different layout than eDP, though it matches what was shown in the datasheet you linked as the physical connector:

image image

On the left is the LCD connector and on the right looks to be for the touchscreen digitizer: image

@Qonfused
Copy link
Owner Author

Qonfused commented Aug 15, 2022

I've also noted in #2 (comment) that an entry for the EDID data for the screenpad plus display exists in the linux-hw repository:

I also found the display under the linux hw EDID repo: https://raw.githubusercontent.com/linuxhw/EDID/master/DigitalDisplay.md

MFG Model Name Res Inch Made ID
BOE BOE087F HF NV126B5M-N41 1920 x 515 12.6 2019 46E74341751E

edid-decode (hex):

00 ff ff ff ff ff ff 00 09 e5 7f 08 00 00 00 00
01 1d 01 04 a5 1f 08 78 02 d2 2d 93 51 57 8d 28
18 4e 52 00 00 00 01 01 01 01 01 01 01 01 01 01
01 01 01 01 01 01 94 1b 80 a0 70 03 32 20 30 20
55 00 35 53 10 00 00 1a 12 16 80 a0 70 03 32 20
30 20 55 00 35 53 10 00 00 1a 00 00 00 fe 00 42
4f 45 20 48 46 0a 20 20 20 20 20 20 00 00 00 fe
00 4e 56 31 32 36 42 35 4d 2d 4e 34 31 0a 00 ed

#2 already confirms the validity of the EDID data present from the screenpad plus display. This can be further studied in Linux as to whether or not the display is connected to the iGPU through an eDP or a DP interface.

(e.g. https://linux-hardware.org/?probe=d680085d25):

EDID output
edid-decode "/sys/class/drm/card0-DP-1/edid":

EDID (hex):
00ffffffffffff0009e57f0800000000
011d0104a51f087802d22d9351578d28
184e5200000001010101010101010101
010101010101941b80a0700332203020
550035531000001a121680a070033220
3020550035531000001a000000fe0042
4f452048460a202020202020000000fe
004e5631323642354d2d4e34310a00ed

Extracted contents:
header:          00 ff ff ff ff ff ff 00
serial number:   ...
version:         01 04
basic params:    a5 1f 08 78 02
chroma info:     d2 2d 93 51 57 8d 28 18 4e 52
established:     00 00 00
standard:        01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01
descriptor 1:    94 1b 80 a0 70 03 32 20 30 20 55 00 35 53 10 00 00 1a
descriptor 2:    12 16 80 a0 70 03 32 20 30 20 55 00 35 53 10 00 00 1a
descriptor 3:    00 00 00 fe 00 42 4f 45 20 48 46 0a 20 20 20 20 20 20
descriptor 4:    00 00 00 fe 00 4e 56 31 32 36 42 35 4d 2d 4e 34 31 0a
extensions:      00
checksum:        ed

EDID version: 1.4
Manufacturer: BOE Model 87f Serial Number ...
Made in week 1 of 2019
Digital display
8 bits per primary color channel
DisplayPort interface
Maximum image size: 31 cm x 8 cm
Gamma: 2.20
Supported color formats: RGB 4:4:4
First detailed timing includes the native pixel format and preferred refresh rate
Display x,y Chromaticity:
  Red:   0.5771, 0.3173
  Green: 0.3398, 0.5527
  Blue:  0.1562, 0.0957
  White: 0.3076, 0.3212
Established timings supported:
Standard timings supported:
Detailed mode: Clock 70.600 MHz, 309 mm x 83 mm
               1920 1968 2000 2080 hborder 0
                515  520  525  565 vborder 0
               +hsync -vsync 
               VertFreq: 60 Hz, HorFreq: 33942 Hz
Detailed mode: Clock 56.500 MHz, 309 mm x 83 mm
               1920 1968 2000 2080 hborder 0
                515  520  525  565 vborder 0
               +hsync -vsync 
               VertFreq: 48 Hz, HorFreq: 27163 Hz
ASCII string: BOE HF
ASCII string: NV126B5M-N41
Checksum: 0xed (valid)
EDID block does NOT conform to EDID 1.4!
	Missing name descriptor
	Missing monitor ranges
...
gpu-manager.log output
...
Vendor/Device Id: 8086:9b41
BusID "PCI:0@0:2:0"
Is boot vga? yes
Vendor/Device Id: 10de:1d52
BusID "PCI:2@0:0:0"
can't open /sys/bus/pci/devices/0000:02:00.0/boot_vga
Is boot vga? no
...
Found "/dev/dri/card0", driven by "i915"
output 0:
	card0-eDP-1
output 1:
	card0-DP-1
Number of connected outputs for /dev/dri/card0: 2
...
xorg.log output
...
[     9.435] (II) modeset(0): EDID for output DP-1
[     9.435] (II) modeset(0): Manufacturer: BOE  Model: 87f  Serial#: ...
[     9.435] (II) modeset(0): Year: 2019  Week: 1
[     9.435] (II) modeset(0): EDID Version: 1.4
[     9.435] (II) modeset(0): Digital Display Input
[     9.435] (II) modeset(0): 8 bits per channel
[     9.435] (II) modeset(0): Digital interface is DisplayPort
[     9.435] (II) modeset(0): Max Image Size [cm]: horiz.: 31  vert.: 8
[     9.435] (II) modeset(0): Gamma: 2.20
[     9.435] (II) modeset(0): No DPMS capabilities specified
[     9.435] (II) modeset(0): Supported color encodings: RGB 4:4:4 
[     9.435] (II) modeset(0): First detailed timing is preferred mode
[     9.435] (II) modeset(0): Preferred mode is native pixel format and refresh rate
[     9.435] (II) modeset(0): redX: 0.577 redY: 0.317   greenX: 0.340 greenY: 0.553
[     9.435] (II) modeset(0): blueX: 0.156 blueY: 0.096   whiteX: 0.308 whiteY: 0.321
[     9.435] (II) modeset(0): Manufacturer's mask: 0
[     9.435] (II) modeset(0): Supported detailed timing:
[     9.435] (II) modeset(0): clock: 70.6 MHz   Image Size:  309 x 83 mm
[     9.435] (II) modeset(0): h_active: 1920  h_sync: 1968  h_sync_end 2000 h_blank_end 2080 h_border: 0
[     9.435] (II) modeset(0): v_active: 515  v_sync: 520  v_sync_end 525 v_blanking: 565 v_border: 0
[     9.435] (II) modeset(0): Supported detailed timing:
[     9.435] (II) modeset(0): clock: 56.5 MHz   Image Size:  309 x 83 mm
[     9.435] (II) modeset(0): h_active: 1920  h_sync: 1968  h_sync_end 2000 h_blank_end 2080 h_border: 0
[     9.435] (II) modeset(0): v_active: 515  v_sync: 520  v_sync_end 525 v_blanking: 565 v_border: 0
[     9.435] (II) modeset(0):  BOE HF
[     9.435] (II) modeset(0):  NV126B5M-N41
[     9.435] (II) modeset(0): EDID (in hex):
[     9.435] (II) modeset(0): 	00ffffffffffff0009e57f0800000000
[     9.435] (II) modeset(0): 	011d0104a51f087802d22d9351578d28
[     9.435] (II) modeset(0): 	184e5200000001010101010101010101
[     9.435] (II) modeset(0): 	010101010101941b80a0700332203020
[     9.435] (II) modeset(0): 	550035531000001a121680a070033220
[     9.435] (II) modeset(0): 	3020550035531000001a000000fe0042
[     9.436] (II) modeset(0): 	4f452048460a202020202020000000fe
[     9.436] (II) modeset(0): 	004e5631323642354d2d4e34310a00ed
[     9.436] (WW) modeset(0): Output DP-1: Strange aspect ratio (309/83), consider adding a quirk
[     9.436] (WW) modeset(0): Output DP-1: Strange aspect ratio (309/83), consider adding a quirk
[     9.436] (II) modeset(0): Printing probed modes for output DP-1
[     9.436] (II) modeset(0): Modeline "1920x515"x60.1   70.60  1920 1968 2000 2080  515 520 525 565 +hsync -vsync (33.9 kHz eP)
[     9.436] (II) modeset(0): Modeline "1920x515"x48.1   56.50  1920 1968 2000 2080  515 520 525 565 +hsync -vsync (27.2 kHz e)
[     9.444] (II) modeset(0): EDID for output HDMI-1
[     9.444] (II) modeset(0): Output eDP-1 connected
[     9.444] (II) modeset(0): Output DP-1 connected
[     9.444] (II) modeset(0): Output HDMI-1 disconnected
...

@Qonfused

This comment was marked as outdated.

@Qonfused

This comment was marked as outdated.

@Maleficent-Magik

This comment was marked as outdated.

@Qonfused

This comment was marked as outdated.

@VillenaDeveloper
Copy link

I don't have much idea about the technical details, but at the level of the system specs is detected with a wrong resolution, in case you didn't notice>
Screenpadplus resolution

@Qonfused
Copy link
Owner Author

Qonfused commented Aug 18, 2022

That is interesting; I haven't noticed that at all in my testing. The 1280 x 720 resolution seems like it might be a fallback due to the odd display aspect ratio.

Could you try running the below command in terminal?

ioreg -l | grep -5 IODisplayEDID
Example output
$ ioreg -l | grep -5 IODisplayEDID

    | |   | |       {
    | |   | |         "IOClass" = "AppleBacklightDisplay"
>     | |   | |         "CFBundleIdentifier" = "com.apple.iokit.IOGraphicsFamily"
    | |   | |         "IOProviderClass" = "IODisplayConnect"
    | |   | |         "DisplayProductID" = 5333
    | |   | |         "IODisplayEDID" = <00ffffffffffff000daed51400000000281a0104a51f117802ee95a3544c99260f505400000001010101010101010101010101010101b43b804a71383440503c680035ad10000018000000fe004e3134304843452d454e320a20000000fe00434d4e0a202020202020202020000000fe004e3134304843452d454e320a200010>
    | |   | |         "IODisplayPrefsKeyOld" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2/AppleIntelFramebuffer@0/display0/AppleBacklightDisplay-dae-14d5"
    | |   | |         "IODisplayPrefsKey" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2-dae-14d5-c148f7aca335bead"
    | |   | |         "IOProbeScore" = 3000
    | |   | |         "IODisplayGUID" = 436849163854938112
    | |   | |         "IODisplayParameters" = {"commit"={"reg"=0},"linear-brightness-probe"={"min"=0,"max"=65403,"value"=17497},"fade-time2"={"min"=0,"max"=10000,"value"=4000},"ggsc"={"min"=0,"max"=65536,"value"=65536},"vblm"={"min"=0,"max"=196608,"value"=65536},"dsyp"={"min"=0,"max"=2,"value"=2},"rgsc"={"min"=0,"max"=65536,"value"=65536},"fade-style"={"min"=0,"max"=10,"value"=0},"fade-time1"={"min"=0,"max"=10000,"value"=500},"bgsc"={"min"=0,"max"=65536,"value"=65536},"brightness-probe"={"min"=0,"max"=1024,"value"=768},"fade-time3"={"min"=0,"max"=10000,"value"=500},"bklt"={"min"=0,"max"=65535,"value"=17497},"linear-brightness"={"min"=0,"max"=65403,"value"=17497},"brightness"={"min"=0,"max"=1024,"value"=768},"brightness-fade"={"min"=0,"max"=1023,"value"=0},"usable-linear-brightness"={"min"=655,"max"=65403,"value"=17497},"ownr"=4294968567}
--
    | |   | |       {
    | |   | |         "IOClass" = "AppleDisplay"
    | |   | |         "CFBundleIdentifier" = "com.apple.iokit.IOGraphicsFamily"
    | |   | |         "IOProviderClass" = "IODisplayConnect"
    | |   | |         "DisplayProductID" = 2175
    | |   | |         "IODisplayEDID" = <00ffffffffffff0009e57f0800000000011d0104a51f087802d22d9351578d28184e5200000001010101010101010101010101010101941b80a0700332203020550035531000001a121680a0700332203020550035531000001a000000fe00424f452048460a202020202020000000fe004e5631323642354d2d4e34310a00ed>
    | |   | |         "IODisplayPrefsKeyOld" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2/AppleIntelFramebuffer@1/display0/AppleDisplay-9e5-87f"
    | |   | |         "IODisplayPrefsKey" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2-9e5-87f-cbf4607b0ec1199d"
    | |   | |         "IOProbeScore" = 2000
    | |   | |         "IOPowerManagement" = {"CapabilityFlags"=49152,"MaxPowerState"=3,"CurrentPowerState"=3}
    | |   | |         "IODisplayParameters" = {"bgsc"={"min"=0,"max"=65536,"value"=65536},"rgsc"={"min"=0,"max"=65536,"value"=65536},"vblm"={"min"=0,"max"=196608,"value"=65536},"ownr"=4294968568,"ggsc"={"min"=0,"max"=65536,"value"=65536}}

This is what it should look like in system report:
Screen Shot 2022-08-18 at 9 22 22 AM

@VillenaDeveloper
Copy link

VillenaDeveloper commented Aug 18, 2022

This is my output:

    | |   | | |     {
    | |   | | |       "IOClass" = "AppleBacklightDisplay"
    | |   | | |       "CFBundleIdentifier" = "com.apple.iokit.IOGraphicsFamily"
    | |   | | |       "IOProviderClass" = "IODisplayConnect"
    | |   | | |       "DisplayProductID" = 5333
    | |   | | |       "IODisplayEDID" = <00ffffffffffff000daed51400000000281a0104a51f117802ee95a3544c99260f505400000001010101010101010101010101010101b43b804a71383440503c680035ad10000018000000fe004e3134304843452d454e320a20000000fe00434d4e0a202020202020202020000000fe004e3134304843452d454e320a200010>
    | |   | | |       "IODisplayPrefsKeyOld" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2/AppleIntelFramebuffer@0/display0/AppleBacklightDisplay-dae-14d5"
    | |   | | |       "IODisplayPrefsKey" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2-dae-14d5-c148f7aca335bead"
    | |   | | |       "IOProbeScore" = 3000
    | |   | | |       "IODisplayGUID" = 436849163854938112
    | |   | | |       "IODisplayParameters" = {"commit"={"reg"=0},"linear-brightness-probe"={"min"=0,"max"=65403,"value"=65403},"fade-time2"={"min"=0,"max"=10000,"value"=4000},"ggsc"={"min"=0,"max"=65536,"value"=65536},"vblm"={"min"=0,"max"=196608,"value"=65536},"dsyp"={"min"=0,"max"=2,"value"=2},"rgsc"={"min"=0,"max"=65536,"value"=65536},"fade-style"={"min"=0,"max"=10,"value"=0},"fade-time1"={"min"=0,"max"=10000,"value"=500},"bgsc"={"min"=0,"max"=65536,"value"=65536},"brightness-probe"={"min"=0,"max"=1024,"value"=1024},"fade-time3"={"min"=0,"max"=10000,"value"=500},"bklt"={"min"=0,"max"=65535,"value"=52316},"linear-brightness"={"min"=0,"max"=65403,"value"=52316},"brightness"={"min"=0,"max"=1024,"value"=979},"brightness-fade"={"min"=0,"max"=1023,"value"=0},"usable-linear-brightness"={"min"=655,"max"=65403,"value"=52316},"ownr"=4294968515}
--
    | |   | | |     {
    | |   | | |       "IOClass" = "AppleDisplay"
    | |   | | |       "CFBundleIdentifier" = "com.apple.iokit.IOGraphicsFamily"
    | |   | | |       "IOProviderClass" = "IODisplayConnect"
    | |   | | |       "DisplayProductID" = 2175
    | |   | | |       "IODisplayEDID" = <00ffffffffffff0009e57f0800000000011d0104a51f087802d22d9351578d28184e5200000001010101010101010101010101010101941b80a0700332203020550035531000001a121680a0700332203020550035531000001a000000fe00424f452048460a202020202020000000fe004e5631323642354d2d4e34310a00ed>
    | |   | | |       "IODisplayPrefsKeyOld" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2/AppleIntelFramebuffer@1/display0/AppleDisplay-9e5-87f"
    | |   | | |       "IODisplayPrefsKey" = "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/IGPU@2-9e5-87f-cbf4607b0ec1199d"
    | |   | | |       "IOProbeScore" = 2000
    | |   | | |       "IOPowerManagement" = {"CapabilityFlags"=49152,"MaxPowerState"=3,"CurrentPowerState"=3}
    | |   | | |       "IODisplayParameters" = {"bgsc"={"min"=0,"max"=65536,"value"=65536},"rgsc"={"min"=0,"max"=65536,"value"=65536},"vblm"={"min"=0,"max"=196608,"value"=65536},"ownr"=4294968517,"ggsc"={"min"=0,"max"=65536,"value"=65536}}

@Maleficent-Magik
Copy link

Looks like many people are joining the problem! Glad to have people around :')

@Maleficent-Magik

This comment was marked as off-topic.

@Qonfused
Copy link
Owner Author

Huh nothing looks wrong with the display's EDID data, and the entry otherwise looks identical to mine. I noticed a 0x3ea5 device id in your first screenshot, but I haven't seen this using that device id before. What does your DeviceProperties > Add > PciRoot(0x0)/Pci(0x2,0x0) section look like in your config.plist?

@VillenaDeveloper
Copy link

VillenaDeveloper commented Aug 18, 2022

Using a mouse currently, and really glad about your efforts on making this hackintosh works.
Thanks a lot!

@Qonfused

This comment was marked as off-topic.

@Maleficent-Magik

This comment was marked as off-topic.

@VillenaDeveloper
Copy link

VillenaDeveloper commented Aug 18, 2022

My device properties look like this

			<key>PciRoot(0x0)/Pci(0x2,0x0)</key>
			<dict>
				<key>AAPL,ig-platform-id</key>
				<data>CQClPg==</data>
				<key>AAPL01,override-no-connect</key>
				<data>AP///////wAJ5X8IAAAAAAEdAQSlHwh4AtItk1FXjSgYTlIAAAABAQEBAQEBAQEBAQEBAQEBlBuAoHADMiAwIFUANVMQAAAaEhaAoHADMiAwIFUANVMQAAAaAAAA/gBCT0UgSEYKICAgICAgAAAA/gBOVjEyNkI1TS1ONDEKAO0=</data>
				<key>device-id</key>
				<data>pT4AAA==</data>
				<key>enable-lspcon-support</key>
				<data>AQAAAA==</data>
				<key>enable-hdmi20</key>
				<data>AQAAAA==</data>
				<key>framebuffer-con1-enable</key>
				<data>AQAAAA==</data>
				<key>framebuffer-con1-alldata</key>
				<data>AQUJAAAEAACHAQAA</data>
				<key>framebuffer-con2-enable</key>
				<data>AQAAAA==</data>
				<key>framebuffer-con2-alldata</key>
				<data>AgQKAAAIAACHAQAA</data>
				<key>framebuffer-con2-has-lspcon</key>
				<data>AQAAAA==</data>
				<key>framebuffer-patch-enable</key>
				<data>AQAAAA==</data>
				<key>hda-gfx</key>
				<string>onboard-1</string>
			</dict>

@VillenaDeveloper
Copy link

And with that new frame buffer @Qonfused did you manage to use the second screen? or still the "analog noise" continuously there...?

@Qonfused
Copy link
Owner Author

It also seems the injected EDID data from AAPL01,override-no-connect matches:

// Injected EDID data
00FFFFFF FFFFFF00 09E57F08 00000000 011D0104 A51F0878 02D22D93 51578D28 184E5200 00000101 01010101 01010101 01010101 0101941B 80A07003 32203020 55003553 1000001A 121680A0 70033220 30205500 35531000 001A0000 00FE0042 4F452048 460A2020 20202020 000000FE 004E5631 32364235 4D2D4E34 310A00ED

// Expected EDID data
00ffffff ffffff00 09e57f08 00000000 011d0104 a51f0878 02d22d93 51578d28 184e5200 00000101 01010101 01010101 01010101 0101941b 80a07003 32203020 55003553 1000001a 121680a0 70033220 30205500 35531000 001a0000 00fe0042 4f452048 460a2020 20202020 000000fe 004e5631 32364235 4d2d4e34 310a00ed

It might help clearing NVRAM if you've tried booting before with a different framebuffer patch? You'd have to press space in the opencore boot menu and look for a 'Clear NVRAM' option. There is also the option to clear kext cache (sudo kextcache -i /) but idk if that would help.

@Qonfused

This comment was marked as resolved.

@Maleficent-Magik
Copy link

Maleficent-Magik commented Aug 18, 2022

When I downloaded the BIOS for the UX481FA (Y Specific!) and ran it through AMIBCP version 5.02.0031, a bios editor, I noticed that when I looked inside, I found several things

  • such as at line 0x181E or 6544: "WARNING: CSM is Loaded!"

CSM1

  • at 0x181F or 6545: "Disable the CSM in Setup. [...]"
    CSM2

  • at 0x1A9F or 7237 : "Error 0x%04X%04X - CSM Enabled while in Secure Boot Mode"
    CSM3

I include 2 files:

  • the file "en.zip" corresponds to the bios extracted and readable by Notepad. these are the bios strings
    en.zip

and

  • the bios UX481FAYAS302.zip corresponds to the bios downloaded without extraction
    UX481FAYAS302.zip

and also the software of extract : https://www.mediafire.com/file/ckao23pe57ny7jm/AMIBCP_5.02.0031.rar/file

but nothing that can correspond to something active or inactive...
So I think CSM is nothing in the story but more a framebuffer & WEG patch story possibly even a custom WEG patch

@Maleficent-Magik

This comment was marked as off-topic.

@Qonfused
Copy link
Owner Author

Qonfused commented Mar 27, 2023

I realized I forgot to update and include logging for Lilu + WEG. If you want to dump logs for Lilu + WEG, etc, add the below boot args:

-msgbuf=1048576 liludump=60 -liludbg -wegdbg

Log output can be found in /var/log/Lilu_x.x.x_y.y.txt. You can also use -liludbgall to enable debugging for Lilu + all Lilu plugins.

I've included some more logs in the bugtracker issue.

@Maleficent-Magik
Copy link

I had searched a bit in Hackintool what the Framebuffer and Connector Flags correspond to, I think we should play with them.

I'll come back to Github later when I'll finish most of my exams (April 21st)

@Maleficent-Magik
Copy link

@Qonfused
Copy link
Owner Author

I think only a handful of names may differ, but Hackintool pulls their connector flags from WhateverGreen source (source linked in #4 (comment)). You should be able to see the same bit values to compare when you hover over them in Hackintool, so it's mostly not an issue.

I also haven't looked into framebuffer flags (rather than connector flags).

@danperks
Copy link

Hi all, I'm now finished with University!

Can you remind me, what can I do to help? I remember needing to dump some stuff?
Don't want to do anything that won't help!

@Qonfused
Copy link
Owner Author

I have a debug script under scripts/gen-debug.sh that dumps a bunch of miscellaneous kernel logs, etc. This on it's own is pretty comprehensive when it comes to figuring out issues on early boot.

To get logging from kexts, you'll also need to use debug builds of Lilu and WhateverGreen and add the -liludbg -wegdbg boot args to enable logging. You'll also want these boot args for debugging:

NVRAM:
Add:
7C436110-AB2A-4BBB-A880-FE41995C9F82:
# Breakdown of used boot args:
# `-v` (verbose mode)
# `debug=0x100` (debug mask; disables watchdog to avoid panic reboot)
# `keepsyms=1` (show panic log debug symbols)
# `msgbuf=1048576` (Resizes kernel msg buffer to 1 MB; avoids truncation)
boot-args: String | "-v debug=0x100 keepsyms=1 msgbuf=1048576"

With these additional boot args, you can get kext logging from dmesg by running sudo dmesg > ~/Desktop/dmesg.log.

It may also help to include your config.plist file. The DeviceProperties section is the main interest for your specific issue if you just want to provide a screenshot instead.


Feel free to create another issue here if you feel like you need more in-depth help for your specific issue (with your screenpad + primary display).

@RobyRew
Copy link

RobyRew commented Apr 23, 2023

Hello, I have read this thread and I've read many others, I've noticed a lot of Asus laptops have this issue on the second screen or display over HDMI.

Im experiencing the same thing/similar over HDMI output.
But as a workaround I disable audio completely from the config.plist and it starts working well.

Try disable audio and see if you get a clear display output on 2nd screen/HDMI.

@danperks
Copy link

@RobyRew By clear display output, do you mean the bottom screen works? Or is just black with working HDMI?

If your screen works, what model you have and if possible, post your EFI, as I'm sure some of the smarter people are going to want it 😂

@Maleficent-Magik
Copy link

It is quite interesting this track because it seems to me that we have never studied it, however, I would like to know why the audio would cause this bug?

What would be the relation between AppleALC & WhatEverGreen / Graphics of MacOS?

Thanks for your help :) it's always nice to have someone help.

(For the moment I'm in exam period, so I'll avoid to modify some things, I'll resume in a few weeks some tests)

@Qonfused
Copy link
Owner Author

This would suggest a bug with how external display sinks are handled with audio, but from what I can observe, disabling or changing audio w/ AppleALC doesn't have an effect on this specific issue.

A couple of internal display (connector) flags have been found to cause similar behavior with disabling external display audio + rotation.

--- @Qonfused acidanthera/bugtracker#2243 (comment) ---
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.

@RobyRew Have you noticed behavior similar to my issue here (acidanthera/bugtracker#2243)? I was previously unaware of any behavior affecting HDMI devices.

@Qonfused Qonfused changed the title Investigate 'Garbled ScreenPad Plus screen' [Kernel/FB] ScreenPad display static on FB initialization Apr 23, 2023
@Maleficent-Magik
Copy link

Maleficent-Magik commented May 1, 2023

Okay, I haven't totally finished my exams yet, but I think we should downgrade MacOS, and work on Catalina instead, indeed, according to Cobo, WhatEverGreen is harder to patch in terms of connector or Framebuffer...

Especially as of Monterey - seems the iGPU fb kexts are a lot pickier than before, and mismatched connector types can often lead to black screen/no display
Cobo,
Discord Link

I'm going to try various things soon, I'll tell you more soon :)

@Maleficent-Magik

This comment was marked as off-topic.

@Maleficent-Magik

This comment was marked as off-topic.

@Qonfused
Copy link
Owner Author

I pitched an idea to patch out HDCP initialization in the driver when I was talking to theroadw here a couple of weeks ago. Still, it seemed like he was guessing and may not actually be familiar with framebuffer behavior, so I can't vouch for the accuracy of his comments.

On another note, I recently saw that the screenpad behavior initially seen from @danperks (ref) is reproducible on the (9th gen) UX581GV as well. This was already suspected although the video below (provided by @ooohlalaa) appears to be the first to confirm this:

UX581GV.mov

I'm curious as to why this still doesn't consistently obscure the whole screen like on the UX481; there also seems to be a crop where the most salient behavior occurs.

To me, this would seem like an issue with the horizontal sync width of the display; it's probably easiest to test EDID differences by injecting a display EDID from a known working UX582LV into one of the affected UX581GV/UX581LV models. While they use the same BOE085F panel, they have reported three distinct EDID profiles with different checksums.

To aid this effort, I've created a repo for the UX581GV/UX581LV on parity with this project's changes. It should eventually be upstreamed here to the original UX582 project, and hopefully eliminate any configuration-specific issues.

@Maleficent-Magik
Copy link

I doubt Sonoma will fix the Screenpad bug...

@Qonfused
Copy link
Owner Author

Qonfused commented Jun 6, 2023

Haven't seen any notable changes for Sonoma. KabyLake and up are still supported, so presumably none of the graphics stack should have changed.

@shiecldk
Copy link
Contributor

shiecldk commented Jun 16, 2023

Not sure if this could be helpful but this is the EDID from my UX582. (Generated by SwitchResX.app)
ScreenPad.txt

Also, I need to use https://github.com/xzhih/one-key-hidpi to enable HiDPI in macOS Ventura and use either RDM (https://github.com/avibrazil/RDM) or SwitchResX to switch to the HiDPI resolutions on ScreenPad. However, the only workable HiDPI resolutions are 2560x733 2048x587. The native resolution is 3820x1100. Before macOS Ventura, 1920x550 (HiDPI) worked well but now it does not work.

@Qonfused
Copy link
Owner Author

The main differences I can see is that your display reports power management features; oddly my EDID has some redundant ASCII descriptors.

Screenpad Plus.txt

I'd look into creating some custom resolutions with a display override; for HiDPI, you'd only need a 1920x550 and a 3820x1100 scale resolution to get 1920x550 HiDPI. Not sure why that's happening for you as you have both resolutions in your EDID's preferred timings (which should be respected).

@Qonfused
Copy link
Owner Author

I removed the additional ASCII fields and injected the modified EDID, but it seems that was not problematic.

Will provide it for reference as a good sanity check for EDID:

BOE-087F.bin.zip

# config.yml - ScreenPad BOE087F EDID injection
DeviceProperties:
  Add:
    PciRoot(0x0)/Pci(0x2,0x0):
      AAPL01,override-no-connect: Data | <00FFFFFFFFFFFF0009E5752100000000011D0104A51F0878E4D22D9351578D28184E5200000001010101010101010101010101010101941B80A0700332203020550035531000001A121680A0700332203020550035531000001A0000000000000000000000000000000000000000000000000000000000000000000000000031>

@Qonfused
Copy link
Owner Author

Qonfused commented Jul 16, 2023

Will have to look into the i915 UEFI driver for Intel iGPUs:
https://github.com/patmagauran/i915ovmfPkg

(context: https://www.reddit.com/r/VFIO/comments/innriq/successful_macos_catalina_with_intel_gvtg/)

Came across it when discussing SR-IOV/passthrough support for macOS: https://discord.com/channels/186648463541272576/1057375050031968276/1129991118986166303

Makes a lot of sense to test with standard kernel debugging tools in a virtual machine, but so far the main challenge has been interfacing with the hardware directly.

Repository owner deleted a comment Sep 22, 2023
@alextipu
Copy link

any updates on this problem?

@Qonfused
Copy link
Owner Author

Nothing conclusive yet; unfortunately this issue has grown stale since my last update. It's hard to narrow the search path without any feedback from those unaffected by the issue.

It is reproducible when passing through the hardware, and remaining issues with framebuffer initialization are still causing incorrect display data to be sent to the PCH.

@Qonfused
Copy link
Owner Author

Qonfused commented Mar 11, 2024

I was able to get the screenpad plus working for a decent bit after toggling the connector during boot (without hot-plug interrupts).

IMG_1533

I did notice that the display still continued to work after toggling connector power a few times after the fact, but reverted after sleep (which forces hot-plug despite the device property).

Here's a video showing roughly how to reproduce this; notice the timing of the last toggle:

trim.7257200D-3F14-4CA5-848E-598FB77C310A.MOV

At the time I was experimenting with the below device properties:

# Disables hot-plug events for the display
AAPL01,no-hotplug-interrupt | Data | 01000000
# 0x100 flag - Enables power well 2 (PW2) usage
framebuffer-con0-alldata | Data | 00000800 02000000 98010000
framebuffer-con0-enable  | Data | 01000000

What I figure is of the most relevance is the enabled usage of PW2 (with the 0x100 connector flag for con0), and diagnostically, disabling hot-plug for con1.

@Qonfused
Copy link
Owner Author

Qonfused commented Mar 11, 2024

Later, I was able to partially reproduce this again when trying to toggle the connector off after seeing static, then enabling again. I only briefly saw the Ventura wallpaper before it switched to black (screen is still detected, though the static is no longer present). However, after wake from sleep, the static was again present.

Here's a video showing how to reproduce that behavior:

311614232-3956efce-2fa0-4b3c-b83f-8e18a46327d4.mov

@Qonfused
Copy link
Owner Author

Qonfused commented Mar 12, 2024

This may still turn out to be hard to reproduce, as so far these are triggered in a rather crude fashion similar to voltage glitching (or ghosting). This also does not persist through sleep, and will revert upon wake. I'll try to attach some more logging, etc below:

boot.log.zip
MacBook Pro.ioreg.zip

What is odd is that the display is detected in IORegistry and System Information, but has no corresponding display settings in System Preferences.

Screenshot 2024-03-11 at 7 11 40 PM (2)

I still need to figure out a consistent method for debugging; I can't imagine any timing-based approach is at all a practical or portable solution.

@Qonfused
Copy link
Owner Author

Qonfused commented Mar 12, 2024

Normally when the screenpad is connected (on HPD assertion), the framebuffer controller first reads the DPCD capabilities from the display sink over the AUX channel. This is used by the driver to determine the lane count, link speed, enhanced framing, etc to be written to the link configuration field through the AUX channel.

These values set the configuration parameters for link training, where the driver starts with the highest transmitter capabilities and finds a configuration the screenpad can support. Before enabling the main link (where the main data feed is sent), the driver will read the screenpad's EDID data to determine supported capabilities (particuarly the preferred resolution and timings).

Curiously, this process seems to possibly have caused phase 1 link training to fail (possibly bypassing AGDC):

2024-03-11 19:01:00.171075-0500 0x341      Default     0x0                  0      0    kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][WARNING] Failed Phase 1 of Link Training
2024-03-11 19:01:00.171085-0500 0x341      Default     0x0                  0      0    kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR  ] Link training failed - notifying AGDC to take display offline
2024-03-11 19:01:00.171088-0500 0x341      Default     0x0                  0      0    kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR  ]  [AGDC] AGDC not registered. Unmanaged display
2024-03-11 19:01:00.171098-0500 0x341      Default     0x0                  0      0    kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][LOG  ][DISPLAY   ] [AGDC] Get stream AUX access read for agdc port 2 stream=0 : address=0x100, size=2
2024-03-11 19:01:00.171105-0500 0x341      Default     0x0                  0      0    kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][LOG  ][DISPLAY   ] FB1 Getting display status
2024-03-11 19:01:00.174207-0500 0x341      Default     0x0                  0      0    kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][LOG  ][DISPLAY   ] HPD is low
2024-03-11 19:01:00.174224-0500 0x341      Default     0x0                  0      0    kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][LOG  ][DISPLAY   ] FB1 Display status is = 0
2024-03-11 19:01:00.174228-0500 0x341      Default     0x0                  0      0    kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR  ] [AGDC] FB1: Port1 not attached. No AUX Access attempted
2024-03-11 19:01:00.174233-0500 0x341      Default     0x0                  0      0    kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR  ] [AGDC] Failed with status e00002bc for stream access aux
2024-03-11 19:01:00.174239-0500 0x341      Default     0x0                  0      0    kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][ERROR  ] Link training failed for port 1
2024-03-11 19:01:00.174275-0500 0x341      Default     0x0                  0      0    kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][LOG  ][DISPLAY   ] [Modeset] Path is marked active
2024-03-11 19:01:00.174283-0500 0x341      Default     0x0                  0      0    kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][LOG  ][DISPLAY   ] hwEnableUnderrunInterrupts: Enabling underrun interrupts
2024-03-11 19:01:00.174287-0500 0x341      Default     0x0                  0      0    kernel: (AppleIntelCFLGraphicsFramebuffer) [IGFB][LOG  ][DISPLAY   ] [Modeset] return 0 at 30902080

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed project:UX481 For variants UX481FA (14", 2019) and UX481FL (14", 2019) project:UX581 For variants UX581GV (15.6", 2019) and UX581LV (15.6", 2020) status:investigating Issue is currently being investigated. type:bug Something isn't working
Projects
Status: In Progress