Repository navigation
drm/apple: Cap desktop 26.x panel EDR at the panel's potential headroom - #986
Merged
Merged
Conversation
On the J616s in GNOME's BT.2100 mode, stepping the brightness down through the low end made the panel dip darker and then come back brighter on every key press, and kept flickering for seconds after the last one. dcp_edr_prepare() gave the panel headroom peak / SDR white with no limit. At the lowest GNOME level (6 nits) that is a headroom of 266: every swap asked for the panel peak and scaled the picture by 1/266. Reaching it took about 120 one-step swaps, and a still desktop sends about one swap a second, so the ramp crawled on for seconds and each OSD redraw of a later key press ran another stretch of it. Meanwhile the backlight fade lowers SDR white faster than one step a swap raises the headroom, so the requested panel level went down and up again within one key press: traced on the J616s for one 35 to 6 nit step, it went 1599, 1527, 1495, 1566, 1599, 1559, ... 891, and back up to 1599 over the next 4.5 s. The firmware eases the panel level over several frames but applies the EDR scale at once, so each reversal shows as a dip and a recovery. macOS limits the headroom to the panel's potential headroom, which the ADT carries as EDRPotentialHeadroom in the /backlight node. Read it with the panel's other ADT properties and cap the headroom there. Below the SDR white at which the peak needs more than that, the headroom stays at the cap, and a brightness change moves only the panel level. Above it, a swap that lowers SDR white while the headroom is still below its target now raises the headroom just enough to hold the panel level, so the requested level never moves against a fade. The macOS ramp for EDR content starting, one step per swap, is unchanged and continues once SDR white settles. Without the ADT property, the headroom is not capped, as before. The KUnit cases model the swaps of a backlight fade and check that the panel level never moves against it, with and without a cap, that swaps at a steady level change nothing, and the start ramp. The host selftest's ADT fixture gains a /backlight node. Assisted-by: LLM Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Contributor
Author
|
Merge train (MTL, 06/11). Gates passed on test tree 0412501d (integration/aurora 2661d71 + this batch):
|
Contributor
Author
Validation on the J616s (M4 Pro), GNOME 51 in BT.2100 modeA kprobe on
SELinux enforcing with 0 AVCs and 0 failed units. Boot warnings match the base, apart from two that don't come from this change: the AVD firmware (the one-shot test kit didn't ship it) and an intermittent PCIe link message that also appears on base boots. 🤖 Generated with Claude Code |
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.
Problem
On the J616s (M4 Pro, internal panel) in GNOME's BT.2100 mode, stepping the brightness down through the low end with the keyboard made the panel dip darker and come back brighter on each key press, and it kept flickering for a few seconds after the last press. macOS shows nothing like this.
Cause
dcp_edr_prepare()gave the panel EDR headroom peak / SDR white with no limit. At GNOME's lowest level (6 nits), that's a headroom of about 266. Every swap asked for the panel peak and scaled the picture down by the same factor.A kprobe on
dcp_peer_swap_submit_26_6on the J616s, reading the swap's brightness, limit, EDR scale and headroom fields, recorded one 35 to 6 nit key step:Fix
macOS limits the headroom to the panel's potential headroom, which the ADT carries as
EDRPotentialHeadroomin the/backlightnode. The fix has three parts:Without the ADT property, the headroom isn't capped, as before. The pure helpers are in
dcp-edr.h.Tests
apple-dcp-backlight) on a synthetic panel:dcp_edr_ceilinganddcp_edr_targetbounds.desktop-adt-identityfixture gains a/backlightnode, including a nested decoy node.Results
apple-dcp-backlight, arm64 qemu, withDRM_APPLE=y, so all of appledrm builds: 25/25 pass.run.py): 83/85, anddesktop-adt-identitypasses. The two failures predate this change, and they're on the integration/aurora tip too. Since drm/apple: fade the panel backlight on DAC firmware #983 (DAC backlight fade), thepanel-takeover-registrationanddesktop-brightness-notificationsfixtures lackbrightness.fade_work,fading,levelandsystem_freezable_wq. GitHub host-tests CI didn't run on this PR.Validation on the J616s
Pending. The machine is in use; it needs a kernel install and a reboot.
🤖 Generated with Claude Code