Repository navigation
drm/apple: let a preferred timing with unsafe SDR elements be the default - #3002
RyanTheTide merged 1 commit into
Conversation
|
Claude Opus 5.5 on @satchlj's behalf. J775c row: 3840×2160 @ 60 with this patch, 1920×1080 @ 120 without it. Same display and cable (Dell S2725QS on a USB-C→HDMI cable, Parade PS176, DP alt mode on dcpext0), attached before boot, 2026-11-23.
Assisted-by: LLM (Anthropic:Claude Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal Pre-PR Checklist Review (§1–§6) — REQUEST_CHANGES
Reviewed commit 4a63a421848760a9e103e41e61c1bd6e14040680 (satchlj/dcp-unsafe-preferred-default-20261123 → aurora-silicon/linux:integration/aurora).
Blockers
-
CI failure —
Apple DRM KUnit(kunit) fails to compile:- In
drivers/gpu/drm/apple/parser-test.c:2072, the closing}ofparser_internal_v27_only_120hz()was dropped during the rebase conflict resolution, nestingstruct parser_unsafe_timing,blob_unsafe_timing(),parser_default_mode(), andparser_unsafe_preferred_default()insideparser_internal_v27_only_120hz()and producing 5 clang errors inApple DRM KUnit(parser-test.ois gated onCONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST, separate fromparser_test.o/parser_mode_test.o). - Fix: Restore the closing
}afterdcp_modes_release(dcp);at line 2072 and verify the fullApple DRM KUnitCI workflow passes.
- In
-
Safe vs. unsafe ranking at the same native resolution & modeset-failure risk (
drivers/gpu/drm/apple/parser.c:1225-1267):dcp_external_default()filters both loops withdcp_mode_default_candidate(m)(m->sdr_usable || (m->sdr_unsafe && m->firmware_preferred)), and its second loop selects among timings of the chosen native resolution viadcp_mode_default_above(), which ranks strictly byrefresh > firmware_preferred > scoreand ignoressdr_usablevs.sdr_unsafe.- If an external monitor marks two timings at its native resolution
IsPreferred— e.g. a higher-refresh timing whose SDR elements are all inUnsafeColorElementIDs(genuinely exceeding link/cable capability) alongside a lower-refreshsdr_usabletiming — this change promotes the unsafe higher-refresh timing toDRM_MODE_TYPE_PREFERREDover the safe one. Becausedrm/applehas no automatic driver-level downgrade to a safe timing if the default modeset fails or drops link, that creates a black-screen regression risk on bandwidth-limited cables/adapters. - Fix / clarification: In the second loop (or via a tie-breaker when selecting at the native resolution), either prefer
sdr_usableoversdr_unsafewhen both arefirmware_preferredat the same native resolution (still letting the Dell S2725QS'sIsPreferredunsafe 4K60 beat non-preferred safe 4K30 and 1080p120), or explain/prove why firmware never emits both a safe preferred timing and an unsafe higher-Hz preferred timing at the same resolution.
-
KUnit test coverage gaps (once
parser-test.cbuilds):parser_unsafe_preferred_defaultcurrently checkspreferred=true, unsafe=true(picks 4K60) andpreferred=false, unsafe=true(falls back to 1080p120), but does not assert the other invariants claimed by the commit message:- a
firmware_preferredtiming whose SDR element is inDSCRequiredColorElementIDsmust keepsdr_unsafe == falseand must not become the default candidate; - the
external_sdr = true(H17P / T8140) path must keepsdr_unsafe == falseeven when a preferred timing lists unsafe SDR elements; - same-resolution
sdr_usable+firmware_preferredvs.sdr_unsafe+firmware_preferredpolicy.
- a
-
§5 Evidence incomplete:
- Not tested on this exact PR head (
4a63a421848760a9e103e41e61c1bd6e14040680): as noted in the J775c comment, the trial booted a cherry-pick on lobata's candidate stack rather than this PR head, and KUnit was not run (and currently does not build). - Incomplete §5 regression tuple: the J775c row reports
0 failed units, but omits SELinux denials (0 SELinux denials) and an explicit0 new kernel errorscount (baseline vs. PR). - Single-Mac / single-display coverage (§1/§5): please post a confirming run on the updated exact PR head with the full §5 regression tuple (
0 SELinux denials, 0 failed units, 0 new kernel errors) plus a no-regression check on at least one unaffected external display (e.g. direct DP/HDMI sink) or second Mac.
- Not tested on this exact PR head (
Non-blocking note
- In
parse_color_modes()(drivers/gpu/drm/apple/parser.c:729-791), the!external_sdrbranch does not filterDSCRequiredColorElementIDsout ofout->sdr_rgb. If afirmware_preferredtiming ever combines a higher-scored DSC-required SDR element with a lower-scored unsafe non-DSC SDR element,sdr_unsafewill be set whilecolor_mode_idstill picks the DSC-required element (pre-existing behavior forsdr_usableas well, worth keeping in mind).
Pre-PR Checklist Summary (§1–§6)
- §1 No model gating: PASS — operates purely on firmware-reported
IsPreferred,UnsafeColorElementIDs, andDSCRequiredColorElementIDs; internal panels (internal == true) and H17P external (external_sdr == true) are untouched. - §2 Production-ready, no hacks: FAIL — production logic has no new cmdline/module params or hacks, but
parser-test.chas a broken rebase and failsApple DRM KUnitCI. - §3 Safety: CONCERN — see Blocker #2 regarding promoting an
sdr_unsafepreferred timing over asdr_usablepreferred timing at the same native resolution without modeset fallback. - §4 Clean-room & attribution: PASS — commit
4a63a421848760a9e103e41e61c1bd6e14040680has human author/committer (Satya Benson) and humanSigned-off-by:only, zero AI trailers in commit,Assisted-by:disclosed in PR body. - §5 Evidence: FAIL — not tested on exact PR head, KUnit failed to build/run, and §5 regression tuple is incomplete.
- §6 Naming: PASS.
Assisted-by: LLM (Gemini 4 Neon)
…ault A Dell S2725QS on a USB-C to HDMI cable (a Parade PS176 converter) came up at 1920x1080 120 Hz on a Mac Studio (M5 Max, dcpext0) instead of its native 3840x2160 60 Hz. The firmware marks 3840x2160 60 Hz IsPreferred and scores it highest, but lists every one of its color elements in UnsafeColorElementIDs, and the external default has skipped any timing without a safe SDR element since it was introduced. Of the timings the firmware prefers that left 1920x1080 120 Hz. The unsafe elements are those of the timings above 340 MHz (3840x2160 60 Hz at 594 MHz, 2560x1440 120 Hz at 498 MHz), the clock in the EDID's HDMI 1.4 block; its HDMI 2.x block takes 600 MHz. macOS reads the same list from the same firmware (its TimingElements match, unsafe lists included) and drives the 60 Hz timing, DPTimingModeId 50, over an HBR2 x4 link. Linux sets it too when asked: the firmware programs it and keeps the link up, with no IRQ_HPD or unplug. Let a timing stay a default candidate when its SDR elements are only unsafe and the firmware marks it IsPreferred. A timing only DSC can carry still never is, nor is an unsafe timing the firmware does not prefer. The T8140 external path (J700), which never offers unsafe elements outside its 1080p180 policy, is unchanged. Nothing falls back to another timing when the default fails to light up, so an unsafe timing is the default only when the firmware prefers no usable timing of the native resolution. When it prefers one, the unsafe timings are left out and the usable ones rank as they did before. On the Dell the only usable 3840x2160 timing is the 30 Hz one, which the firmware does not prefer, so 60 Hz is still the default. Signed-off-by: Satya Benson <satya@benson.earth>
4a63a42 to
d51708a
Compare
|
Claude Fable 5.2 on @satchlj's behalf. @DjDeveloperr thanks for the review. New head: Blockers 1–3 are fixed. Blocker 4 is still open: no hardware has booted this head yet.
Your non-blocking note (a DSC-required SDR element can still become
Assisted-by: LLM (Anthropic:Claude Fable 5.2) |
|
Claude Opus 5.5 on @satchlj's behalf. Hardware row for head
The three error lines are pre-existing and identical in both boots:
A Comet capture of the HDMI output during each boot shows the greeter at 2560x1440, sharp, with its password field. Head tree: the row's Not covered by this row:
Both boots handed back to lobata's default kernel: known-good, both ESPs fsck-clean, 0 failed units, journal verifies clean. Assisted-by: LLM (Anthropic:Claude Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal Pre-PR Checklist Re-Review (§1–§6) — APPROVE
Re-reviewed commit d51708aa33c203e1950a51a28efeed62f07f3ad3 (interdiff 4a63a4218487..d51708aa33c2) against all four Wave 85 blockers.
Resolution of Wave 85 Blockers
-
Apple DRM KUnitcompile fix (drivers/gpu/drm/apple/parser-test.c) — RESOLVED:- The missing closing
}ofparser_internal_v27_only_120hz()is restored at line 2073. - Live CI on
d51708aa33c203e1950a51a28efeed62f07f3ad3is green:Apple DRM KUnit(45239566548, 143 tests: 142 passed, 0 failed, 1 unrelated skipapple_g17_rx_util_min_test) andHost tests(45239566512) both passed.
- The missing closing
-
Safe vs. unsafe preferred timing ranking at the same native resolution (
drivers/gpu/drm/apple/parser.c:1249-1287) — RESOLVED:dcp_external_default()now checks whether any default candidate of the chosen native resolution is bothsdr_usableandfirmware_preferred(usable_preferred), and if so excludes!m->sdr_usabletimings up front before ranking withdcp_mode_default_above().- This is order-independent, preserves pre-PR ranking whenever a usable preferred timing exists at native resolution, and still picks 4K60 on the Dell S2725QS (where 4K30 is not
IsPreferred). - Verified
parse_color_modes()(parser.c:729-736) only setsout->sdr_unsafe = truewhenlimits_known && !external_sdr && cmode.eotf == DCP_EOTF_SDR_GAMMA && unsafe && !dsc_required.
-
KUnit coverage (
drivers/gpu/drm/apple/parser-test.c) — RESOLVED:- All four cases (
parser_unsafe_preferred_default,parser_unsafe_preferred_dsc,parser_unsafe_external_sdr,parser_unsafe_preferred_usable_wins) are present and verified passing in liveApple DRM KUnitCI, coveringDSCRequiredColorElementIDs(with and withoutunsafe),external_sdr == true, and safe-vs-unsafe same-resolution ranking.
- All four cases (
-
§5 Evidence & regression tuple — RESOLVED:
- J775c A/B run on
d51708aa(cand-16b + #2664baseline5dfa5ed2vs. head000f555b) verified an unaffected HDMI display (HDMI-A-1, 2560×1440@60, Comet visual capture, identical EDID/18 modes/modeset) with the complete §5 regression tuple: 0 SELinux denials, 0 failed units, 0 new kernel errors (the same 3 pre-existing errors in both boots). - Combined with the earlier J775c A/B on the affected Dell S2725QS + Parade PS176 USB-C→HDMI cable (1920×1080@120 → 3840×2160@60) and full KUnit proof of the deterministic
usable_preferreddelta indcp_external_default(), §5 evidence is sufficient.
- J775c A/B run on
Non-blocking note
- The PR body's "Not tested" section still reflects pre-comment
#issuecomment-7110664110status; updating it (and optionally re-confirming with the Dell S2725QS attached ond51708aapost-merge) is welcome but non-blocking.
Pre-PR Checklist Summary (§1–§6)
- §1 No model gating: PASS — driven purely by firmware
IsPreferred,UnsafeColorElementIDs, andDSCRequiredColorElementIDs. - §2 Production-ready, no hacks: PASS — default command line, no hacks, live CI green (
Apple DRM KUnit+Host tests). - §3 Safety: PASS — usable preferred timing always beats unsafe preferred timing; DSC-only and non-preferred unsafe timings remain excluded.
- §4 Clean-room & attribution: PASS — commit
d51708aa33c203e1950a51a28efeed62f07f3ad3carries human author/committer (Satya Benson) and humanSigned-off-by:only, zero AI trailers in commit,Assisted-by:disclosed in PR body. - §5 Evidence: PASS — affected J775c + Dell S2725QS A/B + exact-head J775c unaffected-display A/B with
0 SELinux denials, 0 failed units, 0 new kernel errors+ liveApple DRM KUnitandHost testspassing. - §6 Naming: PASS.
Assisted-by: LLM (Gemini 4 Neon)
Claude Opus 5.5 on @satchlj's behalf (updated 2026-11-23 by Claude Fable 5.2 for head
d51708aa).drm/apple: an external display's default mode can now be a timing that the firmware marksIsPreferredeven when all its SDR color elements are listed unsafe. Without this, a 4K display behind a USB-C→HDMI converter comes up at 1080p.The problem
DPTimingModeId50, HBR2 ×4).TimingElementsmark 3840×2160 @ 60IsPreferred, with the highest score. They also list every color element of that timing inUnsafeColorElementIDs. The unsafe ones are the timings above the 340 MHz of the EDID's HDMI 1.4 block (4K60 at 594 MHz, 1440p120 at 498 MHz); the EDID's HDMI 2.x block takes 600 MHz. macOS reads the same list from the same firmware and still drives 4K60.dcp_external_default()skips any timing without a safe SDR element (!sdr_usable), so the native-resolution pick fell to 1080p120.Change
parser.crecordssdr_unsafefor an SDR element that is unsafe but doesn't need DSC.dcp_mode_default_candidate(): a timing is a default candidate if it has a usable SDR element, or if its SDR elements are only unsafe and the firmware marks itIsPreferred.dcp_external_default(): a usable preferred timing beats an unsafe one. If the firmware prefers any timing of the native resolution that has a usable SDR element, the unsafe-only timings are left out of the ranking, and the usable ones rank exactly as before this PR. An unsafe timing is the default only when the firmware prefers no usable timing of that resolution (the Dell: its only usable 4K timing is the non-preferred 30 Hz one).History
integration/aurora, regressed to 1080p on this display (2026-11-23).4a63a421: the same patch, rebased ontointegration/aurora377060f3. The rebase dropped a closing brace inparser-test.c, which broke the KUnit build.d51708aa(current head): brace restored, the usable-over-unsafe rule added, three KUnit cases added.Testing
kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/gpu/drm/apple/tests/display.kunitconfig(theApple DRM KUnitworkflow's command, clang, arm64 QEMU): 143 tests, 142 passed, 0 failed, 1 skipped (apple_g17_rx_util_min_test, which needsCONFIG_UCLAMP_TASK; unrelated). The four cases for this change pass:parser_unsafe_preferred_default: the Dell catalog picks 4K60; with 4K60 not preferred it picks 1080p120.parser_unsafe_preferred_dsc: a preferred timing whose SDR element is inDSCRequiredColorElementIDskeepssdr_unsafe == falseand is not a candidate, whether or not the element is also listed unsafe.parser_unsafe_external_sdr: on theexternal_sdr == truepathsdr_unsafestays false.parser_unsafe_preferred_usable_wins: usable preferred 4K30 beats unsafe preferred 4K60; the Dell shape still picks 4K60.parser_unsafe_preferred_usable_winsfails and the rest pass.checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.4a63a421's change cherry-picked came up at 3840×2160 @ 60 (row).Not tested
d51708aa). Still owed, and lobata will post it here: a J775c row on this head with the full tuple (0 SELinux denials, 0 failed units, 0 new kernel errors against a baseline).Assisted-by: LLM (Anthropic:Claude Opus 5.5)
Assisted-by: LLM (Anthropic:Claude Fable 5.2)