Repository navigation
drm/apple, arm64: dts: apple: t8140: move the J700 surface and power-LUT data into the device tree - #2358
Closed
RyanTheTide wants to merge 3 commits into
Closed
drm/apple, arm64: dts: apple: t8140: move the J700 surface and power-LUT data into the device tree#2358RyanTheTide wants to merge 3 commits into
RyanTheTide wants to merge 3 commits into
Conversation
The T8140 DCP node gave apple,iomfb-surfaces = <0>, a single zero that was meant to select surface 0. The binding and the driver read the property as per-slot enable flags, so <0> enables nothing, and dcp_platform_probe() carried a special case for exactly that encoding on apple,j700 with an apple,t8140-dcp node. The value comes from our device tree, not from the loader: m1n1 does not write apple,iomfb-surfaces. Say what is meant, <1> (slot 0 enabled), and drop the machine-gated special case and the binding note about a legacy J700 encoding. The resulting surface mask is unchanged: bit 0 only. A kernel booted with an older J700 DTB that still has <0> now stops with "No usable display surfaces" instead of guessing; the DTB is shipped with the kernel. Fixes: 231a8f9 ("drm: apple: accept the legacy J700 primary surface selection") Signed-off-by: Ryan Murray <[email protected]>
The H17P firmware asks for five power lookup tables through the D400
provider callback. When the DCP node lacked one, the driver answered
with J700 bytes built into the driver, selected by
of_machine_is_compatible("apple,j700") and the processor compatible,
on the internal and the external processor.
These tables describe the panel's power model: they are board data and
belong in the device tree, which the binding already describes. Put the
J700 tables (the bytes the driver carried, which match disp0 in the
ADT) on the J700 dcp and dcpext nodes, and drop the built-in copy and
the machine check. The loader still may refresh the internal
processor's copy from the ADT (m1n1 does since its T8140 provider-table
change). A missing table is now reported as missing and stops the
transaction, as a malformed one already did, on every board.
The host selftest now checks that only DT data is sent, for both
processors, and that an absent non-empty table fails.
Fixes: bd59a57 ("drm: apple: retain J700 provider replies with older loaders")
Fixes: 1ff0899 ("drm: apple: allow the qualified J700 provider fallback on DCPEXT")
Signed-off-by: Ryan Murray <[email protected]>
The previous commit dropped the J700-only reading of "apple,iomfb-surfaces = <0>" and changed t8140.dtsi to <1>. A J700 that boots this kernel with an older device tree, as the Neo does whenever the boot loader keeps its DTB, then has no surface enabled and the display subsystem refuses to probe: apple-drm display-subsystem: error -EINVAL: No usable display surfaces A pipe with no surface is never a valid description, so read a list that enables no slot as the older single-index form, slot 0, on every DCP, with an info line. No in-tree device tree carries such a list any more (the per-slot lists are <1>, <1 1 0 0>, <1 1 0 1> and <0 0 1 0>), so this only changes what an old DTB gets: the display instead of -EINVAL. Document the older form in the binding. Signed-off-by: Ryan Murray <[email protected]>
This was referenced Nov 19, 2026
Merged
Merged
phy: apple: atc: Retry only an owed SuperSpeed port power-on, warn on a failed post-sleep mode
#2409
Closed
This was referenced Nov 19, 2026
Contributor
Author
|
Early note on this draft (no full review yet):
Assisted-by: LLM (Claude:Opus 5.5) |
Contributor
Author
|
Closing: the panel power tables should be copied from the ADT by the boot loader rather than carried in the board device tree. |
Contributor
Author
|
Reopened and kept as a draft; the comment above lists what it still needs before review. |
Contributor
Author
|
Closing in favour of a version where the boot loader copies the panel power tables from the ADT instead of carrying them in the board device tree. |
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
Two J700 display paths were chosen by the machine compatible instead of by device tree data:
drivers/gpu/drm/apple/dcp.c(around line 7277, from 231a8f9): the T8140 DCP node int8140.dtsihadapple,iomfb-surfaces = <0>. The driver and the binding read that property as per-slot enable flags, so<0>enables nothing, anddcp_platform_probe()set surface 0 anyway when the machine wasapple,j700. The value comes from our own DTS; m1n1 does not write the property.drivers/gpu/drm/apple/iomfb_h17p.c(around line 486, from bd59a57 and 1ff0899): when the DCP node lacked one of the fiveapple,power-lut-*tables the H17P firmware asks for through the D400 provider callback, the driver answered with J700 bytes built into the driver, again only when the machine wasapple,j700, on the internal and the external processor. These tables are the panel's power model, which is board data.Change
arm64: dts: apple: t8140: enable surface 0 with the per-slot flag: the T8140 DCP node now says<1>(slot 0 enabled). The machine-gated special case and the binding note about a "legacy J700 encoding" are removed. The surface bitmap is the same as before: bit 0 only.drm/apple: iomfb_h17p: take the power LUT from the device tree only: the J700 tables (byte for byte what the driver carried, which matches disp0 in the ADT) move to the J700dcpanddcpextnodes int8140-j700.dts. The built-in copy and the machine check are gone. A table that is missing is now reported as missing and stops the transaction on every board, as a malformed one already did. The loader may still replace the internal processor's copy from the ADT (m1n1 does since its T8140 provider-table change); it writes the same bytes.Every SoC it reaches: only T8140 uses the H17P provider callback with these tables and only T8140 had the
<0>surface encoding, and the only T8140 board is J700. Other boards keep the paths they had: their surface masks do not change, and they never had a fallback table. One thing the hardware row must check: a kernel booted with an old J700 DTB (<0>, no tables) now stops at "No usable display surfaces" or a missing provider property, so the DTB has to be shipped with the kernel, as it is in our kits.Hardware result and follow-up commit
A Neo (J700) one-shot of a combined test kernel with this branch, booted on the Neo's production device tree (which still has
apple,iomfb-surfaces = <0>), lost the display:apple-drm display-subsystem: error -EINVAL: No usable display surfaces. The DTB on a lab Neo comes from the boot loader, not from the kernel being tested, so an older DTB with a newer kernel is a real case.The third commit (6a8f1aa) reads a surface list that enables no slot as the older single-index form, meaning slot 0, on every DCP, and logs an info line. No in-tree DTB carries such a list any more, so new DTBs are unaffected. The binding documents the older form.
Testing
dcp.o,iomfb_h17p.o(plus the other touched objects of the combined tree): no new warnings.apple/t8140-j700.dtbbuilds, and the decompiled DTB hasapple,iomfb-surfaces = <0x01>and the five tables on both nodes with the expected bytes.tools/testing/selftests/drivers/gpu/apple-dcp(all groups, clang with ASan/UBSan): thefirmware-providercase is rewritten for the new rule (no DT data: only the empty property answers; DT data of the exact length is sent on both processors; a wrong length or a present empty property fails) and passes along with the rest of the suite.Still to run
On Neo (T8140 J700), with this kernel and its DTB:
xxd /proc/device-tree/soc/dcp@412e00000/apple,iomfb-surfacesshows00000001.xxd /proc/device-tree/soc/dcp@412e00000/apple,power-lut-data-xshows0d000000.dmesg | grep -iE 'provider property|usable display surfaces'is empty. Before this change a boot with a loader that lacks the tables loggedmissing provider property ... using the J700 defaults.grep -c 'plane\[' /sys/kernel/debug/dri/0/state).modetest -c), and there is no D400 failure indmesg.Credit and history
The surface special case came from 231a8f9 ("drm: apple: accept the legacy J700 primary surface selection"). The table fallback came from bd59a57 ("drm: apple: retain J700 provider replies with older loaders") and 1ff0899 ("drm: apple: allow the qualified J700 provider fallback on DCPEXT"). The tables themselves and the provider transfer come from 8101a4b ("drm: apple: transfer measured H17P provider power tables"). The bytes did not change; only where they live did.
Hardware rows (combined test kernel, 2026-11-20)
This change was booted in a combined test kernel: integration/aurora 0abc2f3 plus the open gate-sweep drafts plus this and the related drafts (7.3.0-aurora-hk2/pwr1/hk3). It ran once on each lab Mac (M1 Pro J316s, M2 J413, J616s, Neo J700) and was compared against the production kernel on the same Mac, using the same silent row script:
M1 Pro, M2 and J616s matched production on every row, apart from the new counters and lines the drafts add. The Neo row found the old-DTB display regression that #2358's follow-up commit fixes.
This PR: Neo, on the production DTB (which still has iomfb-surfaces <0>): without the third commit the display subsystem refused (-EINVAL "No usable display surfaces"). With it (hk3) the display comes up: one "apple,iomfb-surfaces enables no slot: using slot 0 (single-index form)" line, eDP-1 connected, 0 kernel errors. All other Neo rows matched production (mic 5/5, camera 60x3, USB speeds).