acidanthera / bugtracker

Acidanthera Bugtracker
382 stars 44 forks source link

Black screen after logon on 10.15.4 #783

Closed Linaro1985 closed 4 years ago

Linaro1985 commented 4 years ago

Hi. Today I updated OS from 10.15.3 to 10.15.4. I got blank screen after logon (tonymacx86 thread, tonymacx86 thread 2). How it looks by steps: 1) System boots as usual 2) Showing desktop 3) Monitor switching to blackscreen

Only hdmi cable reconnecting helps in this situation.

System configuration:

Video configuration:

<key>PciRoot(0x0)/Pci(0x2,0x0)</key>
<dict>
<key>AAPL,ig-platform-id</key>
<data>BwCbPg==</data>
<key>device-id</key>
<data>mz4AAA==</data>
<key>enable-hdmi20</key>
<data>AQAAAA==</data>
<key>framebuffer-con0-busid</key>
<data>AQAAAA==</data>
<key>framebuffer-con0-enable</key>
<data>AQAAAA==</data>
<key>framebuffer-con0-type</key>
<data>AAgAAA==</data>
<key>framebuffer-con1-busid</key>
<data>AgAAAA==</data>
<key>framebuffer-con1-enable</key>
<data>AQAAAA==</data>
<key>framebuffer-con1-type</key>
<data>AAgAAA==</data>
<key>framebuffer-con2-enable</key>
<data>AQAAAA==</data>
<key>framebuffer-con2-type</key>
<data>AAgAAA==</data>
<key>framebuffer-patch-enable</key>
<data>AQAAAA==</data>
</dict>

The monitor is connected to the first port.

P.S. No-hda-gfx for AppleALC doesn't help.

pavelchup commented 4 years ago

I have Gigabyte B360M HD3, Core i3-8100, Intel UHD 630 The same problem with 10.15.4, reconnect hdmi cable solves the problem, until next boot, this is my patch: Снимок экрана 2020-03-25 в 21 40 17

aaronjohns123 commented 4 years ago

I have a problem with the UHD 630 on 10.15.4 with regards to waking the display up from sleep. Everything worked fine on 10.15.3. I use a Dell Optiplex 3070 micro desktop with an Intel i5 9500T. Unplugging and plugging back the HDMI cord makes monitor work again.

Partial Fix: May or may not work for some

Since I use the iMac 19,1 smbios, I had to trick the system into believing that it has an internal display and it partially fixed the problem. Now it wakes up most of the times, but the display sometimes wakes up with a pink hue to it. If you do get a pink hue, turn the monitor off and on. At least now we know that it could be an EDID issue. This patch below needs to be added to the device section.

<key>PciRoot(0x0)/Pci(0x2,0x0)</key>
            <dict>
                <key>AAPL,ig-platform-id</key>
                <data>BwCbPg==</data>
                <key>AAPL,slot-name</key>
                <string>Internal@0,2,0</string>

                <key>AAPL00,override-no-connect</key>
                <data>
                EDID data generated from the hackintool comes here.
                </data>

                ..

                </dict>

Note: This solution is only for Desktop PC's.

j4m13c0 commented 4 years ago

I have the HD 615 Kaby Lake GPU and have the exact same issues. Everything was perfect and as soon as I updated to 10.15.4, the HDMI will display after boot for a few seconds and then disconnect. If I re-insert the HDMI, it works until it sleeps. I have Screen Sharing on mine and this is what the Display Settings looks like.

I am using Lilu and WhateverGreen. I had been using Clover and have tried OpenCore both give the same issues.

Screenshot 2020-03-27 at 06 57 36 Screenshot 2020-03-27 at 06 57 57
vit9696 commented 4 years ago

Does trying agdpmod values change anything? E.g. agdpmod=vit9696,pikera, agpdmod=vit9696, agdpmod=pikera? By default agdpmod is not enabled for IGPU-only setups.

Also, did you try disabling HDR in Screen preferences in macOS? It causes weird glitches for me on AMD GPU.

Linaro1985 commented 4 years ago

Does trying agdpmod values change anything? E.g. agdpmod=vit9696,pikera, agpdmod=vit9696, agdpmod=pikera? By default agdpmod is not enabled for IGPU-only setups.

Also, did you try disabling HDR in Screen preferences in macOS? It causes weird glitches for me on AMD GPU.

Ok. I tested different variants. 1) agdpmod=vit9696,pikera or agpdmod=vit9696 produce same results. Now desktop successfully booting and no blackscreen. But sleep does not work. HDMI cable must be replugged after sleep. 2) agdpmod=pikera does not change anything

I made dmesg after sleep (when wake up is failed). A suspicious message about DP port power management could be found in it. dmesg.txt

vit9696 commented 4 years ago

Check HDR in screen preferences. You may need to disable it for sleep to work.

Also, please upgrade to WEG 1.3.8 (build from master) and add igfxfw=2 boot argument. I am not sure whether it will change anything, so recheck igfxfw=2 with and without all kinds of agdpmod arguments and HDR preferences. Perhaps something will work for you.

j4m13c0 commented 4 years ago

Thank you for the information viy9696

Using agdpmod=vit9696 works for first boot up, the screen no longer turns off. However when I sleep I cannot get the display to wake up, it does work after I unplug and plug back in the HDMI. 
I have compiled the latest version of Lilu and WhateverGreen from GitHub master. When I use igfxfw=2 with or without the agpdmod I get stuck at boot “Hash data from ME never returned, status = 1, doing retry. I then get a kernel panic.

This is the results I get.

WhateverGreen Release 1.37 - Lilu 1.4.2 -v -Display needs HDMI replug after Boot and Sleep -v agdpmod=vit9696 - Display works at boot, HDMI replug after sleep needed. -v agdpmod=vit9696,pikera - Display works at boot, HDMI replug after sleep needed.

WhateverGreen Master 1.3.8 - Lilu 1.4.3 -v -Display needs HDMI replug after Boot and Sleep -v agdpmod=vit9696 - Display needs HDMI replug after Boot and Sleep -v agdpmod=vit9696,pikera - Display works at boot, HDMI replug after sleep needed. -v igfxfw=2 - stuck at boot “Hash data from ME never returned, status = 1, doing retry. I then get a kernel panic. -v igfxfw=2 agdpmod=vit9696,pikera - stuck at boot “Hash data from ME never returned, status = 1, doing retry. I then get a kernel panic.

Linaro1985 commented 4 years ago

Check HDR in screen preferences. You may need to disable it for sleep to work.

I haven't HDR setting for my monitor screen

Also, please upgrade to WEG 1.3.8 (build from master) and add igfxfw=2 boot argument. I am not sure whether it will change anything, so recheck igfxfw=2 with and without all kinds of agdpmod arguments and HDR preferences. Perhaps something will work for you.

hackintool

I tested theze advices. Sleep still doesn't work.

P. S. WhateverGreen 1.3.4 contain patches related AppleGraphicsDevicePolicy and some time ago I saw commits for double route ( I don’t remember exactly where). Maybe this have connection with this issue?

System restart video: https://youtu.be/cCisx5EFPSM . Note: there is no dock on the screen while reboot before I made an update to 10.15.4. Maybe it helps to clarify something.

j4m13c0 commented 4 years ago

Linaro1985, I have attached the compiled master of 1.3.8 and 1.4.3. Please remember, this is for testing and you will need to update to the official release when it is released.

Lilu-1.4.3-RELEASE BETA.zip WhateverGreen-1.3.8-RELEASE BETA.zip

Linaro1985 commented 4 years ago

I have attached the compiled master of 1.3.8 and 1.4.3.

Thanks! But @vit9696 wrote update only WEG to 1.3.8. Just in case I rebuilt on my own Lilu and WhateverGreen via XCode without using hackintool. Nothing changed. Снимок экрана 2020-03-27 в 11 48 09

vit9696 commented 4 years ago

Lilu is irrelevant here, as only irrelevant changes happened there. I guess for the time being CFL+ IGPU-only sleep will also be broken, just as it is broken on SKL and KBL.

pavelchup commented 4 years ago

I can confirm that with agdpmod=vit9696 bootarg this issue is gone, but not after waking from sleep!

vit9696 commented 4 years ago

Actually try replacing graphics kernel extensions from 10.15.3 or 10.15.4 betas in 10.15.4. For example, AppleIntelKBLGraphics.kext or AppleIntelKBLFramebuffer.kext. See for more by invoking kextstat in terminal. If you manage to find the relevant kexts, upload current and working ones. The less difference the better, i.e. try to find a pair of beta kexts if possible.

Sher1ocks commented 4 years ago

Actually try replacing graphics kernel extensions from 10.15.3 or 10.15.4 betas in 10.15.4. For example, AppleIntelKBLGraphics.kext or AppleIntelKBLFramebuffer.kext. See for more by invoking kextstat in terminal. If you manage to find the relevant kexts, upload current and working ones. The less difference the better, i.e. try to find a pair of beta kexts if possible.

hi vit i have a same issue on my laptop iGPU 520 of skylake mobile.

AppleGraphicsControl.kext -> no effect. not relate AppleIntelSKLGraphics.kext -> replace AppleIntelSKLGraphicsFramebuffer.kext -> replace AppleIntelSKLGraphicsGLDriver.bundle AppleIntelSKLGraphicsMTLDriver.bundle AppleIntelSKLGraphicsVADriver.bundle AppleIntelSKLGraphicsVAME.bundle

replace AppleIntelSKLGraphics.kext and AppleIntelSKLGraphicsFramebuffer.kext of 10.15.3 normal boot show panic. but enter safe mode, i can get hdmi without replug hdmi cable. just always connected hdmi cable

Sher1ocks commented 4 years ago

Okay. i can get connected hdmi now this files after boot with flicker 2time and get hdmi. it's summary

AppleGraphicsControl.kext -> 10.15.4 AppleIntelSKLGraphics.kext -> 10.15.4 AppleIntelSKLGraphicsFramebuffer.kext -> 10.15.3 AppleIntelSKLGraphicsGLDriver.bundle -> 10.15.4 AppleIntelSKLGraphicsMTLDriver.bundle -> 10.15.4 AppleIntelSKLGraphicsVADriver.bundle -> 10.15.4 AppleIntelSKLGraphicsVAME.bundle -> 10.15.4

decompile SKLGraphicsFramebuffer.zip attached decompile frambuffer file both 10.15.3 and 10.15.4

aaronjohns123 commented 4 years ago

I noticed that the sleep mode makes the HDMI ports go into a state of getting disconnected from the system. The system does not repoll for the display. Hence the display is blank.

I did find a temporary solution to the problem, but it breaks audio over HDMI.

I used the Hackintool for generating a patch for the Framebuffer. While patching the Framebuffer, I enabled the CNConnectorAlwaysConnected flag for both connectors on my PC i.e. HDMI and Display Port. I know that this flag is used on a laptop system, but it works on a desktop system. Now my display wakes up in a jiffy. Looks like if we patch the Framebuffer correctly, we can fix this problem once and for all.

cnconnector

pavelchup commented 4 years ago

I noticed that the sleep mode makes the HDMI ports go into a state of getting disconnected from the system. The system does not repoll for the display. Hence the display is blank.

I did find a temporary solution to the problem, but it breaks audio over HDMI.

I used the Hackintool for generating a patch for the Framebuffer. While patching the Framebuffer, I enabled the CNConnectorAlwaysConnected flag for both connectors on my PC i.e. HDMI and Display Port. I know that this flag is used on a laptop system, but it works on a desktop system. Now my display wakes up in a jiffy. Looks like if we patch the Framebuffer correctly, we can fix this problem once and for all.

Confirm, HDMI works after sleep with new patch (framebuffer-con2-flags)...but display become internal and port-number (in ioreg) changed from 0x7 to 0x0 Снимок экрана 2020-03-27 в 21 58 11

vit9696 commented 4 years ago

@Sher1ocks, thx, that's helpful. Do I understand correctly that after installing AppleIntelSKLGraphicsFramebuffer.kext from 10.15.3 you do not need any patches / agdpmod arguments, right? It works basically as before?

Can more people check if using KBL/CFL framebuffer from 10.15.3 works on 10.15.4 without any AGDC patches or any hacks? 10.15.3-framebuffers.zip

It will be interesting to see the dmesg log from them, like here: https://github.com/acidanthera/bugtracker/issues/783#issuecomment-604820907

vit9696 commented 4 years ago

@aaronjohns123, I think the issue is that AppleIntelFramebufferController::SetDPPowerState timeouts as shown in the log in https://github.com/acidanthera/bugtracker/issues/783#issuecomment-604820907. Therefore marking the framebuffer as always connected will work fine. Does it work for you even if you remove agdpmod boot argument?

Sher1ocks commented 4 years ago

@Sher1ocks, thx, that's helpful. Do I understand correctly that after installing AppleIntelSKLGraphicsFramebuffer.kext from 10.15.3 you do not need any patches / agdpmod arguments, right? It works basically as before?

Can more people check if using KBL/CFL framebuffer from 10.15.3 works on 10.15.4 without any AGDC patches or any hacks? 10.15.3-framebuffers.zip

It will be interesting to see the dmesg log from them, like here: #783 (comment)

SMBIOS: MacbookPro13,1 gdpmod arguments(AGDC patches): No My Framebuffer Patch: 스크린샷 2020-03-28 오후 7 03 31

con0: LVDS = laptop internal con1: HDMI = Monitor

i'm using framebuffer 10.15.3, wakeup no problem. after wakeup, chrome strangely get black screen Basically, it's back like 10.15.3. i never get anyproblem on 10.15.3

vit9696 commented 4 years ago

Mhm.

Log request with 10.15.3 framebuffer is still valid (https://github.com/acidanthera/bugtracker/issues/783#issuecomment-605421466).

Could anyone also test this WEG with 10.15.4 framebuffer (and no AGDC/new framebuffer patches)? I additionally added force success from SetDPPowerState. WhateverGreen-1.3.8-DEBUG-t1.zip Logs will help a lot.

Sher1ocks commented 4 years ago

Mhm.

Log request with 10.15.3 framebuffer is still valid (#783 (comment)).

Could anyone also test this WEG with 10.15.4 framebuffer (and no AGDC/new framebuffer patches)? I additionally added force success from SetDPPowerState. WhateverGreen-1.3.8-DEBUG-t1.zip Logs will help a lot.

okay test it now.

Sher1ocks commented 4 years ago

Mhm.

Log request with 10.15.3 framebuffer is still valid (#783 (comment)).

Could anyone also test this WEG with 10.15.4 framebuffer (and no AGDC/new framebuffer patches)? I additionally added force success from SetDPPowerState. WhateverGreen-1.3.8-DEBUG-t1.zip Logs will help a lot.

here is log still black screen log.txt

vit9696 commented 4 years ago

Could you also provide dmesg (e.g. via ssh)?

pavelchup commented 4 years ago

@aaronjohns123, I think the issue is that AppleIntelFramebufferController::SetDPPowerState timeouts as shown in the log in #783 (comment). Therefore marking the framebuffer as always connected will work fine. Does it work for you even if you remove agdpmod boot argument?

i removed agdpmod=vit9696, and booted ok

vit9696 commented 4 years ago

@pavelchup @Sher1ocks Hmmm, interesting. Now I wonder what can actually interfere here. Could you also try with gfxrst=4 boot argument (and the original WEG, no new patches, no AGDC arguments)?

aaronjohns123 commented 4 years ago

@aaronjohns123, I think the issue is that AppleIntelFramebufferController::SetDPPowerState timeouts as shown in the log in #783 (comment). Therefore marking the framebuffer as always connected will work fine. Does it work for you even if you remove agdpmod boot argument?

@vit9696, It does work without the agdpmod boot argument.

Sher1ocks commented 4 years ago

Could you also provide dmesg (e.g. via ssh)?

dmesg.txt here is dmesg

pavelchup commented 4 years ago

@pavelchup @Sher1ocks Hmmm, interesting. Now I wonder what can actually interfere here. Could you also try with gfxrst=4 boot argument (and the original WEG, no new patches, no AGDC arguments)?

Black Screen

Sher1ocks commented 4 years ago

@pavelchup @Sher1ocks Hmmm, interesting. Now I wonder what can actually interfere here. Could you also try with gfxrst=4 boot argument (and the original WEG, no new patches, no AGDC arguments)?

booted with only LVDS screen. WEG: original patch: only framebuffer patch. AGDC: no here is dmesg dmesg1.txt

aaronjohns123 commented 4 years ago

@pavelchup @Sher1ocks Hmmm, interesting. Now I wonder what can actually interfere here. Could you also try with gfxrst=4 boot argument (and the original WEG, no new patches, no AGDC arguments)?

Removed the display patches. Booted with argument gfxrst=4. Black Screen after wake up.

vit9696 commented 4 years ago

Mhm. There is some new code added that looks suspicious, could you check whether it is invoked by adding the following patch to your framebuffer kext:

Base: __ZN21AppleIntelFramebuffer33CheckandWaitforpendingTransactionEv Find: Replace: <0F 0B>

It should panic in case it triggers.

Also, do I understand correctly that we have the following situation:

Sher1ocks commented 4 years ago

Mhm. There is some new code added that looks suspicious, could you check whether it is invoked by adding the following patch to your framebuffer kext:

Base: __ZN21AppleIntelFramebuffer33CheckandWaitforpendingTransactionEv Find: Replace: <0F 0B>

It should panic in case it triggers.

Also, do I understand correctly that we have the following situation:

  • SKL+ laptops and desktops with just the IGPU
  • Internal display works if it exists
  • External display connected via HDMI does not work (neither at boot, nor at wake)

oh sorry. my laptop still use CLOVER. because of just patched dsdt(battery). i need binary patch

pavelchup commented 4 years ago

Mhm. There is some new code added that looks suspicious, could you check whether it is invoked by adding the following patch to your framebuffer kext:

Base: __ZN21AppleIntelFramebuffer33CheckandWaitforpendingTransactionEv Find: Replace: <0F 0B>

It should panic in case it triggers.

Also, do I understand correctly that we have the following situation:

  • SKL+ laptops and desktops with just the IGPU
  • Internal display works if it exists
  • External display connected via HDMI does not work (neither at boot, nor at wake)

Right, HDMI works only after unplug and plug the cable

vit9696 commented 4 years ago

Other than the patch above please also test WhateverGreen-1.3.8-DEBUG-t2.zip, the same way as t1. Will need logs.

Sher1ocks commented 4 years ago

Other than the patch above please also test WhateverGreen-1.3.8-DEBUG-t2.zip, the same way as t1. Will need logs.

here is log log.txt log2.txt

booted with only LVDS screen. WEG: t2 patch: only framebuffer patch. AGDC: no

aaronjohns123 commented 4 years ago

Other than the patch above please also test WhateverGreen-1.3.8-DEBUG-t2.zip, the same way as t1. Will need logs.

Your new patched version of the kext fixed the problem. Now my display wakes up from sleep without any issues.

dmesg.txt

vit9696 commented 4 years ago

@aaronjohns123 so, I forced pretending that we have the display connected when the driver believes it is not. That's kind of way too dirty, but needs thought on how to fix it.

@Sher1ocks do you mean that HDMI still does not work for you with this version? I think the issue may be in your framebuffer patch.

pavelchup commented 4 years ago

Other than the patch above please also test WhateverGreen-1.3.8-DEBUG-t2.zip, the same way as t1. Will need logs.

Confirm, booted ok with WhateverGreen-1.3.8-DEBUG-t2.zip

HDMI work at boot and after sleep

vit9696 commented 4 years ago

Ok, I will need to think of how to address it, as t2 version is really dangerous. Perhaps we will have an option to configure this via device properties. I will post more tests here.

vit9696 commented 4 years ago

in the meanwhile could you provide ioregs via IORegistryExplorer?

pavelchup commented 4 years ago

Mac mini.zip

aaronjohns123 commented 4 years ago

@aaronjohns123 so, I forced pretending that we have the display connected when the driver believes it is not. That's kind of way too dirty, but needs thought on how to fix it.

@Sher1ocks do you mean that HDMI still does not work for you with this version? I think the issue may be in your framebuffer patch.

This kext works fine on my desktop system. I tested the t2 version of the kext on my laptop and I got a different issue. It has a UHD 620. When I plug in my monitor with the HDMI cord, it does not get detected. I have to restart the system for it to get detected. Hot plugging a display is broken.

hotplug.txt hotplug2.txt sleep.txt ioreg.zip

Sher1ocks commented 4 years ago

@aaronjohns123 so, I forced pretending that we have the display connected when the driver believes it is not. That's kind of way too dirty, but needs thought on how to fix it.

@Sher1ocks do you mean that HDMI still does not work for you with this version? I think the issue may be in your framebuffer patch.

Q.do you mean that HDMI still does not work for you with this version? A.yes

Q. I think the issue may be in your framebuffer patch. A. no. i removed all framebuffer patch. still get black screen. but difference compared t1 has 1 flicker when getting login window. here is log dmesg3.txt log3.txt

booted with only LVDS screen. WEG: t2 patch: no AGDC: no flicker: 1time, both boot and sleep.

vit9696 commented 4 years ago

@Sher1ocks what if you add the following patch:

Base: __ZN31AppleIntelFramebufferController16hwRegsNeedUpdateEP21AppleIntelFramebufferP21AppleIntelDisplayPathPNS_10CRTCParamsE Replace <B8 01 00 00 00 C3>

Does the display start working for you? Do I understand correctly, that HDMI display is plugged in your laptop when you are booting it? You are not hotpluging it?

vit9696 commented 4 years ago

@aaronjohns123 I do not see anything strange for hotplug. Does hotplug work for your Desktop? E.g. if you connect a second display? Also, does your laptop work with the display if you connect it at the start?

aaronjohns123 commented 4 years ago

@aaronjohns123 I do not see anything strange for hotplug. Does hotplug work for your Desktop? E.g. if you connect a second display? Also, does your laptop work with the display if you connect it at the start?

@vit9696, Hot-plugging works for my desktop. But when I disconnect the secondary display, it does not reflect the change in system preferences. I have to manually remove it by clicking the Detect Display button within system preferences.

My display works with my laptop only if I connect it from the start. Detect Display does not work for my laptop.

vit9696 commented 4 years ago

@aaronjohns123 I am really suspicious of the new code in this case. Please try the patch from https://github.com/acidanthera/bugtracker/issues/783#issuecomment-605428365.

aaronjohns123 commented 4 years ago

@aaronjohns123 I am really suspicious of the new code in this case. Please try the patch from #783 (comment).

Ok. But I use Clover for my desktop and laptop. Will try patching the framebuffer kext.

Sher1ocks commented 4 years ago

@Sher1ocks what if you add the following patch:

Base: __ZN31AppleIntelFramebufferController16hwRegsNeedUpdateEP21AppleIntelFramebufferP21AppleIntelDisplayPathPNS_10CRTCParamsE Replace <B8 01 00 00 00 C3>

Does the display start working for you? Do I understand correctly, that HDMI display is plugged in your laptop when you are booting it? You are not hotpluging it?

sorry vit. i'm using clover now on my skylake laptop. i need to find hex for patch.

summary on t2 booted with only LVDS screen. WEG: t2 patch: no AGDC: no flicker: 1time, both boot and sleep. result: black screen on external monitor with connected hdmi cable

boot: always connected hdmi cable(not hotplug, plug an replug) hotplug: after boot, i'm now black screen on external monitor. and unplug cable, and plug it again. still black screen on t2. original weg(not test verison), hotplug is work(unplug and plug, i can get hdmi)