Repository navigation
Fall back to the kernel backlight for an all-in-one's DP panel - #14647
omarchybot wants to merge 1 commit into
Conversation
An all-in-one wires its built-in panel to a DP connector, so the name-based check sends it to DDC/CI, which the panel does not answer, and brightness fails although a working backlight sits in /sys/class/backlight. DDC is still tried first; only a lone DP display that cannot be read over DDC, on a machine with a backlight, is moved to the backlight. Deciding on a failed read rather than a failed write keeps a monitor whose reads work on DDC when a write fails. Fixes #8015 Co-Authored-By: roju <10701214+roju@users.noreply.github.com> Co-Authored-By: Codex Medium <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
| [[ $monitor == DP-* ]] && | ||
| hyprctl monitors all -j 2>/dev/null | jq -e --arg monitor "$monitor" 'length == 1 and .[0].name == $monitor' >/dev/null 2>&1 && | ||
| omarchy-hw-display >/dev/null 2>&1 && | ||
| ! omarchy-brightness-display-ddc "$monitor" >/dev/null 2>&1 |
There was a problem hiding this comment.
For a lone DP-* display with a kernel backlight and working DDC, this probe discards a successful brightness read before the requested operation runs. Queries and relative changes then issue a second getvcp. Absolute changes also gain an unnecessary read even when the range is already cached.
These extra hardware reads slow brightness adjustments. Reuse the successful probe for the requested operation, and add a read-count check to the lone-DP test.
omarchy-brightness-displaypicks DDC/CI for any connector not namedeDP,LVDSorDSI. An all-in-one wires its built-in panel to a DisplayPort connector, so an iMac's panel isDP-1orDP-3, goes to DDC/CI, which it does not answer, and brightness fails outright: the Display panel shows FIXED BRIGHTNESS, the brightness keys do nothing, and the script exits 1 while a working backlight sits in/sys/class/backlight. Two reporters see it on different iMacs, one on nouveau and one on Intel graphics alone.DDC is still tried first. A display moves to the kernel backlight only when all of these hold: its connector is
DP-,hyprctl monitors alllists it and nothing else,omarchy-hw-displayfinds a backlight, and a DDC read of it fails. With one display and one backlight the backlight can only be that panel's. Disabled and mirrored outputs are listed bymonitors all, so a laptop with its lid shut keeps its external monitor on DDC. The fallback turns on a failed read rather than a failed write, so a monitor that can be read stays on DDC when a write fails.What this does not cover, deliberately: an all-in-one with a second display attached still sends its panel to DDC, because nothing maps a firmware backlight such as
acpi_video0to a connector, and this does not guess. The residual risk is a desktop exposing an unrelated backlight next to a single DP monitor that cannot be read over DDC, which today has no brightness at all and would now move that backlight. A transient read failure on such a desktop sends that one press to the backlight too. On the reported iMacs the panel is listed byddcutilbut does not answer, andquattrodrops the bus cache after a failed read, so each press probes again. That cost is unchanged from today, and #14525 caches the failure.#12267 also routes all-in-ones to the backlight, but only when
ddcutil detectdoes not list the connector, and both reporters' panels are listed, so it does not fix these machines. #14323 uses a backlight attached to the connector itself, which an iMac'sacpi_video0is not. The routing here is @roju's from the issue, with the DDC-first ordering added.The new cases in
test/shell.d/brightness-display-test.shfail with the fix reverted and pass with it, on a worker built from the Omarchy ISO. They cover an unresponsive lone DP panel falling back for reads and writes, a lone DP monitor that answers DDC staying on it with a backlight present, a failed DDC write leaving the backlight alone, a DP display beside another getting no fallback, and a lone virtual output leaving the backlight alone. No all-in-one was available, so the fix still needs confirming on one of the reporters' machines. Written by Claude Opus 5.5 and reviewed over four rounds by Codex Medium, whose findings shaped the DDC-first ordering, the read-not-write rule and theDP-restriction. Its last round found nothing open.Fixes #8015
🤖 Generated with Claude Code