Contribute
Register

[Guide] Laptop backlight control using AppleBacklightFixup.kext

Hi All,

I followed the guide to activate Backlight support, but unfortunately I didn't succeed.
Am I missing something?

Here's my IOReg and Clover folder. I've a Dell XPS 9370 (4k + i7 8550u, intel hd 620).
Thanks!
 

Attachments

  • ioreg.ioreg
    11.1 MB · Views: 191
  • CLOVER.zip
    12.1 MB · Views: 189
Anyone able to get brightness to work under Catalina? It was working fine for me under High Sierra. I did a clean install of Catalina and no more brightness slider bar. Not sure if this hack works under the new macOS.
 
I upgrade today, also the whatevergreen and update (compiled) the SSDT-PNLF.aml. After the reboot I haven't the brightness setting on the control panel of setting.
What I have to do?

Also i attach the log
 

Attachments

  • debug_6264.zip
    3.4 MB · Views: 227
After the reboot I haven't the brightness setting on the control panel of setting.


Try removing SSDT-PNLF.aml and adding on config DSDT Fixes AddPNLF and SetIntelBacklight YES (Boolean) and SetIntelMaxBacklight YES (Boolean).

Captura de Tela 2020-03-05 às 21.29.35.png


Captura de Tela 2020-03-05 às 21.29.02.png
 
Overview

This is going to be a quick guide for how to implement backlight control for laptop internal displays on macOS/OS X.

There is the original backlight guide using ACPIBacklight.kext or IntelBacklight.kext here: https://www.tonymacx86.com/threads/guide-patching-dsdt-ssdt-for-laptop-backlight-control.152659/

Note: The guide above is still useful for mapping your brightness keys. After you have working brightness via SysPrefs->Displays, refer to the original guide for activating the brightness keys.

But as you probably already know, IntelBacklight.kext and ACPIBacklight.kext were broken by the 10.12.4 update.

I wrote about how to use a patched AppleBacklight.kext or AppleBacklightInjector.kext a while ago: https://www.tonymacx86.com/threads/...een-using-patched-applebacklight-kext.121031/

That guide can be a bit complex for the novice. This guide will simplify it by using two components that work together to create the solution:

- a single pre-built AppleBacklightFixup.kext
- SSDT-PNLF.aml to activate the AppleBacklight kext


Requirements

This guide is only for Intel graphics laptops.
It will work with Arrandale, Sandy Bridge, Ivy Bridge, Haswell, Broadwell, Skylake and Kaby Lake. CoffeeLake graphics/brightness control is still a work-in-progress.


Preparation

Download the latest AppleBacklightFixup.kext and SSDT-PNLF.aml from bitbucket: https://bitbucket.org/RehabMan/applebacklightfixup/downloads/

You will find AppleBacklightFixup.kext in the Release folder (of the ZIP) and SSDT-PNLF.aml in the root.

Note: AppleBacklightFixup.kext requires Lilu.kext. You probably already have it from following the laptop guide: https://www.tonymacx86.com/threads/guide-booting-the-os-x-installer-on-laptops-with-clover.148093/


Installation

To use this technique requires three components:
- SSDT-PNLF.aml in ACPI/patched
- AppleBacklightFixup.kext installed to /L/E

Note: If you already have patched your DSDT (or SSDT) with a "Brightness" patch (PNLF), you must remove it! Same if you're using Clover's AddPNLF_1000000 or AddPNLF (in config.plist/ACPI/DSDT/Fixes).

Also Note: The SSDT-PNLF.aml assumes that GFX0 (or VID on Thinkpads) is already renamed to IGPU. It will not work if your IGPU is not at _SB.PCI0.IGPU.

Copy the SSDT-PNLF.aml to your EFI/Clover/ACPI/patched (on your EFI partition). If you're using SortedOrder in your config.plist, make sure you add SSDT-PNLF.aml to it. Also, it must be loaded *after* the OEM SSDTs. For many laptops, the IGPU (formerly GFX0) device is defined in an SSDT, not DSDT, and since SSDT-PNLF is dependent on this device already being defined, the SSDT-PNLF.aml must load after the OEM SSDT that defines it.


After extracting the ZIP install AppleBacklightFixup.kext to /L/E. This example assumes it was downloaded and extracted in your ~/Downloads folder:
Code:
sudo cp -R ~/Downloads/RehabMan-BacklightFixup*/Release/AppleBacklightFixup.kext /Library/Extensions

And I feel like I shouldn't even need to mention this, as it is obvious... but you must remove IntelBacklight.kext (and/or ACPIBacklight.kext) from wherever you installed it.

It is a good idea to check kernel cache after you install any kext:
Code:
sudo kextcache -i /

Then reboot.


Customization

In certain cases, you may wish to modify the PWMMax value used to match the specifics of your framebuffer. This is especially true if you're not using the typical ig-platform-id and your ig-platform-id uses a different PWMMax.

One example would be Haswell ig-platform-id 0xa2e0008, which uses 0x56c instead of the typical 0xad9 (as used by 0xa260006).

In this case you will need to provide a custom LMAX, since the PWMMax determined based on device-id will not match your ig-platform-id.

This can be done by providing an SSDT-RMCF.aml in ACPI/patched. You will find SSDT-RMCF.dsl in the main guide/hotpatch repo: https://github.com/RehabMan/OS-X-Clover-Laptop-Config. Look in the 'hotpatch' folder.

Since modifying ACPI .dsl code is advanced, I'm going to assume you already know how to do it. If you're not familiar with MaciASL, read here:
https://www.tonymacx86.com/threads/guide-patching-laptop-dsdt-ssdts.152573/

For example, the backlight PWMMax is configured by changing:
Code:
        // LMAX: Backlight PWM MAX.  Must match framebuffer in use.
        //
        // Ones: Default will be used (0x710 for Ivy/Sandy, 0xad9 for Haswell/Broadwell)
        // Other values: must match framebuffer
        Name(LMAX, Ones)

To:
Code:
        // LMAX: Backlight PWM MAX.  Must match framebuffer in use.
        //
        // Ones: Default will be used (0x710 for Ivy/Sandy, 0xad9 for Haswell/Broadwell)
        // Other values: must match framebuffer
        Name(LMAX, 0x56c)


Display ID dependencies

Some product/display-IDs as published in EDID present a problem. Although the patches used here will accomplish the correct FxxTxxxx profile selection in AppleBacklight, certain IDs have special case code (somewhere) that cause the backlight to not work.

To fix it, you must inject a patched EDID...

If Clover can automatically detect your EDID, the easy fix is to change your config.plist such that Clover automatically injects a custom EDID with patched product-id. The product-id known to work is 0x9c7c. Just set config.plist/Graphics/EDID/Inject=true, and config.plist/Graphics/EDID/ProductID=0x9c7c.

Note: You cannot patch a custom EDID with the EDID/ProductID setting. That setting is ignored if you're specifying an EDID via config.plist/Graphics/CustomEDID or config.plist/Graphics/EDID/Custom. You must patch the actual EDID data itself.

Note: With the use of WhateverGreen.kext, config.plist/Devices/Properties is used to inject all IGPU properties. Because EDID injection is done by injecting AAPL00,override-no-connect property on the IGPU, and config.plist/Graphics based injection (including config.plist/Graphics/EDID) does not work when using config.plist/Devices/Properties, you must inject EDID by using only config.plist/Devices/Properties. This is "fixed" in my latest build of Clover available from my bitbucket site: Clover_v2.4k_r4701.RM-4961.695d25a4.zip. The same fix should be rolled into a future "official" Clover build from sourceforge at some point. Don't forget to enable the "AAPL00,override-no-connect" property in Devices/Properties/PciRoot(0)/Pci(0x02,0) section (as long as Clover is detecting your EDID, no need to fill the EDID in there, but it has to be present and empty).

Example:
View attachment 356786
View attachment 356787

For some laptops (Sony, Fujitsu, to name a couple of common ones), Clover cannot detect your EDID. You will notice it in your Clover bootlog that detected EDID size is zero. For these laptops you are probably already injecting a custom EDID which you extracted (otherwise your internal display would not work). Simply change the product-id in the EDID data to 0x9c7c. Although macOS/OS X does not seem to check it, you should also update the checksum of the EDID to match the new checksum after patching.

Forum user @tosbaha has created a Ruby script that can patch your EDID with the 0x9c7c product id. You can find instructions here: https://www.tonymacx86.com/threads/fixing-brightness-with-custom-edid.219413/


Saving and restoring backlight level across restarts

AppleBacklight.kext stores the current brightness level in NVRAM for restoration across a reboot. It stores it in NVRAM variable 'backlight-level'.

In order for save/restore to work, you must have properly implemented NVRAM. For some laptops native NVRAM does not work, so you need EmuVariableUefi-64.efi. Without EmuVariableUefi-64.efi in drivers64UEFI, native NVRAM is used. With it, emulated NVRAM is used, saved to disk (nvram.plist) at shutdown, and loaded at startup. In order for emulated NVRAM to work, you must have installed "RC scripts" within the Clover installer. Failure to install "RC scripts", but having EmuVariableUefi-64.efi present in drivers64UEFI will cause NVRAM settings to never be saved in nvram.plist.

For some computers, you may be able to get native NVRAM working (without EmuVariableUefi-64.efi) if you use AptioMemoryFix.efi instead of OsxAptioFix*.efi. So AptioMemoryFix.efi is also something to try. Keep in mind AptioMemoryFix.efi is relatively new, so it may not work for everyone.

Also, make sure config.plist/SystemParameters/BacklightLevel is NOT present in your config.plist. You don't want Clover setting the backlight-level to something other than the NVRAM value.

Keep in mind that if you visit Clover Options -> Graphics Injector, that the default for Backlight Level will likely show as 0xFFFF. If you return from there, Clover *will* inject that value, overriding the NVRAM, which is probably not what you expect. To avoid that problem, always blank the setting before exiting from the Options -> Graphics Injector screen.


Ambient Light Sensor

Some laptops have an ambient light sensor device defined in DSDT. This will interfere with backlight restore as they don't tend to be compatible with macOS/OS X ambient light sensor driver (those drivers have Mac SMC dependencies).

Such devices should be disabled by causing _STA to return zero.

You can check your DSDT for an ambient light sensor (could be in an SSDT too) by looking for its _HID identifier: ACPI0008.

For example:
Code:
    Device (ALSD)
    {
        Name (_HID, "ACPI0008")  // _HID: Hardware ID
        Method (_STA, 0, NotSerialized)  // _STA: Status
        {
            If ((ALSE == 0x02))
            {
                Return (0x0B)
            }

            Return (Zero)
        }
...

You can edit the _STA method so it returns zero:
Code:
    Device (ALSD)
    {
        Name (_HID, "ACPI0008")  // _HID: Hardware ID
        Method (_STA, 0, NotSerialized)  // _STA: Status
        {
            Return (0)
        }
...

For some systems, you may need a Fake ALS device (one that never changes) and the appropriate version of FakeSMC.

Read here: https://www.tonymacx86.com/threads/...ghtness-not-saved.222952/page-14#post-1516295

Original info/discovery from @KNNSpeed that lead to the solution here: https://www.tonymacx86.com/threads/...ghtness-not-saved.222952/page-10#post-1515156


Problem Reporting

Read FAQ, "Problem Reporting"
https://www.tonymacx86.com/threads/faq-read-first-laptop-frequent-questions.164990/

Hi @RehabMan i've got a problem with This I can't get the brightness slider working with this method, I reinstalled all the system form zero, and reinstall AppleBacklightFixUp.kext in /L/E. I used Hackintool for install the kext.

I Used your config.plist from GitHub repository for HD4000 1366x768 for 7-series chipset.
All the kext Are updated to latest version Available from acidanthera for Lilu and WEG.
The AppleBacklightFixUp and the SSDT-PNLF.aml from your bitbucket repository.

I attached the zip file generated by install_tools.sh found in PROPER PROBLEM REPORTING.

Thanks in advance

My laptop is a Toshiba Satellite C55-A-15C with:

macOS Catalina 10.15.3
Intel Core I5 3230M / HM76
Intel HD Graphics 4000
Nvidia GT 710M (Disabled by nv-disable=1)
 

Attachments

  • debug_28842.zip
    1.4 MB · Views: 230
Hi @RehabMan i've got a problem with This I can't get the brightness slider working with this method, I reinstalled all the system form zero, and reinstall AppleBacklightFixUp.kext in /L/E. I used Hackintool for install the kext.

I Used your config.plist from GitHub repository for HD4000 1366x768 for 7-series chipset.
All the kext Are updated to latest version Available from acidanthera for Lilu and WEG.
The AppleBacklightFixUp and the SSDT-PNLF.aml from your bitbucket repository.

I attached the zip file generated by install_tools.sh found in PROPER PROBLEM REPORTING.

Thanks in advance

My laptop is a Toshiba Satellite C55-A-15C with:

macOS Catalina 10.15.3
Intel Core I5 3230M / HM76
Intel HD Graphics 4000
Nvidia GT 710M (Disabled by nv-disable=1)
Sorry Man I resolved the problem with reading the IntelHD.md Readme in WhatEverGreen repository in GitHub and Watching Hackintool which tell me that AppleBacklightFixUp was implemented in WEG.
So I Found the problem, The problem is the kext, With only SSDT-PNLF.aml and the latest version of WEG the brightness slider is show in SysPref>Disp and it works without any problem.
 
help please pick up brightness control. I try use instruction from head, and still can't adjust brightness. in setting became slide regulator. but not working
spec: laptop dell latitude 5490, 8250u, uhd620. OS X Mojave 10.14.6
 

Attachments

  • debug.zip
    17.9 MB · Views: 153
Hello, "CoffeeLake graphics/brightness control is still a work-in-progress." any updates here? I have a Intel I3-8145U paired with Intel UHD 620 GPU, and my brightness doesn't work atm, i can't adjust it. I haven't tried the guilde cuz it said, Coffeelake units work-in-progress... Or, is there any other ways i can use?
 
Hello, "CoffeeLake graphics/brightness control is still a work-in-progress." any updates here? I have a Intel I3-8145U paired with Intel UHD 620 GPU, and my brightness doesn't work atm, i can't adjust it. I haven't tried the guilde cuz it said, Coffeelake units work-in-progress... Or, is there any other ways i can use?
using latest whatevergreen.kext can be used instead:

it has boot flags for coffelake machines

also a section about half way down the page:
 
Back
Top