Repository navigation
Fall back to the kernel backlight for an all-in-one's DP panel - #14647
omarchybot wants to merge 3 commits 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>
[Medium impact] The PR appears safe to merge, with non-blocking concerns about extra DDC reads and removed tests. FindingsSummaryThe PR adds a kernel-backlight fallback for a lone DP panel that does not answer DDC.
Reviews (3) · Last reviewed commit: "Keep one brightness test for the all-in-..." · Reviewed by Greptile |
| [[ $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.
quattro's use_backlight_display now turns every external connector away from the kernel backlight, which would leave the iMac's DP panel with no backend at all, so the lone DP panel without DDC is let through it too. The fallback is only considered where quattro would have tried DDC, so a platform declaring ddc-require-connector-ddc still probes nothing for a connector without a ddc node, and its answer is remembered so a press probes DDC once rather than once per check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This branch now merges cleanly into What changed. #14431 added What ran, on a worker built from the Omarchy ISO. Competing fix. #12267 also sends all-in-ones to the backlight, but only when Who checked. Claude Opus 5.5 did the merge and the tests. Codex Medium reviewed the merged code and found nothing open. It noted that a lone DP display that does answer DDC, with a backlight present, is now read one extra time per press. That costs time but doesn't change which display is dimmed. Codex also compared this with #12267 and reached the same answer. Its independence isn't guaranteed, because it can read this session's notes. What it waits on. @roju, your test on the iMac was for |
|
Retested on the same iMac13,1, now at
Same trigger as before, confirmed again on this commit: This confirmation is for |
|
Thanks @roju. That confirms the fix at What was checked. Your output matches the backlight path. With Who checked. Claude Opus 5.5 checked the confirmation against the code. Codex Medium reviewed the same confirmation and re-read the diff at this head. It found nothing open: a monitor that answers DDC stays on DDC, a second display blocks the fallback, and so does a missing backlight. It reached the same reading of your numbers. It can read this session's notes, so its independence isn't guaranteed. What's next. This is now labelled |
The maintainer asked for the test to be more proportionate to a fifteen-line fix. What remains is the case that fails on quattro and passes with the fix: a lone DP-1 panel that does not answer DDC is set through the kernel backlight. The existing transient-read-failure case already runs DP-1 beside other displays through the default hyprctl mock, so it still guards against dimming the backlight for a desktop monitor. The other cases and the NO_BACKLIGHT and DDC_WRITE_FAIL mock knobs go with them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| # An all-in-one's built-in panel is its lone display, on DP-1, and does not answer DDC. | ||
| rm -f "$runtime_dir/omarchy-brightness-display-ddc/DP-1.bus" | ||
| : >"$call_log" | ||
| HYPR_MONITORS='[{"name":"DP-1"}]' DDC_READ_FAIL=1 run_brightness --no-osd --monitor DP-1 60% | ||
| grep -Fx 'brightnessctl -d mock_backlight set 60%' "$call_log" >/dev/null || \ | ||
| fail "all-in-one panel on a DP connector sets the kernel backlight" "$(<"$call_log")" | ||
| pass "all-in-one panel on a DP connector falls back to the kernel backlight" |
There was a problem hiding this comment.
Fallback safeguards lose test coverage
The shortened block removes the lone-DP checks for working DDC, failed DDC writes, and missing backlights. The remaining external-display tests use multiple monitors, so they skip the new fallback check. Restore these cases and their mock failure switches so a change that sends a readable DP monitor to the kernel backlight cannot pass unnoticed.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
The maintainer asked for the test to be more proportionate, so 943e86c trims what this pull request adds to On a worker built from the Omarchy ISO, Codex Medium and muse-wonder (via pi, thinking high) reviewed the trim and found nothing: they agreed the case fails on the base and passes with the fix, that the multi-display guard is still covered, and that nothing refers to the removed switches. They had this session's reasoning to read, so their agreement may not be independent. Greptile's review of the new head asks for the removed cases back, because a change that sent a lone DP monitor that does answer DDC to the backlight would no longer be caught. That is true, and it is the trade the request asked for, so the cases stay out. The description above still lists the removed cases and says the fix is unconfirmed on hardware. Neither is true any more, and I can't edit it from here. This waits on the maintainer, who also still has to choose between this, #12267 and #14323. |
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