Re: [PATCH v4 1/2] efi: Save Brightness using EFI on Macs

From: Aditya Garg

Date: Tue Mar 17 2026 - 05:43:40 EST




> On 16 Mar 2026, at 9:03 PM, Atharva Tiwari <atharvatiwarilinuxdev@xxxxxxxxx> wrote:
>
> Currently when a Mac reboots, the brightness is not the same
> as the previous boot instead its the same as the last time the
> Mac booted macOS.
>
> We can fix this issue by saving the brightness level to the efivar
> backlight-level.
>
> (tested on iMac20,1)
>
> Suggested-by: Lukas Wunner <lukas@xxxxxxxxx>
> Signed-off-by: Atharva Tiwari <atharvatiwarilinuxdev@xxxxxxxxx>
> ---
> drivers/firmware/efi/Kconfig | 10 +++
> drivers/firmware/efi/Makefile | 1 +
> drivers/firmware/efi/apple-brightness.c | 67 +++++++++++++++++++
> .../linux/platform_data/apple-brightness.h | 20 ++++++
> 4 files changed, 98 insertions(+)
> create mode 100644 drivers/firmware/efi/apple-brightness.c
> create mode 100644 include/linux/platform_data/apple-brightness.h

I tested this patch on a MacBookPro16,1, which is a T2 Intel Mac, and the behaviour is very weird:

1. macOS will never respect any brightness set by Linux
2. The Max brightness set by macOS is not the max brightness on Linux. I get these values on Linux:

aditya@MacBook:~$ efivar -p -n '7c436110-ab2a-4bbb-a880-fe41995c9f82-backlight-level'
GUID: 7c436110-ab2a-4bbb-a880-fe41995c9f82
Name: "backlight-level"
Attributes:
Non-Volatile
Boot Service Access
Runtime Service Access
Value:
00000000 f1 02 |.. |

aditya@MacBook:~$ cat /sys/class/backlight/gmux_backlight/brightness
48238

3. I set the Max brightness on Linux, and restarted. I get this:

aditya@MacBook:~$ efivar -p -n '7c436110-ab2a-4bbb-a880-fe41995c9f82-backlight-level'
GUID: 7c436110-ab2a-4bbb-a880-fe41995c9f82
Name: "backlight-level"
Attributes:
Non-Volatile
Boot Service Access
Runtime Service Access
Value:
00000000 7a ff |z. |

aditya@MacBook:~$ cat /sys/class/backlight/gmux_backlight/brightness
65402


4. Finally, any attempt to reduce the brightness seems worthless as unless booted back to macOS, Linux always boots at max brightness, but the nvram variable is changed successfully:

aditya@MacBook:~$ efivar -p -n '7c436110-ab2a-4bbb-a880-fe41995c9f82-backlight-level'
GUID: 7c436110-ab2a-4bbb-a880-fe41995c9f82
Name: "backlight-level"
Attributes:
Non-Volatile
Boot Service Access
Runtime Service Access
Value:
00000000 eb 41 |.A |

aditya@MacBook:~$ cat /sys/class/backlight/gmux_backlight/brightness
65402


Overall, it’s very inconsistent. Also, I’ve noticed Windows doesn't mess around with efivars, rather stores the brightness locally and implements it on every boot, something which systemd should do on Linux.