Contribute
Register

New Brightness kext, IntelBacklight.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
Since 10.11 broke ACPI access to the backlight registers, the new version of ACPIBacklight.kext goes direct to the hardware instead of calling ACPI methods _BQC, _BCM to get/set brightness. It depends on the patch being used (how XOPT is set), of course,... because there are brightness patches that always must go through ACPI. But for the normal patches we use, it will go direct to the hardware when they are detected.

Since ACPI is not really involved (except for configuration), I thought why not have a kext that is specifically for computers (mostly laptops, all-in-ones) using the Intel PWM registers for backlight?

IntelBacklight.kext is the result of stripping out all ACPI code as it relates to manipulating the backlight from ACPIBacklight.kext. And a fair bit of cleanup.

It is available here: https://github.com/RehabMan/OS-X-Intel-Backlight

It uses a new method for configuration, which is described in the README. I'll likely use this new configuration method in other kexts I work on.

For this kext, you can use your existing PNLF patch ("Brightness Fix (HD3000/HD4000)", or "Brightness Fix (Haswell/Broadwell)", or you can just use the simple "Brightness Fix" (which is easier to apply).

Advanced users could also construct an SSDT that has only the PNLF in it.

For example:
Code:
DefinitionBlock ("SSDT-PNLF.aml", "SSDT", 1, "PNLF", "PNLF", 0x00003000)
{
    Scope (_SB)
    {
        Device (PNLF)
        {
            Name (_ADR, Zero)
            Name (_HID, EisaId ("APP0002"))
            Name (_CID, "backlight")
            Name (_UID, 10)
            Name (_STA, 0x0B)
        }
    }
}
//EOF
The SSDT above, is just this boiler-plate empty SSDT with the "Brightness Fix" patch applied to it:
Code:
DefinitionBlock ("SSDT-PNLF.aml", "SSDT", 1, "PNLF", "PNLF", 0x00003000)
{
}
//EOF
Custom configurations are described in the README, as well as download locations. Read it carefully.

As usual, this is new code (v1.0.0), so there could be bugs. I've tested the kext on HD4400 Haswell (my u430), and HD4000 Ivy (my 4540s).

It has a higher IOProbeScore, so it will override ACPIBacklight.kext, but it is best to remove ACPIBacklight.kext when using IntelBacklight.kext.

Note: IntelBacklight.kext uses intel-backlight-level in NVRAM, not acpi-backlight-level, so don't be surprised you lose your backlight level preference on first boot.
 
Joined
Dec 1, 2013
Messages
30
Motherboard
Intel HM175, Clover v4200
CPU
Intel Core i7-7700HQ
Graphics
Intel HD 630, NVIDIA GTX 1050Ti, 1920x1080
Mobile Phone
iOS
Working perfectly on a HP 15-r202nq. RehabMan, all that you've done is exceptional.

Thank you! :)
 
Joined
Aug 15, 2015
Messages
10
CPU
Core i5 4210U
Graphics
HD 4400
Mac
Classic Mac
Mobile Phone
Hi, RehabMan!
Its working is amazing, but i have problem!
After install this kext backlight, brightness saved and restored after reboot and power off, but after reinstall Mac OS X and install this kext, brightness level not restored after reboot, but restored after sleep and wake up!
I use debug version for get info, and see it in journal:
27.09.15 19:36:35,000 kernel[0]: IntelBacklight: no /chosen/nvram, trying IODTNVRAM
27.09.15 19:36:35,000 kernel[0]: IntelBacklight: no intel-backlight-level in nvram
27.09.15 19:36:35,000 kernel[0]: IntelBacklight: loadFromNVRAM returns -1
I have here current intel backlight level: IOService:/AppleACPIPlatformExpert/AppleEFIRuntime/AppleEFINVRAM
Video: Intel HD 4400
CPU: Intel Core i5 4210U
Laptop: Acer Extensa 2510G
Thanks!
 

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
Hi, RehabMan!
Its working is amazing, but i have problem!
After install this kext backlight, brightness saved and restored after reboot and power off, but after reinstall Mac OS X and install this kext, brightness level not restored after reboot, but restored after sleep and wake up!
I use debug version for get info, and see it in journal:
27.09.15 19:36:35,000 kernel[0]: IntelBacklight: no /chosen/nvram, trying IODTNVRAM
27.09.15 19:36:35,000 kernel[0]: IntelBacklight: no intel-backlight-level in nvram
27.09.15 19:36:35,000 kernel[0]: IntelBacklight: loadFromNVRAM returns -1

Video: Intel HD 4400
CPU: Intel Core i5 4210U
Laptop: Acer Extensa 2510G
Thanks!
Your NVRAM is not implemented correctly. If you're using EmuVariableUefi-64.efi, make sure you install RC scripts.
 
Joined
May 12, 2010
Messages
24
Motherboard
GA-X58A-UD7
CPU
Intel Core i7 975
Graphics
ATI Radeon HD 5870
Mac
Classic Mac
Mobile Phone
I'll likely use this new configuration method in other kexts I work on
Hi! Is it possible, if you should write a prefPane for configuration and customization of kexts?

I've tested on Samsung R540 with HD1000 (1-st gen) Arrandale graphics [8086:0046]. It is perfect! I really appreciate your hard work!
 

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
Hi! Is it possible, if you should write a prefPane for configuration and customization of kexts?

I've tested on Samsung R540 with HD1000 (1-st gen) Arrandale graphics [8086:0046]. It is perfect! I really appreciate your hard work!
Which kext? What kind of customizations?

Any preference pane would be specific to the capabilities of the kext and support would have to be built into the kext itself.
 
Joined
May 12, 2010
Messages
24
Motherboard
GA-X58A-UD7
CPU
Intel Core i7 975
Graphics
ATI Radeon HD 5870
Mac
Classic Mac
Mobile Phone
Which kext? What kind of customizations?

Any preference pane would be specific to the capabilities of the kext and support would have to be built into the kext itself.
For your kext(-s), that needs some customization though ACPI. For example, a specific prefPane for IntelBacklight.kext with handy entries or universal for most your kexts that need some customization though ACPI. That will be useful for most not advanced users, who so far from ACPI like the Earth from the center of Milky Way! =)

Anyway, I actually don't know is it possible or not for you.
 

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
For your kext(-s), that needs some customization though ACPI. For example, a specific prefPane for IntelBacklight.kext with handy entries or universal for most your kexts that need some customization though ACPI. That will be useful for most not advanced users, who so far from ACPI like the Earth from the center of Milky Way! =)

Anyway, I actually don't know is it possible or not for you.
Most of my kexts don't require customization. This one does not require it -- but you can do it optionally.

But a prefpane is the wrong place to do such customizations as the preferences would not be able to be loaded early enough. Any brightness level customizations (as discussed in the README) needs to be done early in kernel init, a time when any prefpane configurations would not be available.

I include the customization via ACPI for advanced users.
 
Top