Repository navigation
drm/apple: v14.7: follow chosen.asahi,show-notch for the boot panel size - #3792
Conversation
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block approval of the boot-panel sizing changes.
No open issues 🎉
What changed in this PR
Fixes Apple DCP boot-panel sizing when the bootloader keeps notch rows on boards without a recorded panel height. This prevents double-counting those rows and rejecting the resulting display geometry.
Changes:
- Share panel-height calculation between the v14.7 and v26.6 paths, honoring
chosen.asahi,show-notchonly for unsized boards. - Make the existing boot-notch flag reader available to both paths while preserving sized-board behavior.
- Add KUnit coverage for hidden, kept, contradictory-flag, and no-notch cases.
| File | Description |
|---|---|
drivers/gpu/drm/apple/v14-board-test.c |
Adds ten panel-height assertions to the KUnit suite. |
drivers/gpu/drm/apple/iomfb_v26_6.c |
Uses the shared panel-height helper for v26.6 geometry. |
drivers/gpu/drm/apple/iomfb_v14_7.c |
Uses the shared helper to correct unsized-board boot geometry. |
drivers/gpu/drm/apple/dcp.c |
Makes the existing boot-notch flag reader non-static. |
drivers/gpu/drm/apple/dcp-internal.h |
Declares the flag reader and defines the shared height helper. |
Review effort: Balanced
Boot loaders that keep the notch rows (aura with show-notch=1) hand off the full panel framebuffer (e.g. 3024x1964 on 14" M3 Pro J514S) and set chosen.asahi,show-notch="1". On v14.7 boards whose table entry omits the panel size (T6030 J514S / J516S), dcp_v14_geometry() unconditionally added the 74 notch rows to fb_height, arriving at 3024x2038 instead of 3024x1964; the DCP firmware rejected the fabricated height with -EINVAL and the internal display failed to probe. Export dcp_boot_show_notch() and consult it via a shared dcp_boot_panel_height() helper only when the board has no known panel height (preserving existing sized-board behavior in both v14.7 and v26.6), so unsized v14.7 boards keep fb_height when the boot loader kept the notch. Tested on MacBook Pro 14" M3 Pro (J514S, T6030, OS FW 14.7, aura show-notch=1): DCP probes cleanly at 3024x1964@120, backlight and G15S GPU come up without errors. Add a v14_boot_panel_height KUnit test covering hidden, kept, sized-board (including contradictory chosen flag), and no-notch cases. Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
7933a32 to
a342786
Compare
scottjones
left a comment
There was a problem hiding this comment.
Thanks Marcelo, this is a clean fix for omacom/omarchy#20833.
I walked it against every v14 record. Boards with a panel size (J613, J615, J504, J516C/J516M) and all the v26 boards come out exactly as before. The unsized T6030 boards (J514S/J516S) now get 1964 when the notch rows are kept and the flag is "1", which is the fix, and still get 1964 with hidden rows and flag "0". That holds for aura b13 through b17 and for an owner who sets show-notch=0.
The red checks at head (apple-build, host-tests, KUnit) are the Ubuntu apt mirror timing out in the dependency install step, so they just need a rerun. pr-text passes at head, and the driver diff at 7933a32 (your Tested run) is byte-identical to head.
One nit, not a blocker. With hidden notch rows but the flag set to "1" on a board with no panel size, dcp_boot_panel_height() now returns 1890 and the probe fails with -EINVAL, where the old code gave 1964. That comes from the !known_height && notch_kept branch in dcp-internal.h. Nothing produces it today, since aura only sets the flag when it keeps the rows, but a future loader or something that rewrites /chosen could. Could you add a KUnit case for (fb 1890, notch 74, flag 1) so that behavior is pinned down either way?
Optional hardening for later: pick the native timing whose height is fb_height or fb_height + notch (preferring the exact framebuffer match), so the geometry doesn't depend on the flag at all. I have a branch with that if you want it.
Approving.
Problem
Boot loaders that keep the notch rows (
aurawithshow-notch=1) hand off the full panel framebuffer (e.g.3024x1964on 14" M3 Pro J514S) and set/chosen/asahi,show-notch = "1".On v14.7 boards whose
dcp_v14_boards[]entry omitspanel_height(T6030 J514S / J516S),dcp_v14_geometry()unconditionally added the 74 notch rows tofb_height, deriving3024x2038instead of3024x1964. The DCP firmware rejected that fabricated height with-EINVAL, leaving the internal display, backlight, and GPU unprobed.Change
dcp_boot_show_notch(const struct device_node *chosen)indcp-internal.h(preserving its signature fordcp_handoff_test.c).dcp_boot_panel_height(fb_height, notch, known_height, notch_kept)helper used by bothdcp_v14_geometry()anddcp_v26_geometry().notch_keptonly whenknown_height == 0(unsized boards), keeping sized-board derivation in both v14.7 and v26.6 unchanged even under a contradictory/chosenflag.v14_boot_panel_heightKUnit test covering hidden, kept, sized-board (including contradictory flag), and no-notch cases.tools/asahi/dcp14-panel-tests.pyto pulldcp_boot_panel_height()fromdcp-internal.h, stubdcp_boot_show_notch(of_chosen), and test both the unsized kept-notch case and the sized contradictory-flag case.Tested: J514S 14" M3 Pro (T6030, OS FW 14.7, aura 1.0.0b17 show-notch=1) at 7933a32 (identical kernel code; a342786 only adds the
tools/asahi/dcp14-panel-tests.pyhost harness update and rebases ontomain3330657b1deb, MacLabj1202-001502-d4b3, booted in 24 s):T6030 display started: 3024x1964@120, 74 notch rows shown, 302x196 mm,apple-panel-blactive (140/500), 0 deferred devices, 0 DCP errors, G15S 18-core[9, 9]GPU OpenGL ES 3.2 render pixel-verified;python3 tools/asahi/dcp14-panel-tests.pyPASS and host Clang check of all 10v14_boot_panel_heightassertions PASS (0 failures).Risk: two-way · unsized v14.7 notched boards (T6030 J514S / J516S) when
chosen.asahi,show-notch="1"; sized v14.7/v26.6 boards and hidden-notch boots keep identical behavior.