Skip to content

drm/apple, drm/asahi: compile the DCP audio and G16 tests in KUnit CI - #4011

Merged
DjDeveloperr merged 2 commits into
mainfrom
ci/kunit-compile-g16-dcp-audio
Dec 3, 2026
Merged

DjDeveloperr merged 2 commits into
mainfrom
ci/kunit-compile-g16-dcp-audio

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

What: Hosted KUnit never compiles the G16 cases in drivers/gpu/drm/asahi/fwid.rs (for example #3986's t8122_26b123_zeroes_what_iboot_fills) or the DCP audio and native A/V cases (#4001). The asahi kunitconfig leaves DRM_ASAHI_G16 off and the dcp-display one has no sound. Turn both on.

Tested: no runtime change (two KUnit configurations). At 9ec1db90647b on main b924bf47f0c9: both configurations resolve, and both KUnit kernels compile and link for arm64. Built, not run.

Risk: two-way door · none. Only KUnit kernels read these files.

Not yet: the added cases were not executed here (no QEMU on our hosts). This PR's own KUnit job runs them.

Details
  • asahi: DRM_ASAHI_G16 is default y, but it depends on DRM_APPLE=y, DRM_APPLE_DCP_T8132 (which needs APPLE_DART=y and APPLE_DART_J713_DCP) and THERMAL_OF. The list is what it takes to resolve it; without THERMAL it drops out. APPLE_RTKIT, APPLE_PMP and the mailbox are already selected. DRM_APPLE=y also turns on DRM_ASAHI_G15 (default y), which compiles but adds no KUnit suite.
  • dcp-display: SND brings in audio.c with apple-dcpaud-legacy (11 cases), the link suite (23) and the no-SIO case, and DRM_APPLE_DCP_T6030_AUDIO the two native A/V suites (18 and 17 cases). DMADEVICES gives the no-SIO case the DMA_OF it skips without.
  • DRM_ASAHI_G16, DRM_APPLE_AUDIO and DRM_APPLE_DCP_T6030_AUDIO are on by default once their dependencies are there. They are listed so that kunit.py fails if a dependency change drops one.
  • drm/apple: power off idle firmware-27 external display processors #3410 recorded the same display options on arm64 QEMU at 9f33c3f95939 (with debug mutexes): 294 run, 293 passed, 1 skipped. That was before drm/apple: audio: free the test PCM preallocation with an exported call #4001.
Evidence

Host x86_64, clang 23.1.3, rustc 1.99.0 and the tree's tools/aurora-bindgen, ARCH=arm64 LLVM=1. The builds used main 53732c475cb2; the two files are the same on b924bf47f0c9.

check result
kunit.py config --arch=arm64 with main's drivers/gpu/drm/asahi/.kunitconfig no CONFIG_DRM_ASAHI_G16, no CONFIG_DRM_APPLE
same with this PR's file CONFIG_DRM_ASAHI_G16=y, nothing missing
kunit.py config with main's display.kunitconfig plus this PR's lines SND, DMA_OF, DRM_APPLE_AUDIO, DRM_APPLE_DCP_T6030_AUDIO all =y, nothing missing
make drivers/gpu/drm/asahi/, then vmlinux (asahi) rc 0; kunit_rust_wrapper_ symbols for the four G16-only cases: j713_accepts_all_loaded_images, j773g_accepts_its_loaded_image, t8132_25g83_b000_zeroes_what_iboot_fills, t8122_26b123_zeroes_what_iboot_fills
make drivers/gpu/drm/apple/, then vmlinux (display) rc 0; dcpaud_legacy_suite, dcpaud_link_suite, dcpaud_no_sio_suite, av_v14_suite, av_lifetime_suite in vmlinux
apple-kunit.py plan on the two files dcp-fabric dcp-topology dcp-display asahi, one job
checkpatch.pl --strict 0 errors, 0 warnings, 0 checks

CONFIG_WERROR is off in both resolved configurations, as on main. The asahi crate prints dead-code warnings there (47 in this build).

The hosted asahi suite leaves DRM_ASAHI_G16 off, because its kunitconfig
has none of the display options the backend depends on. The G16 cases in
fwid.rs, such as t8122_26b123_zeroes_what_iboot_fills(), are therefore
never compiled. The hosted dcp-display suite has no sound, so it drops
audio.c and with it the DP audio cases, and the native A/V cases in av.c
that depend on DRM_APPLE_DCP_T6030_AUDIO.

Enable both. The options that are on by default are listed too, so that
kunit.py fails if a later dependency change drops one of them.

DMADEVICES gives the dcpaud_no_sio case the DMA_OF it skips without.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr
DjDeveloperr requested review from a team as code owners December 2, 2026 23:10
RyanTheTide
RyanTheTide previously approved these changes Dec 2, 2026

@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 change is confined to the two KUnit configs. Both resolve the requested dependencies and the reported linked kernels contain the G16, DCP audio and native A/V test symbols. The explicit options will catch future Kconfig drift. Hosted execution remains pending.

@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) blast:none Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) ready-to-merge Meets the merge policy: merge it (bot) labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Merge readiness at 95a41d2f: not ready yet

Check Detail
CI at head running running: apple-build, host-tests, KUnit plan
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok not needed: no runtime change
Conflicts ok none
PR text ok Risk: two-way · none. Only KUnit kernels read these files.

Areas: area:display, area:gpu

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@github-actions github-actions Bot removed the ready-to-merge Meets the merge policy: merge it (bot) label Dec 2, 2026

@DjDeveloperr DjDeveloperr left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Don't merge yet: the asahi suite fails at 9ec1db90647b. The PR's own KUnit job never ran (the pull_request_target run ended in startup_failure), so I dispatched it on this branch: run 46992952689.

suite last green hosted runs, 12-02 this head
dcp-fabric 117 passed 117 passed
dcp-topology 236 passed, 1 skipped the same
dcp-display 225 passed, 1 skipped 313 passed, 1 skipped
asahi 570 passed, 4 skipped 574 passed, 1 skipped, 1 failed

The failure: asahi_fwid:t8122_26b123_zeroes_what_iboot_fills, unwrap() on None at fwid.rs:663. This is the case #3986 added. It had not run in hosted KUnit before, and this PR is what compiles it there.

It is the test, not the driver. The helper measured() hard-codes a 0x60000 TEXT, but the T8122 26B123 build is 0x64000, so lookup() can't match. The assertions before it, on the filled ranges, pass. The J613 row in #3986 shows the driver admitting that firmware.

Fix, for this branch or ahead of it. I ran the test body on the host with the real lookup() and table: it panics at the same unwrap() before, and passes after. It also compiles for arm64 with this PR's asahi configuration (not run there).

-        let found = measured(builds, 0xbc000, &[[gkts, ecap]], build.text_sha256).unwrap();
-        assert!(core::ptr::eq(found, build));
-        assert!(measured(builds, 0xb8000, &[[gkts, ecap]], build.text_sha256).is_none());
-        assert!(measured(builds, 0xbc000, &[[gkts, ecap]], [0; 32]).is_none());
+        // `measured` stands for a 0x60000 TEXT; this one is larger.
+        let at = |data_size, digest| {
+            lookup(builds, build.text_size, data_size, |b| {
+                (b.entropy == [[gkts, ecap]]).then_some(digest)
+            })
+        };
+        assert!(core::ptr::eq(at(0xbc000, build.text_sha256).unwrap(), build));
+        assert!(at(0xb8000, build.text_sha256).is_none());
+        assert!(at(0xbc000, [0; 32]).is_none());

The configuration itself is right.

  • No test that ran before is gone, in any of the four suites. Added: 88 tests in dcp-display (the five audio and native A/V suites, all passing). In asahi, the three other G16 cases go from skipped to passed.
  • No KUnit suite is gated on the new options being off.
  • kunit.py config resolves both files. Both KUnit kernels link at this head, and on its merge with main 49fa570626f5 (compile only there, not run).
  • The hosted apple-build job passed at this head.

Needed to merge: the test fix, then a green run of dcp-fabric dcp-topology dcp-display asahi at the new head: gh workflow run apple-build-kunit.yml --ref <branch> -f suites='dcp-fabric dcp-topology dcp-display asahi'.

@github-actions github-actions Bot added the ready-to-merge Meets the merge policy: merge it (bot) label Dec 2, 2026
t8122_26b123_zeroes_what_iboot_fills uses measured(), which stands for a
0x60000 TEXT. This build's TEXT is 0x64000, so lookup() finds nothing and
the case panics now that the G16 configuration compiles it. Look the build
up with its own TEXT size. Test only.

Signed-off-by: DjDeveloperr <hey@djdev.me>
@github-actions github-actions Bot added needs-review No approving review from Core or Omarchy Mac yet (bot) and removed ready-to-merge Meets the merge policy: merge it (bot) labels Dec 3, 2026
@RyanTheTide RyanTheTide closed this Dec 3, 2026
@RyanTheTide RyanTheTide reopened this Dec 3, 2026
@DjDeveloperr
DjDeveloperr merged commit efe28a2 into main Dec 3, 2026
15 of 18 checks passed
@DjDeveloperr
DjDeveloperr deleted the ci/kunit-compile-g16-dcp-audio branch December 3, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:display Area from CODEOWNERS (bot) area:gpu Area from CODEOWNERS (bot) blast:none Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants