Repository navigation
drm/apple, drm/asahi: compile the DCP audio and G16 tests in KUnit CI - #4011
Conversation
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>
RyanTheTide
left a comment
There was a problem hiding this comment.
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.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
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). Inasahi, the three other G16 cases go from skipped to passed. - No KUnit suite is gated on the new options being off.
kunit.py configresolves both files. Both KUnit kernels link at this head, and on its merge withmain49fa570626f5(compile only there, not run).- The hosted
apple-buildjob 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'.
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>
What: Hosted KUnit never compiles the G16 cases in
drivers/gpu/drm/asahi/fwid.rs(for example #3986'st8122_26b123_zeroes_what_iboot_fills) or the DCP audio and native A/V cases (#4001). Theasahikunitconfig leavesDRM_ASAHI_G16off and thedcp-displayone has no sound. Turn both on.Tested: no runtime change (two KUnit configurations). At
9ec1db90647bonmainb924bf47f0c9: 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
KUnitjob runs them.Details
asahi:DRM_ASAHI_G16isdefault y, but it depends onDRM_APPLE=y,DRM_APPLE_DCP_T8132(which needsAPPLE_DART=yandAPPLE_DART_J713_DCP) andTHERMAL_OF. The list is what it takes to resolve it; withoutTHERMALit drops out.APPLE_RTKIT,APPLE_PMPand the mailbox are already selected.DRM_APPLE=yalso turns onDRM_ASAHI_G15(default y), which compiles but adds no KUnit suite.dcp-display:SNDbrings inaudio.cwithapple-dcpaud-legacy(11 cases), the link suite (23) and the no-SIO case, andDRM_APPLE_DCP_T6030_AUDIOthe two native A/V suites (18 and 17 cases).DMADEVICESgives the no-SIO case theDMA_OFit skips without.DRM_ASAHI_G16,DRM_APPLE_AUDIOandDRM_APPLE_DCP_T6030_AUDIOare on by default once their dependencies are there. They are listed so thatkunit.pyfails if a dependency change drops one.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 usedmain53732c475cb2; the two files are the same onb924bf47f0c9.kunit.py config --arch=arm64withmain'sdrivers/gpu/drm/asahi/.kunitconfigCONFIG_DRM_ASAHI_G16, noCONFIG_DRM_APPLECONFIG_DRM_ASAHI_G16=y, nothing missingkunit.py configwithmain'sdisplay.kunitconfigplus this PR's linesSND,DMA_OF,DRM_APPLE_AUDIO,DRM_APPLE_DCP_T6030_AUDIOall=y, nothing missingmake drivers/gpu/drm/asahi/, thenvmlinux(asahi)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_fillsmake drivers/gpu/drm/apple/, thenvmlinux(display)dcpaud_legacy_suite,dcpaud_link_suite,dcpaud_no_sio_suite,av_v14_suite,av_lifetime_suiteinvmlinuxapple-kunit.py planon the two filesdcp-fabric dcp-topology dcp-display asahi, one jobcheckpatch.pl --strictCONFIG_WERRORis off in both resolved configurations, as onmain. The asahi crate prints dead-code warnings there (47 in this build).