• Become a Premium Member for $25/year with no ads to improve your community experience.

EliteMacx86

Administrator
Staff member
Joined
Jul 22, 2018
Messages
6,682
Motherboard
Supermicro X11SPA-T
CPU
Intel Xeon W-3275 28 Core
Graphics
2xAMD RX 580 8GB
OS X/macOS
13.x
Bootloader
  1. OpenCore (UEFI)
Mac
  1. Mac mini
  2. MacBook Pro
Mobile Phone
  1. Android
  2. iOS
How to Enable Backlight Control on Laptops [Clover/OpenCore]

This guide describes the implementation of backlight control on Laptops and AIO using Clover and OpenCore bootloader. By following this guide, you'll be able to enable backlight control on your Laptop and AIO. In addition, this will enable a brightness slider in the System Preferences>Displays.

Overview


With using a laptop or AIO computer, a backlight control is necessary to make it suitable for the user using different control levels and aim to save the battery. Depending on the user, some may require to have a full backlight and some may want to have a medium or low backlight level. Without a backlight function, normally the display is usually in full brightness mode which consumes way more battery than the normal mode.

Over the period of time, ACPIBacklight.kext or IntelBacklight.kext was used to serve this purpose. But with the release of the Sierra 10.12.4 update, these methods were broken and are no longer used. Another method that was in use was the AppleBacklightInjector. But a new method is introduced, called AppleBacklightFixup. As of now, AppleBacklightFixup is depreciated and the functionality has been integrated into WEG itself. With this new implementation in WEG, you no longer need to use any additional kext for the backlight function.

QUICK INFO:
  • This guide is still required if you need to map your brightness keys. After you have working brightness via System Preferences>Displays, refer to the Brightness Hotkeys Guide for activating the brightness keys.
  • This guide is not meant for discrete graphics such as NVIDIA or AMD, regardless of Mobile or Desktop. For laptops with AMD and NVIDIA Graphics, Backlight control requires additional ACPI patching.

Requirements

GraphicsSupported Intel Graphics
DisplayInternal Display Panel
Intel CPU GenerationArrandale and Later
macOS versionmacOS Sierra or Later
GPU renameGFX0 to IGPU and VID to IGPU


QUICK NOTE:
  • Brightness controls are available only for internal display panels.
  • Any depreciated kexts such as IntelBacklight, ACPIBacklight, and AppleBacklightFixup must be removed from S/L/E or L/E or your ESP.
  • If you've already patched your DSDT or SSDT with any of the Brightness Patch (Brightness fix, Brightness fix (ACPI 100), Brightness fix (Haswell/Broadwell), Brightness fix (HD3000/HD4000), then you must remove it. You'll also need to remove it if you're using Clover's AddPNLF.


STEP 1: Fix Graphics
Before you can have a working backlight function, it's important to fix your graphics with acceleration. To fix your Graphics, refer to the guide linked below.

PWM Brightness


STEP 2: Add Required SSDT

The next step is to add the required SSDT.

1. Download SSDT-PNLF from the downloads section of this forum.
2. Mount your ESP.

For Clover:
If you're using Clover, copy SSDT-PNLF.aml to EFI/Clover/ACPI/patched directory.

For OpenCore:
If you're using OpenCore, copy SSDT-PNLF.aml to EFI/OC/ACPI directory. You'll also need to add the SSDT-PNLF entry in ACPI>Add section of your config.plist

NOTE:
  • If you've patched your DSDT and SSDTs, you'll need to rename the GFX0 Device in the SSDT-PNLF.
  • SSDT-PNLF.aml should be loaded after all the OEM SSDTs.

STEP 3: Add Required Kexts

The next step is to add the required kexts to enable the backlight. WhateverGreen doesn't work standalone. WhateverGreen and Lilu are needed together to work in conjunction in order to enable the backlight.

1. Download WhateverGreen and Lilu from the downloads section of this forum.
2. Mount your ESP.

For Clover:
If you're using Clover, copy both the kexts to EFI/Clover/Kext/Others directory

For OpenCore:
If you're using OpenCore, copy both the kexts to EFI/OC/Kexts directory. You'll also need to add the kext entries in the Kernel section of your config.plist.

NOTES:
  • If you already have followed the Framebuffer patching guide, you can skip this step.
  • Download the latest version for better support.
  • Download only RELEASE.zip file.
  • If the kext is already present in the directory, replace them with a new version

STEP 4: Fix Backlight registers
Few KBL, CFL, and ICL Laptops need fixing of backlight registers otherwise such devices will end in a black screen when booting to macOS. To fix this issue, you'll need to use the enable-backlight-registers-fix property to IGPU. To add the enable-backlight-registers-fix property, follow the steps below.

1. Mount your ESP
2. Open your config.plist
3. Depending on the bootloader you use, add the following properties to your config.plist under Devices>Properties (for Clover) and DeviceProperties (for OpenCore)

DevicesKeyValueTypeNotes
PciRoot(0x0)/Pci(0x2,0x0)enable-backlight-registers-fix01000000DATA
  • Fixes Backlight registers on KBL, CFL and ICL Laptops.

4. If you don't want to inject the property using Device Properties, you can use the same patch using -igfxblr boot-arg in your config.plist.
5. Once added, save your config.plist.

If you're using a CFL based Laptop, you may have noticed that the Backlight Register Fix (BLR), to fix the 3-minute black screen issue using (-igfxblr) property in boot args or (enable-backlight-registers-fix) in Device Property, no longer works on macOS Ventura (13.4) and later. This is because Apple has simplified the implementation of the functions (ReadRegister32 and WriteRegister32), in Coffee Lake's framebuffer driver shipped in macOS Ventura (13.4), so the compiler chose to inline invocations of those functions as many as possible. As a result, the WriteRegister32 hooks registered by the Backlight Registers Fix (BLR) and the Backlight Smoother (BLS) submodules no longer work. Starting from v1.6.5, WEG can revert the optimizations done by the compiler in backlight related functions, providing an alternative to BLR and making BLS work properly on macOS 13.4 or later.

Please note that this alternative fix is only applicable to users having CFL Laptops running macOS Ventura (13.4) or later. To fix this issue, you'll need to use enable-backlight-registers-alternative-fix property on IGPU. To add the enable-backlight-registers-alternative-fix property, follow the steps below.

1. Mount your ESP
2. Open your config.plist
3. Depending on the bootloader you use, add the following properties to your config.plist under Devices>Properties (for Clover) and DeviceProperties (for OpenCore)

DevicesKeyValueTypeNotes
PciRoot(0x0)/Pci(0x2,0x0)enable-backlight-registers-alternative-fix01000000DATA
  • Fixes Backlight registers on KBL/CFL Laptops running macOS Ventura (13.4).

4. If you don't want to inject the property using Device Properties, you can use the same patch using -igfxblt boot-arg in your config.plist.
5. Once added, save your config.plist.

You'll also need to remove the boot argument -igfxblr and/or the device property enable-backlight-registers-fix. If you wish to use the Backlight Smoother on macOS 13.4 or later, you need to add both -igfxblt and -igfxbls to the boot arguments.

Please note that Ice Lake platforms are not affected because WriteRegister32 is not inlined in backlight related functions, while Kaby Lake platforms may be affected but are not supported by this new fix at this moment, because it is hard to fix the write operation on the register 0xC8250 due to the space limit.

Please note this has been fixed by Apple in 13.5 and enable-backlight-registers-alternative-fix or -igfxblt is no longer required on macOS Ventura 13.5 and later!


STEP 5: Restart your System


After performing all the above steps, restart your system for the applied changes to take effect.
You should have an operational brightness slider in System Preferences>Displays. Note that Keyboard control for the backlight is a separate issue.


Native ACPI Brightness


Although, most of the systems will have a backlight control using the above method, however, a few old (legacy) systems may have the ACPI Brightness implementation. With such implementation, the above method will not work and WhateverGreen's backlight implementation will not work.

STEP: Add Required Kext


STEP: Replace Framework
Due to the fact, ACPIBacklight was broken in OS X El Capitan and then a newer method IntelBacklight was introduced which also got broken since macOS Sierra 10.12, replacing only IntelBacklight.kext will not work. If the brightness keys are mapped, you may even have the sun icon when the brightness keys are pressed but it will not have any effect at all.

OLED Displays


Display ID dependencies and EDID


Some Product/Display-IDs present in the original EDID can be problematic. Although the patches will accomplish the correct FxxTxxxx profile selection in AppleBacklight.kext, certain IDs have special case code (somewhere) that can cause the backlight to not work. So, if you have done all the above and the backlight does not work, this can be one of the causes. To fix this issue, you must inject a patched EDID.


Ambient Light Sensor


Starting with macOS 10.15 Ambient Light Sensor presence is required for backlight functioning. For some systems, you may need a Fake ALS device and the appropriate version of FakeSMC/VirtualSMC. You can simply use SSDT-ALS0.aml to create an Ambient Light Sensor ACPI Device, which can be used by SMCLightSensor.kext to report either dummy (when no device is present) or valid values through the SMC interface.

Some Laptops have the Ambient Light Sensor device defined in DSDT. This will interfere with backlight restore on reboots as they don't tend to be compatible with macOS/OS X ambient light sensor drivers (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)
        }

This can be also achieved by using SSDT-ALS0.aml with Clover or OpenCore. See for more info.

Please note that this will only add Auto Brightness in the System Preferences>Display. However, the ALS will not function, even if your laptop is equipped with one.

Backlight Smoothness


To make the backlight transitions smoother on Intel Ivy Bridge and later, you can add enable-backlight-smoother property to IGPU or use the -igfxbls boot argument to improve your experience.

The graphics driver adjusts the panel brightness by writing values to related registers. Brightness Smoother (BLS) intercepts these write operations and gradually changes the register value. You may think of the graphics driver changing the brightness like climbing the stairs while BLS works like taking the escalator.

BLS uses a simple algorithm: it reads the register value SRC that represents the current brightness level and calculates the distance D to the register value DST requested by the graphics driver. It then moves toward the target value in N steps, each of which takes T milliseconds. By default, N is 35 and T is 7, but you may change their values by adding the properties backlight-smoother-steps and backlight-smoother-interval. It is recommended to keep T less than 10 milliseconds and the total amount of time N * T less than 350 milliseconds.

Besides, you may use the property backlight-smoother-threshold to ask BLS to skip the smoother process if the distance D falls below the threshold. In other words, BLS will write DST to the register directly. The default threshold value is 0.

If you want to prevent the built-in display from going black at the lowest brightness level, you may use the property backlight-smoother-lowerbound to specify the minimum register value that corresponds to the new, lowest brightness level. Similarly, backlight-smoother-upperbound can be used to specify the maximum value instead. See the example below. If these two properties are not present, BLS uses the default range [0, 2^32-1].


Saving and restoring the backlight levels


The AppleBacklight.kext stores the current brightness level in NVRAM and uses the same value across reboots. It stores the value in the NVRAM variable 'backlight-level'. For saving and restoring the backlight levels, a working NVRAM is required. On some of the Laptops, the native NVRAM does not work and you need to use Emulated NVRAM, regardless of Clover or OpenCore bootloader. Without the emulated NVRAM, native NVRAM is used and with Emulated NVRAM, nvram.plist is used which is saved to your disk at shutdown, and loaded at startup. Also, make sure no Backlight Level value exists in the System Parameters>Backlight Level section of your config.plist (Clover).

For more info on fixing NVRAM, refer to the guide linked below.

Brightness Hotkeys


After enabling the backlight control, the brightness will be controlled but the brightness hotkeys may not work. To fix this, follow the guide linked below

Problem Reporting


Details:
  1. macOS version
  2. Copy of IOReg
  3. Kextcache output
Screen shots:
  • DPCIManager/Status
  • About This Mac
  • System Information/Graphics/Displays
Files:
  • For Clover, compress EFI/Clover, exclude the themes folder.
  • For OpenCore, compress EFI/OC.
Notes:
  • Do not include the complete EFI folder.
  • Put all files in a folder with your name, compress files as Zip and attach files using site attachments only.
  • Do not use any external links.
 
Last edited:
I tried method 1 and 2, but it does not work.
Earlier i used the config.plist from GitHub, created for my laptop, but it has some graphics problems, so I am creating a new config.plist. This older config.plist has keyboard backlighting, and everything works, but my new config.plist does not support backlighting.
I think, i just need found some parameters in the old_config.plist, who are responsible for keyboard backlight, and i could write it for my new config.plist, it is true?
If i replace this configs, and start system, old_config running backlight, without some patches for .aml
 

Attachments

  • configs.zip
    7.4 KB · Views: 818
I tried method 1 and 2, but it does not work.
Earlier i used the config.plist from GitHub, created for my laptop, but it has some graphics problems, so I am creating a new config.plist. This older config.plist has keyboard backlighting, and everything works, but my new config.plist does not support backlighting.
I think, i just need found some parameters in the old_config.plist, who are responsible for keyboard backlight, and i could write it for my new config.plist, it is true?
If i replace this configs, and start system, old_config running backlight, without some patches for .aml
A config.plist does not control brightness. No PR files attached.
Also, the config.plist is not as per the guide.
 
Attached. I get if from RehabMan GitHub, he said get it.
 

Attachments

  • debug_3668.zip
    4.1 MB · Views: 727
Attached. I get if from RehabMan GitHub, he said get it.
The config.plist is not upto the mark. The ACPI is not patched properly. You should follow the installation guide and use config.plist from Rehabman's config. As mentioned in the Backlight guide, you must use only one method, NOT both. Your files proves that both the methods are being used at the same time which is conflicting. You cannot expect it to work. A patch is there in DSDT which should be removed too. That patch should be used in KextsToPatch section of your config.plist
Also, you've installed duplicates kexts in L/E and the same kexts exists in Clover/Kexts/Others which is wrong. Either install all to L/E or to Clover/kexts/Others
 
Hello again. Today I tried to turn on the keyboard backlight all day, but nothing came of it. I decided to use the old Dsdt generated for my laptop, with which the old config worked. I copied all the dsdt patches into the new config, and the backlight is expected to work. But there was an old problem associated with the display of graphics. I have a bad understanding of hakintosh, this is my first time. I tried to copy these dsdt patches one by one, so that using the exception method make the keyboard work with the new config, but without success. I want to understand which of these patches makes the keyboard work, can you help with this? Sorry for my English.
 

Attachments

  • debug_8833.zip
    3.3 MB · Views: 635
Hello again. Today I tried to turn on the keyboard backlight all day, but nothing came of it. I decided to use the old Dsdt generated for my laptop, with which the old config worked. I copied all the dsdt patches into the new config, and the backlight is expected to work. But there was an old problem associated with the display of graphics. I have a bad understanding of hakintosh, this is my first time. I tried to copy these dsdt patches one by one, so that using the exception method make the keyboard work with the new config, but without success. I want to understand which of these patches makes the keyboard work, can you help with this? Sorry for my English.
As per your IOReg, the backlight display is working. For the Keyboard backlight, there are some specific patches for ASUS. Also, i suggest you to use your own DSDT and SSDTs as per the ACPI patching guide.
 
As per your IOReg, the backlight display is working. For the Keyboard backlight, there are some specific patches for ASUS. Also, i suggest you to use your own DSDT and SSDTs as per the ACPI patching guide.
Yes, it works, because I used the old configuration with DSDT patches in this configuration. When I use the new configuration, the keyboard backlight does not work, in PR My non-working config, and I asked, perhaps, to understand which DSDT patch is responsible for the keyboard backlight? And I can just copy it or something.
 

Attachments

  • debug_6810.zip
    3.4 MB · Views: 692
Yes, it works, because I used the old configuration with DSDT patches in this configuration. When I use the new configuration, the keyboard backlight does not work, in PR My non-working config, and I asked, perhaps, to understand which DSDT patch is responsible for the keyboard backlight? And I can just copy it or something.
Well, i personally don't have any Laptops with a Keyboard backlight. But the patch is from EmilyDinesh. Search for it. Google is your best friend :)
 
help me pick up control brightness display, I use many instruction included from this thread but not working, now have slider in settings but not working. EFI
 

Forum statistics

Threads
1,482
Messages
14,073
Members
21,255
Latest member
eraser268