Repository navigation
drm/apple: m4: adopt the J604 internal panel (preferred 120 Hz mode) - #1178
Merged
Merged
Conversation
The M4 backend adopts the internal panel only when the DCP's PreferredTimingElements holds exactly one element, ID 2, matching the profile. That fits the J713 and J715. macOS 26B123 reports six timing elements for the J604's ProMotion panel, the preferred 120 Hz one (ID 2) and five 48 to 60 Hz ones, and such a report would be refused. Give each profile the most elements its panel reports, one for the J713 and J715, and select the element with ID 2 among them. It is matched exactly as before. Every element must be a dictionary with an integer ID, ID 2 must appear once and no other element may be preferred. With one element allowed, the J713 and J715 accept and refuse the same reports as before. Add a host test that runs the parser on encoded reports: J713 and J715 single-element reports with each timing value changed in turn, and the J604's six-element report from macOS as a fixture. Signed-off-by: Diljit Singh <hey@djdev.me>
The J604 (MacBook Pro 14-inch, M4) has a 3024x1964 ProMotion XDR panel. macOS 26B123 reports six timing elements for it. Each has the Airs' single 8-bit color mode, 3024 active pixels on a 3104 total, horizontal porches 8 and 40, sync widths 32 and 8 and positive syncs: ID rate vtotal vertical front/back porch 2 120 Hz 2160 102/86 (preferred) 3 60 Hz 2160 102/86 4 48 Hz 2160 102/86 5 59.94 Hz 2160 102/86 6 47.95 Hz 2160 102/86 7 50 Hz 2592 534/86 Add a profile with the preferred 120 Hz timing that allows six elements. Only that mode is adopted; switching to the lower ProMotion rates is not supported. The J604 runs the Airs' 26.6.2 DCP firmware, so the profile assumes the same swap and callback offsets. The boot framebuffer stride is assumed unpadded, 3024 * 4 bytes, as on the Airs. brightness_max is the panel's rated SDR maximum, 1000 nits, as 500 is the Airs'. The default stays at the Airs' 120 nits, since these values are absolute nits. The M4 backend does not read either field yet: it sets every panel up for 500 and 120 nits. The internal DCP still does not probe on a J604: the PMP display power bridge, the display DARTs and the display gate are limited to the J713 and J715. Signed-off-by: Diljit Singh <hey@djdev.me>
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.
Summary
The M4 internal display backend gets a J604 panel profile (MacBook Pro 14-inch, M4, Mac16,1, T8132), alongside the J713 and J715 profiles. The timing parser can now pick the preferred element out of a multi-element report. The J604 display does not come up with this PR alone. #1171 already moved the kernel's display gates to the 26.6.2 firmware path. The remaining blocker is aura's DCP handoff, which is still J713-only (see below). This PR covers only the panel profile and the parser.
J604 timing elements
Source: macOS 26B123,
ioreg -lw0 -r -n disp0,TimingElements. I checked every element's porches and totals, not just the preferred one.Changes
dcp_m4_parse_timing()used to require exactly one element.timing_elements): 1 for the J713 and J715.timing_elements = 6.apple,j604), so no other hook was needed.Not supported: ProMotion mode switching. Only the preferred 120 Hz element (ID 2) is adopted. The 60, 59.94, 50, 48 and 47.95 Hz elements are accepted in the report but never used.
Assumptions
swap_size,swap_surface,swap_dva,swap_nullable,swap_tail,swap_nits,swap_intent,done_method,done_sizeandopen_method. This has not been verified on a J604.PreferredTimingElements. The capture is macOS'sTimingElements, and I assume the DCP property carries those six elements or a subset of them. A report holding only ID 2 is accepted too.boot_strideis assumed unpadded: 3024 × 4 = 12096, matching the Airs' 2560 × 4 and 2880 × 4.brightness_max = 1000is the panel's rated SDR maximum (XDR mini-LED), as 500 is the Airs'.brightness_default = 120is unchanged because these values are absolute nits, not a fraction of the maximum. 120 nits is the same indoor level the Airs start at.iomfb_m4_configure_backlight()hard-codes 500/120 and the swap encoder refuses more than 500 nits. Until those read the profile, the J604 tops out at 500 nits. I left that out of this PR to keep its scope to the profile and parser.width_mm/height_mmare 0, as in the other profiles.J604 display gates: what #1171 covers, what is left
This branch has merged integration/aurora at 38b2b8b, so it includes #1170 and #1171. After #1171, the kernel gates on the internal-panel path key on
apple_t8132_firmware_path(): the Airs, or any T8132 whose/chosen/asahi,os-fw-versionis exactly26.6.2.Already covered by #1171 for a J604 on 26.6.2:
apple_pmp_j713_board()ininclude/linux/soc/apple/pmp-display.hnow uses the firmware path. Before M4: take the PMP, PMGR, display and GPU paths on the 26.6.2 firmware on every M4 Mac #1171,apple_pmp_j713_display_prepare()returned -ENODEV on a J604 andiomfb_m4_init()failed right after selecting this profile.j713_displayindrivers/iommu/apple-dart.ccovers disp0 at 0x30a300000 and 0x30a340000. The DCP ADT handoff check indrivers/iommu/apple-dart-dcp-format.hnow also accepts target-typeJ604.j713_dcpext/j713_dispextDARTs,gate_j713_dcpext_routes()indrivers/soc/apple/display-gate.c, andt8132_ext_drm_init().apple_drm_t8132_link_device()(drm/asahi: M3 Pro/Max and M4 GPUs on by default, M4 Max GPU enabled #1170/M4: take the PMP, PMGR, display and GPU paths on the 26.6.2 firmware on every M4 Mac #1171).The kernel's remaining
apple_t8132_air()uses are not on the display path:apple-dart.c;t8132_pmgr_policy()int8132-platform-handoff.c;t8132-platform-test.c.Still blocking the J604 internal display: the boot loader.
dt_set_j713_dcp_handoff()in aura'ssrc/kboot.c(main 98765bcc, which includes aura MacBook Pro · M2 family #106) still refuses any root compatible other thanapple,j713. On a J604 it prints "J713 DCP handoff refused; keeping the boot framebuffer". It then publishes none of the following:apple,firmware-uuid;apple,j713-inherited-mappingsondisp0_piodma.iomfb_m4_init()refuses with "unqualified firmware 26.6.2 handoff" and the boot framebuffer stays.apple,j715).asahi,os-fw-version = "26.6.2", as it does for the firmware path.One more thing to check on hardware.
dcp_m4_boot_framebuffer_check()accepts a handed-over console ofpanel_heightorpanel_height - 64lines. The 64 lines are the Airs' notch. A full-height 1964-line console passes. If the J604 loader hands over a console that excludes the notch, the 14-inch notch height has to be checked against that 64.Tests
m4-panel-timingruns the actual parser on encoded reports. It is in them4group and uses the J604 report as the fixturem4-fixtures/timing-elements.json.python3 -E -s -B run.py --output DIRgives 87/87 ok, both before and after the merge (the 86 existing tests plusm4-panel-timing)../linux-build/build kernel --profile asahi <tree> -- Image modules dtbssucceeded from an empty output directory with Rust on.iomfb_m4.o,appledrm.koandt8132-j604.dtbwere built, with no warnings or errors. A first attempt crashed clang with SIGILL in unrelated files (the build VM's guest-memory zeroing). I discarded that output and verified the guest (0 bad files) before the clean build.🤖 Generated with Claude Code