Repository navigation
Conversation
Firmware older than 26 answers create_backlight_service with dcp_has_panel() only. That stays false until the panel dimensions have been parsed, which is after 13.5 firmware asks during start_ios_gated. The firmware then reports that it could not find the Backlight service, and later backlight writes are ignored until a modeset power cycle. connector_type is already eDP when the panel node has been read. Answer an eDP connector on that path the same way firmware 26 and newer does. External displays are not eDP and still answer false. J313 BrightnessLCD rejects 395 nits and above: iDAC 1956 is accepted and 1957 is not. apple,max-brightness is 420, so 100% asks for a level the firmware drops. Cap apple,panel-j313, and a panel id of J313, at 394 nits. Other panels keep the device-tree maximum, and 100% on this panel lands on 394. Measured on a MacBook Air (M1, 2020, J313, DCP firmware 13.5) running linux-aurora 7.2.11. This commit has not been booted as a new kernel. Signed-off-by: Lucas Goossen <lucas.goossen@hey.com>
ludagoo
force-pushed
the
fix/j313-panel-backlight
branch
from
October 26, 2026 18:21
529d348 to
a7b3793
Compare
Member
|
Tested on a J313 (M1 Air), automated and by eye: the 394-nit cap works. The
How this was tested
|
ludagoo
marked this pull request as ready for review
October 27, 2026 00:24
ludagoo
requested review from
chriskearney,
maralcbr and
scottjones
as code owners
October 27, 2026 00:24
DCP 13.5 reports brightness on the old 420-nit scale after the panel is capped at 394, so actual_brightness read back as 420 and a write of 393 came back as 419. Clamp the stored nits, and the sysfs readback, to the panel maximum. On this machine the panel node is read before firmware starts, so dcp_has_panel() is already true when the backlight service is created and answering eDP as well does not change that return. The missing service log and the need for a modeset before writes apply are unchanged. Not hardware-tested. Signed-off-by: Lucas Goossen <lucas.goossen@hey.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
J313
BrightnessLCD::nitsToDBVrejects 395 nits and above (iDAC 1956 is accepted, 1957 is not).apple,max-brightnessis 420, so 100% asked for a level the firmware drops.apple,panel-j313, and a panel id of J313, is capped at 394 nits. Other panels keep the device-tree maximum, and 100% on this panel lands on 394.dcpep_cb_create_backlight_servicestill answers true for an eDP connector as well as fordcp_has_panel(). On this J313 the panel node is read before firmware start, sowidth_mmis already set anddcp_has_panel()is already true when firmware asks duringstart_ios_gated. Answering eDP does not change that return value. DCP 13.5 still logs that it could not find the backlight service, and brightness writes still apply only after a modeset. This change does not fix that. External displays are not eDP and still answer false.Measured on a MacBook Air (M1, 2020, J313, DCP firmware 13.5) running linux-aurora 7.2.11: with the cap, setting 394 read back as 420 and setting 393 read back as 419 (393×420/394). The firmware was still reporting on the old 420 scale.
Session build, Monday 26 Oct 2026 05:02 PM -03: linux-aurora 7.2.11-6-2-ARCH (package 7.2.11.aurora6-2), branch local/j313-test at 7638df0. makepkg exited 0. rustc 1.85.0, LLVM/clang 18.1.8. This machine is running that kernel. This pull request's earlier head was a7b3793, which is not the commit that was built.
The v14 backlight KUnit tests were not run.
A separate perceptual-scale draft may touch the same backlight file and should be rebased rather than merged on top. That draft remaps the range; this one uses levels the firmware already accepts.
Follow-up, not hardware-tested
c230f92268abclampsactual_brightness, thepr_publishnits store, and the powerlog nits store to the panel maximum. A read of 420 withmax_brightness394 comes back as 394. The 420-scale proportion is not remapped, so the 419 that followed a write of 393 also clamps to 394. The eDP answer is unchanged. This clamp is not hardware-tested.