Contribute
Register

[BUG] Black screen 3 minutes after booting, CoffeeLake UHD 630

Joined
Jan 26, 2018
Messages
153
Motherboard
MSI GV62 8RE (HM370)
CPU
i7-8750H
Graphics
UHD630 & GTX1060(non MAXQ) 1920x1080
Mac
MacBook Pro
Looking at the changes on Github I think the issue is fixed. Will test and report. Thanks @headkaze @Fraxul @vit9696

EDIT: Nah! The issue has worsened. After enabling the patches, if backlight fails to turn on you won’t get back the display even if you put your laptop to sleep and wake it up again. Also, the display doesn’t come back up at all. Not even after 3 minutes.

EDIT2: Even if it works in the first stage, backlight never turns back on after sleep. Not in any case.

Regards
Are you talking about the official github (Vit's) or headkaze's fork?

EDIT: I suppose you used the vit's latest build. Did you use the igfxcflbklt=1 and enable-cfl-backlight-fix boot flags as indicated in the readme?
 
Joined
Jul 11, 2014
Messages
438
Motherboard
Asus A555LAB
CPU
i3-4005U
Graphics
HD 4400
Mac
MacBook Air
Mobile Phone
iOS
Vit is going to try something tomorrow so please try again then and let us know how you go.
No backlight after sleep cycle, introduced while fixing this issue, is fixed. If we get the black screen issue during initial boot we can put laptop to sleep and wake it up again to regain the backlight. (Like we could do before)

But, initial timeout during boot is still there (1/4th of the times).

P.S: Please let us know if you observe something different so that we all could stay updated about the same.

EDIT: As pointed out by Vit, we have to ensure that we have a framebuffer without Camellia as it is incompatible. Also, make sure you don't have IntelMaxBacklight set as 120000 in your CLOVER config.plist as it basically overrides the WEG's implementation of the same. Now what is Camellia? I have no idea about it. Just know that Camellia means Core for Ambient and Mobile intELLigent Imaging Applications.

Regards
 
Last edited:
Joined
Jul 11, 2014
Messages
438
Motherboard
Asus A555LAB
CPU
i3-4005U
Graphics
HD 4400
Mac
MacBook Air
Mobile Phone
iOS
Regarding Camellia, I am quoting Vit here:
It is a feature responsible for internal display power management, probably some profile.
You can parse the framebuffers from dumped Intel Framebuffer kext with 010 Editor script (https://github.com/acidanthera/WhateverGreen/blob/master/Manual/IntelFramebuffer.bt).

Another way would be to check our page on applelife (first post, just scroll to CFL graphics):
https://applelife.ru/threads/intel-...4400-4600-5000-5500-5600-520-530-630.1289648/
Look for CameliaDisabled.
P.S: You might want to use google translate for understanding contents of AppleLife's website.

EDIT: Same information is present on tonymacX86 in English at: https://www.tonymacx86.com/threads/guide-intel-framebuffer-patching-using-whatevergreen.256490/

Regards
 
Last edited by a moderator:
Joined
Jul 11, 2014
Messages
438
Motherboard
Asus A555LAB
CPU
i3-4005U
Graphics
HD 4400
Mac
MacBook Air
Mobile Phone
iOS
Update: Tried with a framebuffer that has Camellia disabled(0x3e9b0000) but the issue still remains. But Vit says it is working for @headkaze. We'll have to wait for headkaze to confirm.

By the meantime you folks can test and see if it works for you. I am attaching the latest WEG as of now.

Please make sure:
  • You use a framebuffer that has Camellia disabled.
  • Do not have IntelMaxBacklight set to 120000 in config.plist
  • Use igfxcflbklt=1 boot-arg (without leading dash)
  • Inject enable-cfl-backlight-fix property with value 1 on IGPU.
Regards
 

Attachments

Joined
Dec 8, 2011
Messages
547
Motherboard
Razer Blade 15 - Clover
CPU
i7-8750H
Graphics
UHD 630/GTX 1060 - 1920x1080
Mac
MacBook Pro
Mobile Phone
Android
Update: Tried with a framebuffer that has Camellia disabled(0x3e9b0000) but the issue still remains. But Vit says it is working for @headkaze. We'll have to wait for headkaze to confirm.

By the meantime you folks can test and see if it works for you. I am attaching the latest WEG as of now.

Please make sure:
  • You use a framebuffer that has Camellia disabled.
  • Do not have IntelMaxBacklight set to 120000 in config.plist
  • Use igfxcflbklt=1 boot-arg (without leading dash)
  • Inject enable-cfl-backlight-fix property with value 1 on IGPU.
Regards
Did all as stated. Could not get my laptop to book with the igfxcflbklt=1 bootflag. I got a CFL Framebuffer kernel panic (attached picture of it). But using the other bootflags igfxcflbklt=opcode or igfxcflbklt=wrap allowed me to boot. Both with a black screen, though. So no change to the issue on my end.

PR files attached.
 

Attachments

Joined
Oct 9, 2018
Messages
12
Motherboard
Razer Blade 15" (2018)
CPU
i7-8750
Graphics
UHD 630 + GTX 1070
Mac
Mac Pro
Mobile Phone
iOS
During some unrelated testing I figured out why using Lilu to hook AppleIntelFramebufferController::WriteRegister32 fails (causes seemingly-random kernel panics).

When Lilu routes a function, it writes an absolute jmp to the start of the original function body. This instruction takes (iirc) 9 bytes, so it has to relocate the instructions that would be overwritten to its trampoline memory region. This works fine for most functions, but AppleIntelFramebufferController::WriteRegister32 is compiled with llvm code coverage instrumentation turned on and increments a block-hit counter immediately at start -- within those first 9 bytes. The block-hit counter that it increments is addressed RIP-relative (instruction is inc [rip + 0xwhatever]), so when that instruction gets moved into the trampoline region it's no longer incrementing the counter but some random qword in kernel memory.

This would be fixable either by having WEG NOP out that first inc instruction before routing WriteRegister32, or by patching Lilu to fix RIP-relative displacement on instructions that it moves to the trampoline region. Then we could get away with just hooking WriteRegister32 to fix the backlight frequency register math and avoid the complicated/failure-prone math code patches.
 
Joined
Jun 20, 2014
Messages
1,021
Motherboard
Gigabyte Aero 15X v8-BK4K4P
CPU
i7-8750H
Graphics
UHD 630 / GTX 1070
Did all as stated. Could not get my laptop to book with the igfxcflbklt=1 bootflag.
igfxcflbklt=1 boot flag is the only one that works now.

Vit had a look at your KP (which is actually an assertion) and as you can see it's unrelated to the patch. It's related to DVMT.
kprintf(
"%s",
"/Library/Caches/com.apple.xbs/Sources/GPUDriversIntel/GPUDriversIntel-10.36.22/Common/IONDRV/Intel/CFL/AppleIntelF"
"ramebuffer/AppleIntelController.cpp:27883 Assertion failed: minStolenSize <= fStolenMemorySize \n");
panic(
"assertmsg@/Library/Caches/com.apple.xbs/Sources/GPUDriversIntel/GPUDriversIntel-10.36.22/Common/IONDRV/Intel/CFL/A"
"ppleIntelFramebuffer/AppleIntelController.cpp:27883");
 
Joined
Jul 11, 2014
Messages
438
Motherboard
Asus A555LAB
CPU
i3-4005U
Graphics
HD 4400
Mac
MacBook Air
Mobile Phone
iOS
igfxcflbklt=1 boot flag is the only one that works now.

Vit had a look at your KP (which is actually an assertion) and as you can see it's unrelated to the patch. It's related to DVMT.
So this issue is fixed? Can you suggest me what else to try?

I am currently using the latest WEG from upstream with all the properties and SSDT-PNLF.

I am also making sure that I am using a framebuffer with Camellia disabled (0x3E9B0000)

What else should I try?

P.S: For all those using WEG from post #325, you may remove AppleBacklightFixup.kext as it is now included in WEG. Patching is done automatically, no configuration required.

Regards
 
Joined
Jul 11, 2014
Messages
438
Motherboard
Asus A555LAB
CPU
i3-4005U
Graphics
HD 4400
Mac
MacBook Air
Mobile Phone
iOS
During some unrelated testing I figured out why using Lilu to hook AppleIntelFramebufferController::WriteRegister32 fails (causes seemingly-random kernel panics).

When Lilu routes a function, it writes an absolute jmp to the start of the original function body. This instruction takes (iirc) 9 bytes, so it has to relocate the instructions that would be overwritten to its trampoline memory region. This works fine for most functions, but AppleIntelFramebufferController::WriteRegister32 is compiled with llvm code coverage instrumentation turned on and increments a block-hit counter immediately at start -- within those first 9 bytes. The block-hit counter that it increments is addressed RIP-relative (instruction is inc [rip + 0xwhatever]), so when that instruction gets moved into the trampoline region it's no longer incrementing the counter but some random qword in kernel memory.

This would be fixable either by having WEG NOP out that first inc instruction before routing WriteRegister32, or by patching Lilu to fix RIP-relative displacement on instructions that it moves to the trampoline region. Then we could get away with just hooking WriteRegister32 to fix the backlight frequency register math and avoid the complicated/failure-prone math code patches.
Please have a look at https://github.com/acidanthera/WhateverGreen/pull/11#issuecomment-446362280
 
Top