Contribute
Register

Native Brightness working without 'blinkscreen' using patched AppleBacklight.kext

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,714
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Just tested in now quickly (with tired eyes...) the screen doesn't flicker and it seems to handle it fine... But on the other hand if I out the brightness to the lowest setting I didn't notice the brightness reduction, but it might be just my sleepy eyes... Will test it better tomorrow. But at least it doesn't make my screen freak out.
Interesting.

Do you think that it's possible that just some specific values create that flickery effect (low, but maybe not the lowest the backlight can handle), since you seem to know much more then me about how this backlight is being handled.
Could be. I don't have that issue here at all with either laptop, so can't really say. It would require experimentation using ACPIBacklight.kext and ioio.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,714
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
RehabMan, you say this should work for every laptop with Intel HD 3000, but what about the DSDT patch? From what I've read in the ACPIBacklight topic, the brightness values are laptop dependent. Also, I tried anyway to patch my DSDT but it gives errors on "LEVL" and "LEV2" commands saying they don't exist.
The brightness levels for this technique will generally be the same because of the way OS X expects the backlight control registers to be initialized (range of 0-0x710). I think it will even work on some Haswell systems, provided the laptop does not use eDP (eDP controls are somewhere in the PCH instead of the IGPU).

And the general technique of patching DSDT is the same since the registers to control this hardware function are at the same offsets (they are at fixed offsets from BAR1, which is at fixed offset 0x10 from PCI_config).

The details of your DSDT may be different and that is what might be causing the error. In particular the patches depend on the original PCI_Config being called IGDP, and they depend on the GFX0 device being named IGPU (we rename it other ProBook patches).

Also tried to get my own brightness values in RW-Everything but all I could get was my BAR1 address (0xF0000004), then I summed 0x4824C to it, resulting 0xF0048250, but I can't seem to find anything like that in dword 32-bit mode... Are there some more general instructions so that I could also apply it to my Samsung NP530U3B laptop?
What do you mean 'find anything like that in dword 32-bit mode?' . After you determine the address F0048250, you use Access -> Memory and type in that address as the address of memory to view. Then you should see the values change as you change the brightness.

The problem I'm facing is only related to the max brightness after boot. Brightness after wake is ok, it also changes according to AC/Battery supply, but the 100% value is so dark I can only reasonably work with it in the night...
Yes... exact symptoms that we have. It is because of a difference in the way our laptop BIOS initializes the backlight controls and the way OS X expects them to be initialized (by Mac firmware). The DSDT patch takes care of this difference, initializing it when OS X boots, such that display sleep is not necessary.

If you need help, post your DSDT...
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,714
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
You`re very kind, sir. So far I`ve managed to do so many things on my own but it seems right now I`m just exhausted...
I have attempted to such details (GFX0 and other device names), but anyway I can`t deal with all the differences. Sorry for that.
If that really won`t bother you, I`m attaching here my pure DSDT and also my patched DSDT (the one I`m using right now). Both of them successfully boot my laptop but the patched one includes all fixes for Sandy Bridge so probably there would be something wrong with the pure one that I didn`t have the time to notice :p
If you apply the "Rename GFX0 to IGPU" from here: https://github.com/RehabMan/Laptop-DSDT-Patch, then follow the instructions in post #1, this technique should work for you.

Eventually, I'll make these patches available in the main laptop repo as well as in the ProBook repo (as they are now). For now, use both repos.

edit: ok I managed to get the brightness values in Windows.
0x111
0x1C7
0x27D
0x3FD
0x67B
0xAAF
0xE1A
0x122A
You don't really need to know this data for this method. The whole idea here is to use an OS X friendly range (0-0x710) instead of the laptop's native range. The values you have above are useful for the ACPIBacklight.kext+DSDT patch method as covered in the related thread. Although it is good to know that the values at BAR1+4824c are being used and correspond in Windows.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,714
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Ok, I`ve successfully patched my DSDT (GFX0 -> IGPU, and then Brightness patch), compilation went fine and I could boot with it without problems.
Then I followed the instructions for patching AppleBacklight. Two files were created inside ˜patched˜ folder: AppleBacklight.kext and AppleBacklightInjector. Then I installed only AppleBacklightInjector via Kext Utility and rebooted, nothing changed and in kextstat, this kext does not appear.
I went to Terminal to try something more manual:
Code:
[FONT=Menlo]sh-3.2# cd /System/Library/Extensions/[/FONT]
[FONT=Menlo]sh-3.2# chown -R 0:0 *[/FONT]
[FONT=Menlo]sh-3.2# chmod -R 755 *[/FONT]
[FONT=Menlo]sh-3.2# kextload AppleBacklightInjector.kext[/FONT]
[FONT=Menlo]/System/Library/Extensions/AppleBacklightInjector.kext failed to load - (libkern/kext) validation failure (plist/executable); check the system/kernel logs for errors or try kextutil(8).[/FONT]
[FONT=Menlo]sh-3.2# kextutil AppleBacklightInjector.kext[/FONT]
[FONT=Menlo]/System/Library/Extensions/AppleBacklightInjector.kext is invalid; can't resolve dependencies.[/FONT]
[FONT=Menlo]/System/Library/Extensions/AppleBacklightInjector.kext is invalid; can't resolve dependencies.[/FONT]
[FONT=Menlo]/System/Library/Extensions/AppleBacklightInjector.kext is invalid; can't resolve dependencies.[/FONT]
[FONT=Menlo]Diagnostics for /System/Library/Extensions/AppleBacklightInjector.kext:[/FONT]
[FONT=Menlo]Validation Failures: [/FONT]
[FONT=Menlo]    Kext has a CFBundleExecutable property but the executable can't be found: [/FONT]
[FONT=Menlo]        AppleBacklight[/FONT]
[FONT=Menlo]    Info dictionary missing required property/value: [/FONT]
[FONT=Menlo]        OSBundleLibraries[/FONT]
[FONT=Menlo]
[/FONT]
[FONT=Menlo]Warnings: [/FONT]
[FONT=Menlo]    Personality CFBundleIdentifier differs from containing kext's (not necessarily a mistake, but rarely done): [/FONT]
[FONT=Menlo]        AppleIntelPanelA[/FONT]
[FONT=Menlo]
[/FONT]
[FONT=Menlo]Code Signing Failure: not code signed[/FONT]


Also tried renaming the CFBundleExecutable to AppleBacklightInjector but didn`t work. Any ideas?
Attaching here my DSDT after this thread`s patches and the AppleBacklightInjector.kext generated by script.
Read the instructions in post #1. You must repair permissions & rebuild cache.

Check your ioreg in IORegistryExplorer. What do you see under PNLF.AppleIntelPanelA.Apple Panel?

See here: http://www.tonymacx86.com/audio/58368-guide-how-make-copy-ioreg.html
 
Joined
Nov 24, 2012
Messages
639
Motherboard
HP Probook 6470b
CPU
Intel Core i5-3320M
Graphics
Intel HD 4000, 1600x900
Mac
Classic Mac
Mobile Phone
Interesting.

Could be. I don't have that issue here at all with either laptop, so can't really say. It would require experimentation using ACPIBacklight.kext and ioio.
Where do you read that "11" value? It is "hardcoded" in the driver?

I can conform that the dimmed screen isn't and darker then my lowest brightness... At-least nothing noticeable.
I tested by putting the value to the 2nd lowest waited for the dimming to occur and then lowered to the lowest brightness level and the brightness doesn't change in a noticeable way.
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,714
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Where do you read that "11" value? It is "hardcoded" in the driver?
First 16-bits of the data.

I can conform that the dimmed screen isn't and darker then my lowest brightness... At-least nothing noticeable.
I tested by putting the value to the 2nd lowest waited for the dimming to occur and then lowered to the lowest brightness level and the brightness doesn't change in a noticeable way.
Best to look at ioreg to see what ApplePanelRawBrightness is being set to...
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,714
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
FYI: I have discovered the secret to Haswell Intel Graphics backlight. At least on my Envy...

Now to determine how to package this in some patches in the laptop repo...
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,714
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
Don`t worry, I`ve read the instructions. Kext Utility repairs permissions and rebuilds cache automatically, but I did it on my own when I saw it was not working, anyway this was not the cause of the problem. ioreg -l gives this:
Code:
[FONT=Menlo]    | +-o PNLF@0  <class IOACPIPlatformDevice, id 0x1000001a4, registered, matc$[/FONT][FONT=Menlo]    | | | {[/FONT]
[FONT=Menlo]    | | |   "acpi-path" = "IOACPIPlane:/_SB/PNLF@0"[/FONT]
[FONT=Menlo]    | | |   "compatible" = <"backlight">[/FONT]
[FONT=Menlo]    | | |   "AppleBacklightAtBoot" = 1808[/FONT]
[FONT=Menlo]    | | |   "AppleMaxBrightness" = 1808[/FONT]
[FONT=Menlo]    | | |   "_UID" = "10"[/FONT]
[FONT=Menlo]    | | |   "device-properties" = {"acpi-device"="IOACPIPlatformDevice is not s$[/FONT]
[FONT=Menlo]    | | |   "ApplePanelRawBrightness" = 1808[/FONT]
[FONT=Menlo]    | | |   "_STA" = 11[/FONT]
[FONT=Menlo]    | | |   "acpi-device" = "IOACPIPlatformDevice is not serializable"[/FONT]
[FONT=Menlo]    | | |   "_ADR" = 0[/FONT]
[FONT=Menlo]    | | |   "name" = <"APP0002">[/FONT]
[FONT=Menlo]    | | | }[/FONT]
[FONT=Menlo]    | | | [/FONT]
[FONT=Menlo]    | | +-o AppleIntelPanelA  <class AppleIntelPanelA, id 0x10000029f, !registe$[/FONT]
[FONT=Menlo]    | |     {[/FONT]
[FONT=Menlo]    | |       "IOProbeScore" = 2500[/FONT]
[FONT=Menlo]    | |       "CFBundleIdentifier" = "com.apple.driver.AppleBacklight"[/FONT]
[FONT=Menlo]    | |       "IOMatchCategory" = "IODisplayParameters"[/FONT]
[FONT=Menlo]    | |       "IOClass" = "AppleIntelPanelA"[/FONT]
[FONT=Menlo]    | |       "IOProviderClass" = "IOACPIPlatformDevice"[/FONT]
[FONT=Menlo]    | |       "IOPersonalityPublisher" = "org.rehabman.driver.AppleBacklightInj$[/FONT]
[FONT=Menlo]    | |       "IONameMatch" = "backlight"[/FONT]
[FONT=Menlo]    | |       "IONameMatched" = "backlight"[/FONT]
[FONT=Menlo]    | |       "IODisplayParameters" = {"brightness"={"max"=255,"min"=40},"commi$[/FONT]
[FONT=Menlo]    | |       "ApplePanel" = {"F10T0200"=<00110000003400520073009400be00fa01360$[/FONT]
[FONT=Menlo]    | |     }[/FONT]
And here attached the iORegistryExplorer file.
According to your ioreg, everything is working.

FYI: You should not expect AppleBacklightInjector.kext to show in kextstat. It is an injector (codeless kext in Apple's terms).
 
Joined
Nov 24, 2012
Messages
639
Motherboard
HP Probook 6470b
CPU
Intel Core i5-3320M
Graphics
Intel HD 4000, 1600x900
Mac
Classic Mac
Mobile Phone
Best to look at ioreg to see what ApplePanelRawBrightness is being set to...
I was doing that too, but the data doesn't refresh fast enough, am I missing something?
 

RehabMan

Moderator
Joined
May 3, 2012
Messages
191,714
Motherboard
Intel DH67BL
CPU
Core i7-2600K
Graphics
Intel HD 3000
Mac
MacBook Air
Mobile Phone
iOS
I was doing that too, but the data doesn't refresh fast enough, am I missing something?
Set IORegistryExplorer to update every second, instead of every 30.
 
Top