Skip to content

selftests: apple-dcp: stub the T6030 firmware 27.2 sleep state in host fixtures - #3939

Merged
DjDeveloperr merged 1 commit into
mainfrom
fix/dcp-host-test-stubs-3815
Dec 2, 2026
Merged

DjDeveloperr merged 1 commit into
mainfrom
fix/dcp-host-test-stubs-3815

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

What: Host tests have failed on main since #3815. Seven fixtures in display-sleep-merge-tests and apple-dcp no longer compile, because the driver functions they extract now read firmware 27.2 sleep state that their stub structs don't declare. This change declares that state in the stubs and takes dcp_ext272_admitted() and the profiles' sleep layouts from the driver. It changes no driver code.

Tested: Full host-test suite in the host-tests.yml toolchain image (clang 18, gcc 13, rust 1.96.0, Python 3.14), --network=none. Head 5351f41e on main 0bc45c54: 952/952 passed. Main 0bc45c54 alone: 950/952 (apple-dcp and display-sleep-merge-tests fail). No runtime change.

Risk: two-way · none: only the host test fixtures change, and the kernel build is unchanged.

Not yet: the hosted Host tests run on this PR.

Details

The fixtures compile production functions from drivers/gpu/drm/apple against hand-written stub structs. The two #3815 commits below added fields and calls those functions now use:

Fixture What the driver now reads From
display-sleep-merge-tests (prepare) dcp_platform_prepare() returns early on dcp->ext272 7d82fde
apple-dcp v27-panel-handoff apple_dcp_hw_t6030 sets .afk_name_fallback, .v27_early_stop and .s2r_layout = &dcp_s2r_t6030 7d82fde, f35156e
apple-dcp t6041-v27-admission, t8122-dcpext-v27-admission dcp_check_firmware_version() calls dcp_ext272_admitted() 7d82fde
apple-dcp service-rebind afk_recv_handle_init() reads hw.afk_name_fallback. afk_v2_receive() reads ep->j516s_panel_service and sleep_v27_closed (now an enum, DCP_V27_TX_LIVE), and calls dev_info_ratelimited() f35156e, 7d82fde
apple-dcp provider-admission, ordered-rx dcp_afkep() looks up dcp->v27_early_svc_ep[] 7d82fde

The fixes:

  • The new fields are declared in each stub.
  • sleep_v27_closed copies the driver's enum.
  • dcp_ext272_admitted() is added to the extracted firmware selector. Its of_property_read_u32() stub returns -ENOENT, and no fixture uses a t6030-dcpext node, so the selector's answers don't change.
  • The dcp_s2r_layout struct and every layout the four profiles name are taken from dcp-internal.h and dcp.c.
  • dev_info_ratelimited() is counted like dev_info().

No scenario sets the new state, so every fixture still exercises the same paths and assertions as before. The TAP count stays at 101.

Fixes: 7d82fde ("drm/apple: restore the T6030 firmware 27.2 display after sleep"), f35156e ("drm/apple: dcp: enable AFK init-prop name fallback on T6030 internal DCP").

Evidence

Image: ubuntu 24.04 with the host-tests.yml pins (clang 18.1.3, gcc 13.3.0, rustc 1.96.0, Python 3.14.10). Every run used --network=none and --security-opt seccomp=unconfined.

python3 -I tools/asahi/run-host-tests.py --jobs 8                              # full suite
python3 -I tools/asahi/run-host-tests.py --jobs 4 --only display-sleep-merge
python3 -I tools/asahi/run-host-tests.py --jobs 4 --only apple-dcp
Tree Full suite display-sleep-merge apple-dcp TAP
main deedd808 not run FAIL: prepare.c: no member named 'ext272' in 'struct apple_dcp' 6 not ok (40, 41, 42, 45, 46, 47), all compile errors
main 0bc45c54 (DTS-only changes since deedd808) 950/952, 336 s FAIL FAIL
this PR 5351f41e (tree f5893778) 952/952, 303 s ok, 17/17 merge-boundary runs 101/101 ok

Per-job comparison of the two full runs: only apple-dcp and display-sleep-merge-tests differ (FAIL → ok). There are no new failures.

…t fixtures

Since "drm/apple: restore the T6030 firmware 27.2 display after sleep"
and "drm/apple: dcp: enable AFK init-prop name fallback on T6030
internal DCP", the production functions these host fixtures extract read
state that their stub structs don't declare, so seven fixtures no longer
compile:

- display-sleep-merge-tests: dcp_platform_prepare() returns early for a
  27.2 idle-only dcpext (dcp->ext272).
- apple-dcp v27-panel-handoff: the T6030 profile names dcp_s2r_t6030 and
  sets afk_name_fallback and v27_early_stop.
- apple-dcp t6041-v27-admission and t8122-dcpext-v27-admission:
  dcp_check_firmware_version() calls dcp_ext272_admitted().
- apple-dcp service-rebind: afk_recv_handle_init() reads
  hw.afk_name_fallback, and afk_v2_receive() reads
  ep->j516s_panel_service and the sleep_v27_closed gate (now an enum)
  and logs with dev_info_ratelimited().
- apple-dcp provider-admission and ordered-rx: dcp_afkep() also looks up
  dcp->v27_early_svc_ep[].

Declare the new fields in the stubs, take dcp_ext272_admitted() and the
profiles' sleep layouts from the driver, and count dev_info_ratelimited()
like dev_info(). No scenario sets the new state, so every fixture checks
the same paths as before.

Fixes: 7d82fde ("drm/apple: restore the T6030 firmware 27.2 display after sleep")
Fixes: f35156e ("drm/apple: dcp: enable AFK init-prop name fallback on T6030 internal DCP")
Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr
DjDeveloperr requested review from a team as code owners December 2, 2026 14:18

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The three Python fixture files now declare the driver state their extracted functions use. The admission helper and sleep layouts are taken from production source, and the existing assertions remain. The recorded host run goes from 950/952 on main to 952/952 with this patch.

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 5351f41ea3b0 across tools/asahi/display-sleep-merge-tests.py, tools/testing/selftests/drivers/gpu/apple-dcp/boot.py, and tools/testing/selftests/drivers/gpu/apple-dcp/edid.py.

Declaring the new #3815 fields in the fixture stubs and extracting dcp_ext272_admitted() and dcp_s2r_layout / layouts directly from production source keeps the fixtures faithful without touching driver code or weakening any existing assertions. Verified locally at exact head 5351f41ea3b0: display-sleep-merge-tests.py passes (17/17 merge-boundary runs including runtime controls), apple-dcp/run.py --group boot passes (6/6, including v27-panel-handoff, t6041-v27-admission, t8122-dcpext-v27-admission), and apple-dcp/run.py --group edid passes (4/4, including service-rebind, provider-admission, ordered-rx), matching your 952/952 full-suite run. LGTM.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Merge check at head 5351f41: the local host-tests receipt (952/952 in the CI image, on parent 0bc45c5) still covers the current main 37916aa. In the 17 main commits since that parent, the only test or DCP file that changed is tools/asahi/apple-dart-isp-host-tests.py, which came from #3863 and passed 24/24 there. Hosted host-tests is still queued and is the only open gate. satchl approved this exact head. Merging pinned to 5351f41.

@DjDeveloperr
DjDeveloperr merged commit a8a6c90 into main Dec 2, 2026
3 of 6 checks passed
@DjDeveloperr
DjDeveloperr deleted the fix/dcp-host-test-stubs-3815 branch December 2, 2026 14:25
erikwb added a commit that referenced this pull request Dec 2, 2026
Reconcile the #3273 dock-display present-retirement, Type-C release, and host-test changes with main (c948713, including #2673, #3655, and #3939):

- drivers/gpu/drm/apple/dcp.c, dcp-internal.h: drop the removed dcpext_scanout_* hooks from dcp_dptx_connect_raw() and dcp_dptx_release_locked(), keep release_owed and the AFK release ticket, retain both dcp_swap_watchdog_keep() and dcp_swap_watchdog_cancel(), and keep main's dcp_typec_fw_unplug_wait() + _dcp_poweroff(dcp, pipe_unplugged) in dcp_poweroff() alongside iomfb_present_lost(dcp, true).
- drivers/gpu/drm/apple/iomfb.c: combine iomfb_retire_dropped_present_h17p() attachment reporting with main's shared iomfb_retire_present_locked_h17p() helper while keeping iomfb_present_begun_h17p() and iomfb_present_lost().
- drivers/gpu/drm/apple/iomfb_template.c, dcp_dropped_swap_test.c: record both iomfb_present_begun_h17p() attachment and present_fw_unplugs in dcp_present_begin() and dropped_test_start().
- tools/testing/selftests/drivers/gpu/apple-dcp/edid.py, lifecycle.py, tools/asahi/dock-display-replug-tests.py: keep both the AFK ticket fields in struct epic_cmd_info / apple_dcp_afkep and main's T6030 firmware 27.2 sleep stub (j516s_panel_service) in edid.py, and reconcile poweroff_replug / dock-display-replug mocks with _dcp_poweroff(), dcp_swap_watchdog_cancel(), and iomfb_retire_present_locked_h17p().

Signed-off-by: Erik Bourget <erik@ebourget.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants