Repository navigation
Conversation
|
New commit a2f3d03: "tests: cover the T8152 DCP hand-off state". The pytest jobs failed because two harnesses copy the code this PR changes verbatim:
Locally
|
|
Thanks for the injected-failure runs, they cover both quiesce paths nicely. One request while neither side is merged: |
apple_dcpib reads /chosen/apple,dcp-rtkit-quiesced to tell an internal
DCP the loader handed over running (adopt it) from one the loader
stopped (wake it). Without the property it adopts the DCP as running.
aura quiesces the internal DCP when its display setup fails part way:
display_start_dcp() after the framebuffer DVA lookup or the iBoot
interface fails, and dcp_init() after a step that follows the RTKit
boot (AFK, or the J873g's HDMI dptx init). The kernel then adopts a
quiesced DCP and fails ("no disp0-service"). On the J873g this happened
after the iBoot interface did not come up.
Track the internal DCP's RTKit in display.c: running once dcp_init()
succeeds, and after a failed start the result of the shutdown (stopped
when quiesced, running when it did not stop). dcp_init() now reports
whether it quiesced a DCP it had booted. On T8152 display_shutdown()
leaves the controllers running for the kernel, so nothing else changes
the state. Only the internal DCP is tracked, not DCPEXT0 while it is
swapped in for the second display. dt_prepare_t8152() publishes the
state (1 running, 0 stopped) and omits the property when aura never
started the internal DCP.
Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The internal DCP's hand-off state changed display_start_dcp() and dcp_init()'s teardown, which the two harnesses copy verbatim: - test_t8152_display_fb: stub dcp_init_left_quiesced(), take display_stop_failed_dcp() along, and let the dcp_shutdown() stub return its int. New checks: the state is 1 after a good start, stays -1 on other chips and after a failed second display, and a failed internal start reports 0 when dcp_init() quiesced the RTKit it booted and 1 when it left it running. - test_legacy_table_lifetime: declare dcp_init_quiesced, which the verbatim out_rtkit label now sets. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
The value is 1 when the internal DCP runs at the hand-off and 0 when aura quiesced it, so a property named "quiesced" read backwards. apple_dcpib (aurora-silicon/linux#2176) reads the new name with the same values. Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
a2f3d03 to
e47cd4f
Compare
|
Renamed to I picked the rename over keeping the name and flipping the value, because a mismatched pair then fails safe. If an older aura meets a newer kernel, or the other way round, the kernel just finds no property and takes its existing fallback. With a flipped value it would instead read a running DCP as quiesced. The name is new, so #2176 adds a binding for it (
#300 is rebased onto the same main. Whichever of the two lands second needs only the small rebase in dcp.h/display.h/ |
apple_dcpib (aurora-silicon/linux#2176) reads
/chosen/apple,dcp-rtkit-runningto decide whether to adopt the internal DCP as running or wake it from quiesce. aura never sets the property on T8152, so the kernel always adopts the DCP. That breaks whenever aura quiesced the DCP after a failed display setup:display_start_dcp()callsdcp_shutdown()after the framebuffer DVA lookup ordcp_ib_init()fails.dcp_init()quiesces RTKit again when a step after the RTKit boot fails: the AFK init, or the J873g's HDMI dptx init.On the J873g (M6 Mac mini) this happened on the first boot after a 1TR session. The loader logged
display: failed to initialize DCP iBoot interface, apple_dcpib adopted the quiesced DCP and failed withfailed buffer request ep=0x1andno disp0-service, and the display on that DCP stayed dark.What this changes
dcp_init()succeeds.dcp_shutdown(): 0 when the DCP quiesced, 1 when it did not stop.dcp_init()it is 1 ifdcp_init()left the DCP running, and 0 if it booted RTKit and then quiesced it again. The newdcp_init_left_quiesced()reports the second case. In every other case the state is unchanged./arm-io/dcp) counts. DCPEXT0, swapped in for the second display, does not change the state.display_shutdown()returns early because the kernel owns the live controllers, so no other path changes the state.dt_prepare_t8152()publishes the state asapple,dcp-rtkit-running(1 running, 0 stopped) and logsFDT: internal DCP running|stopped at the hand-off. If aura never started the DCP, the property is left out and the kernel behaves as it does today.Hardware test (J873g, macOS 27.2)
aura main cannot launch the desktop kernel on the M6 yet (see #300). So, as with #300, the change runs on the M6's installed self-boot loader (the aura-test lineage). The functions this PR adds or changes are identical there:
display_internal_activedisplay_dcp_handoff_statedisplay_stop_failed_dcpdisplay_start_dcpdcp_init_left_quiesceddcp_init, apart from main's existingdart_init_adt_display()calldt_set_dcp_state_t8152The lineage differs in one way: it stops the DCP endpoints at the hand-off, so it also records the state in
display_shutdown().All runs were cold boots of the loader installed as Stage 1:
apple,dcp-rtkit-runningFDT: internal DCP running at the hand-offfailed to initialize DCP iBoot interfaceno disp0-service, S2431W darkdisplay_start_dcp)FDT: internal DCP running at the hand-offInjected failures (E2E on the J873g)
Both failure paths were also run on the installed loader. Each run used a test-only build of the same lineage (v0.1.0-264-gba2b5ab0 plus a few lines injecting the failure for the internal DCP), enrolled from 1TR and cold-booted with HDMI and both USB-C monitors connected.
apple,dcp-rtkit-runningdcp_ib_init()fails (as on the boot above)failed to initialize DCP iBoot interface,DCP hand-off -> 0,FDT: internal DCP stopped at the hand-offquiesced DCP wake: 0, then HDMI 2560x1440@60. All three monitors up.dcp_init()quiesces)failed to initialize DCP,DCP hand-off -> 0,FDT: internal DCP stopped at the hand-offquiesced DCP wake: 0, then a USB-C displayIn both runs the kernel woke the DCP instead of adopting a stopped one. In the second run the kernel's shared-port handling then lost HDMI, because nothing powered the PS190 so the HDMI HPD stayed low, and its USB-C EDID reads failed. Both are kernel issues, handled in aurora-silicon/linux#2176, and not related to the loader state.
Not exercised on hardware
dcp_init()failing with the DCP left running.Build: LLVM 22 with no new warnings;
git clang-formatis clean.