- Shell 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| AGENTS.md | ||
| CONTEXT.md | ||
| install.sh | ||
| README.md | ||
| uninstall.sh | ||
ROG Z13 / AMD OLED Brightness Fix
One-line kernel workaround for the amdgpu "custom brightness curve" regression (kernel 6.15+): on AMD OLED / AUX-backlight laptops the last few slider steps near 100% invert — 98% is full bright, 99% is dimmer, 100% is very dark.
Fix: set amdgpu.dcdebugmask=0x40000 (DC_DISABLE_CUSTOM_BRIGHTNESS_CURVE), bypassing the broken firmware brightness curve and restoring linear mapping.
Quick Install
git clone ssh://git@forgejo.fifthdread.com:223/Fifthdread/rog-z13-brightness-fix.git
cd rog-z13-brightness-fix
sudo ./install.sh # --dry-run to preview without changing anything
Then reboot.
Verify
journalctl -k -b | grep -i 'brightness curve' # no output = fix active
cat /sys/module/amdgpu/parameters/dcdebugmask # 0x40000
Slide brightness 90% → 100%: it must increase monotonically and 100% must be full bright.
Uninstall
sudo ./uninstall.sh # --dry-run to preview
Why this happens
Since kernel 6.15, amdgpu applies a firmware-supplied (ATIF/ACPI) "custom brightness curve" to map the slider to raw panel brightness. The curve data is authored in 8-bit space but applied to 16-bit values and is non-monotonic at the top, so the top slider positions map to lower raw brightness. Kernel log: amdgpu: [drm] Using custom brightness curve. The 0x40000 debug mask disables that curve; AMD added it upstream for exactly this class of problem.
Note: at 100% you now get the panel's true maximum brightness. If the old 98% seemed slightly brighter, that was the broken curve over-driving the panel past its calibrated range — not usable brightness.
How it works / bootloader compatibility
The script writes options amdgpu dcdebugmask=0x40000 to /etc/modprobe.d/amdgpu-brightness-fix.conf and rebuilds the initramfs. Module options apply when the amdgpu driver loads, so this is independent of bootloader — works with GRUB, systemd-boot, and EFISTUB alike (mkinitcpio bundles /etc/modprobe.d/ into the initramfs; dracut and update-initramfs are detected as fallbacks).
Manual alternatives (if you prefer editing the cmdline)
- systemd-boot: append
amdgpu.dcdebugmask=0x40000to theoptionsline in/boot/loader/entries/*.conf - GRUB: add it to
GRUB_CMDLINE_LINUX_DEFAULTin/etc/default/grub, thensudo grub-mkconfig -o /boot/grub/grub.cfg
Affected hardware
AMD laptops with amdgpu where the firmware provides a custom brightness curve — most commonly OLED panels with AUX (DPCD) backlight (/sys/class/backlight/amdgpu_bl* with scale=non-linear, max_brightness=65535). Verified on ASUS ROG Flow Z13 (2025, GZ302, Strix Halo / Radeon 8060S).