Skip to content

Fall back to the kernel backlight for an all-in-one's DP panel - #14647

Open
omarchybot wants to merge 3 commits into
quattrofrom
fix/issue-8015
Open

omarchybot wants to merge 3 commits into
quattrofrom
fix/issue-8015

Conversation

@omarchybot

Copy link
Copy Markdown
Collaborator

omarchy-brightness-display picks DDC/CI for any connector not named eDP, LVDS or DSI. An all-in-one wires its built-in panel to a DisplayPort connector, so an iMac's panel is DP-1 or DP-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 all lists it and nothing else, omarchy-hw-display finds 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 by monitors 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_video0 to 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 by ddcutil but does not answer, and quattro drops 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 detect does 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's acpi_video0 is 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.sh fail 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 the DP- restriction. Its last round found nothing open.

Fixes #8015

🤖 Generated with Claude Code

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>
@greptile-apps

greptile-apps Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with non-blocking concerns about extra DDC reads and removed tests.

Findings

  1. P2 Fallback safeguards lose test coverage ▶
  2. P2 DDC reads run twice ▶

Summary

The PR adds a kernel-backlight fallback for a lone DP panel that does not answer DDC.

  • A lone DP panel uses the kernel backlight when its DDC read fails.

Reviews (3) · Last reviewed commit: "Keep one brightness test for the all-in-..." · Reviewed by Greptile

Comment thread bin/omarchy-brightness-display Outdated
[[ $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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 DDC reads run twice

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.

@omarchybot omarchybot added bug Something isn't working compatibility Make Omarchy work better on everything! labels Oct 16, 2026
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>
@omarchybot

Copy link
Copy Markdown
Collaborator Author

This branch now merges cleanly into quattro, at 18e6d7d0275efd9d18a5b80b91153589eb9036ee.

What changed. #14431 added use_backlight_display to bin/omarchy-brightness-display on quattro. It sends every external connector away from the kernel backlight, so the original fix, merged as it was, would have kept the iMac's DP-1 panel off DDC and then refused it the backlight too. The merge lets a lone DP- panel that does not answer DDC through that check as well, for reading and for setting. It only considers the fallback where quattro would have tried DDC, so a platform with ddc-require-connector-ddc in its displays.conf still probes nothing for a connector with no ddc node. The answer is remembered for the whole call, so each press reads DDC once. Two tests cover those: one press reads DDC once, and a lone DP display without a ddc node on such a platform probes nothing and leaves the backlight alone.

What ran, on a worker built from the Omarchy ISO. test/shell.d/brightness-display-test.sh passes 22 of 22 on this commit. With quattro's bin/omarchy-brightness-display put back it fails on the all-in-one case, and it fails again with the memo removed, with the platform check removed, or with use_backlight_display left as quattro has it. ./test/cli passes 125 of 125. ./test/all had 8 failures across 10 files, none of them brightness. Nine of those files fail on quattro at 51bfd1dba too. The tenth, lock-appear-budget-test.sh, missed a timing budget under the full suite's load, and it passes when run alone on this commit.

Competing fix. #12267 also sends all-in-ones to the backlight, but only when ddcutil detect does not list the connector. The panels in #8015 are listed and just don't answer, so it does not fix these machines, and this is the one taken forward. #12267 also has an unrelated omarchy-hw-display change for #8125, and that would be better as its own pull request.

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 1e385fca, so it doesn't carry over to this commit. Could you run the same checks on 18e6d7d0275efd9d18a5b80b91153589eb9036ee? Check out this pull request at that commit and point omarchy dev link at it, as before. Then run omarchy-brightness-display, omarchy-brightness-display --monitor DP-1 and omarchy-brightness-display +5%, and reply here with the output, the full SHA and what the panel did. After that it goes to the maintainer.

@roju

roju commented Oct 18, 2026

Copy link
Copy Markdown

Retested on the same iMac13,1, now at 18e6d7d0275efd9d18a5b80b91153589eb9036ee, linked via omarchy dev link and rebooted.

$ omarchy-brightness-display; echo "exit=$?"
93
exit=0

$ omarchy-brightness-display --monitor DP-1; echo "exit=$?"
93
exit=0

$ omarchy-brightness-display +5%; echo "exit=$?"
exit=0
$ cat /sys/class/backlight/acpi_video0/actual_brightness
15

omarchy-monitor-state's brightness line (the Display panel's slider source) reads 100 afterward — non-empty, tracking the change.

Same trigger as before, confirmed again on this commit: hyprctl monitors all -j | jq length is 1, and omarchy-brightness-display-ddc DP-1 exits 1 (DDC read fails). DP-1 falls through to acpi_video0 correctly with quattro's use_backlight_display gate in place.

This confirmation is for 18e6d7d0 specifically, as asked. Looks good on this hardware.

@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 18, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator Author

Thanks @roju. That confirms the fix at 18e6d7d0275efd9d18a5b80b91153589eb9036ee, the current head, on the hardware from #8015.

What was checked. Your output matches the backlight path. With acpi_video0 at a maximum of 15, a raw 14 reads as 93. +5% sets 98%, which rounds up to the full 15, and that reads back as 100. You also reported one listed monitor and a failed DDC read on DP-1, so this is the case the fallback is meant for. The worker results from the earlier comment still hold at this head. quattro has moved 23 commits since the merge, and none of them touch bin/omarchy-brightness-display, bin/omarchy-hw-display, bin/omarchy-monitor-state or the brightness test. GitHub shows the pull request merging cleanly, and CI is green.

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 verified and ready, and it waits on the maintainer.

@omarchybot omarchybot removed the ready Good to merge label Oct 31, 2026
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>
Comment on lines +148 to +154
# 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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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!

@omarchybot

Copy link
Copy Markdown
Collaborator Author

The maintainer asked for the test to be more proportionate, so 943e86c trims what this pull request adds to test/shell.d/brightness-display-test.sh from 94 lines to 14: a hyprctl mock and one case, a lone DP-1 panel that does not answer DDC being set through the kernel backlight. That is the case that fails on quattro and passes with the fix. The other seven cases go, and with them the NO_BACKLIGHT and DDC_WRITE_FAIL mock switches. The existing transient-read-failure case still covers the multi-display guard: the default hyprctl mock lists three monitors, so a DP-1 that fails DDC beside the others must still fail rather than fall back. bin/omarchy-brightness-display is unchanged from 18e6d7d, the commit @roju confirmed on an iMac13,1 in #8015.

On a worker built from the Omarchy ISO, brightness-display-test.sh passes 15 of 15 at 943e86c. With quattro's bin/omarchy-brightness-display swapped in, it stops at the new case. ./test/cli passes. ./test/all fails the same files as on 51bfd1d, apart from one timing-sensitive file on each side, and the one here passes three runs out of three on its own. CI is green.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compatibility Make Omarchy work better on everything! verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Built-in panel on a DisplayPort connector is routed to DDC/CI, so all-in-ones report FIXED BRIGHTNESS — fix included

2 participants