Repository navigation
drm/apple: dpavservep: test which AV service announcements are admitted - #2820
Conversation
dcpavserv_identity() decides which announced DP/HDMI AV service the AV client takes: the classic AFK wire (unit 0), the AFKV2 wire on the V2 endpoint (unit equal to the channel), the AFKV2 wire on the classic DPAV endpoint (unit 0, dynamic channel) and the native26 external role (DCPDPService, unit 0). It had no test. Add a table-driven KUnit suite, apple-dcpavserv-identity, that runs the function on a fake service, endpoint and DCP for 30 announcements: each admitted shape and the class, unit, channel and endpoint mismatches next to it, including the channel bounds (0 and over U16_MAX). No functional change. With dcpavserv_identity() as it was before the classic-endpoint AFKV2 case was added, the three "v2 ep 0x28" admit rows fail and the other 27 pass. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Review at 96e069a. The suite calls the real Non-blocking:
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial §1–§6 review at 96e069ad52d1f0b7455c654c6bd2ab0cb7710aa6: APPROVE (ready for MERGETRAIN-LINUX4).
Diff & Test Verification
- Zero functional kernel change: Only
drivers/gpu/drm/apple/epic/dpavservep-identity-test.c(+143) and a single#include "dpavservep-identity-test.c"inside the existing#if IS_ENABLED(CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST)block atdpavservep.c:830(+1). Production code is untouched. - Coverage & branch fidelity: Verified all 30 rows in
dpavid_cases[]againststatic bool dcpavserv_identity()(dpavservep.c:37-59). Because the test is#included intodpavservep.c, it exercises the real static production function, not a copy. Every admission shape and every guard condition has a discriminating row:- Name gate (
NULLand non-matching strings across legacy, v2, ext26). - Classic wire (
!wire_v2:unit == 0admitted regardless of class/channel;unit == 1refused). - AFKV2 on
DPAVSERV_ENDPOINT_V2(0x2a): both allowed classes (AppleDCPDP2HDMI,DCPDP13Service),unit == channelin1..U16_MAX, plus mismatch,unit == 0,channel == 0(catches!service->channeleven whenunit == channel == 0),channel > U16_MAX,NULLclass, and wrong class. - AFKV2 on
DPAVSERV_ENDPOINT(0x28, from #2783): both allowed classes withunit == 0and channel1..U16_MAX, plusunit == channel,channel == 0,channel > U16_MAX,NULLclass, and wrong class. - AFKV2 on other endpoint (
0x29) refused. - Native26 external role (
dcp_is_ext26()asserted true viaDCP_IOMFB_METHODS_J613_EXT26):DCPDPService+unit == 0+ nonzero channel +DPAVSERV_ENDPOINTonly, with individual refusal rows for unit, channel, class, andDPAVSERV_ENDPOINT_V2.
- Name gate (
- Negative control validity: Reverting
dcpavserv_identity()to pre-#2783 (DPAVSERV_ENDPOINT_V2only for AFKV2) flips the threev2 ep 0x28admit rows (rows 16–18) while leaving the remaining 27 passing.
§1–§6 Checklist
- §1 No model gating: Pass (test-only; uses existing
DCP_IOMFB_METHODS_J613_EXT26enum solely to drive the existingdcp_is_ext26()branch). - §2 Production-ready / no hacks: Pass (zero production changes).
- §3 Safety: Pass (test-only).
- §4 Clean-room & attribution: Pass (single commit with human author/committer + human
Signed-off-by:only, zero AI trailers in commit; PR body disclosesAssisted-by:). - §5 Evidence: Pass for test-only PR (
kunit.py run --arch=arm6443/43 pass + negative control reported; CIhost-testsgreen). - §6 Naming: Pass.
Non-blocking Notes
dpavservep-identity-test.c:88:0x29can useAV_ENDPOINT(already in scope from../dcp-internal.h:108) for readability.- CI (
host-tests.yml) does not currently build/runCONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST(same existing gap asdpavservep-v14-test.c); wiring both display KUnit suites into CI as a follow-up would keep regressions caught automatically.
Assisted-by: LLM (Gemini 4 Neon)
|
Merge-train adversarial review (MERGETRAIN-LINUX4) at 96e069a: no blockers. Merges clean on integration/aurora. Full reviewVERDICT: NO BLOCKERS
Nits (non-blocking, same as the earlier review): use Assisted-by: LLM (Claude:Opus 5.5) |
|
Post-merge run at integration/aurora 120d6aa (the merge of this PR), kunit.py arm64/qemu, LLVM=1, display kunitconfig: apple-dcpavserv-identity 30/30, together with apple-dcpavserv-v14 43/43, same as before the merge. No CI job runs these suites yet, so they are only checked when run by hand. |
Problem.
dcpavserv_identity()picks which announced DP/HDMI AV service the AV client takes. It now has four admission shapes (classic AFK wire; AFKV2 on the V2 endpoint; AFKV2 on the classic DPAV endpoint, added for the M3/M4 Air in #2783; the native26 external role), and none of them had a test.Change. A table-driven KUnit suite,
apple-dcpavserv-identity, runs the production function on a fake service, endpoint and DCP. It has 30 rows: each admitted shape, plus the class, unit, channel and endpoint mismatches around it, including the channel bounds (0 and overU16_MAX). It's included fromdpavservep.cunderCONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST, like the existingapple-dcpavserv-v14suite. Tests only, no functional change.Testing.
kunit.py run --arch=arm64(qemu, LLVM=1), filterapple-dcpavserv*: 43/43 pass (13 existing v14 cases + 30 new rows).dcpavserv_identity()as it was before drm/apple: read the external monitor's EDID on the M3/M4 Air (27.x) and offer HDR there #2783, the threev2 ep 0x28admit rows fail and the other 27 pass.Still to run. Nothing on hardware: the change is test-only.
kunitconfig and command
./tools/testing/kunit/kunit.py run --arch=arm64 --make_options LLVM=1 --kunitconfig=<above> 'apple-dcpavserv*'Rows (role, endpoint): name gate on every role; legacy unit 0 admitted with any class/channel, unit 1 refused; v2 on 0x2a needs AppleDCPDP2HDMI/DCPDP13Service with unit == channel, 1..0xffff; v2 on 0x28 needs the same classes, unit 0 and channel 1..0xffff, and refuses unit == channel; v2 on another endpoint refused; native26 needs DCPDPService, unit 0, nonzero channel, endpoint 0x28 only.
Assisted-by: LLM (Claude:Opus 5.5)