Skip to content

drm/apple: test apple_typec_port_rgb8_only() - #2833

Open
RyanTheTide wants to merge 1 commit into
integration/aurorafrom
test-coverage/typec-rgb8-only
Open

RyanTheTide wants to merge 1 commit into
integration/aurorafrom
test-coverage/typec-rgb8-only

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Problem

apple_typec_port_rgb8_only() (from #2783) decides whether a Type-C connector gets the BT.2020/PQ output properties: it must not when any pipeline that can drive the port runs the native26 (ext26) method set, which scans out XRGB8888 only. It had no test.

Change

Make the function visible to KUnit (VISIBLE_IF_KUNIT; builds without KUnit are unchanged) and add topology_rgb8_only_test to the apple-dcp-topology suite. It registers four ports over a 10-bit pipeline, an ext26 pipeline and one without drvdata. It then checks the any-pipeline and single-pipeline scopes, the port-candidate filter, a candidate without drvdata being skipped, a port with no routes, and an index past the last port. No functional change.

Testing

  • KUnit, arm64 qemu, LLVM=1, tests/topology.kunitconfig: apple-dcp-topology 7/7 (6/6 before). All suites in that config: 201 of 202 pass, with 1 skip (apple_g17_rx_util_min_test needs CONFIG_UCLAMP_TASK, unrelated).
  • Negative controls: 4 mutants of the function, and the new test kills all 4. Without the pipeline filter, 2 expectations fail. Without the candidate filter, 4 fail. Returning on the first candidate fails 3. Without the NULL drvdata check, the function oopses and KUnit marks the test failed.
  • checkpatch.pl --strict: clean.

Still to run

  • Nothing on hardware (test-only).

Assisted-by: LLM (Claude:Opus 5.5)

apple_typec_port_rgb8_only() decides whether a Type-C connector gets the
BT.2020/PQ output properties: it must not when any pipeline that can drive
the port runs the native26 (ext26) IOMFB method set, which scans out
XRGB8888 only. It had no test.

Make it visible to KUnit (VISIBLE_IF_KUNIT, no change for non-KUnit
builds) and add topology_rgb8_only_test to the apple-dcp-topology suite.
It registers four ports over a 10-bit pipeline, an ext26 one and one
without drvdata, and checks: no pipelines; any pipeline with an ext26
candidate after a 10-bit one; a single pipeline counting only its own
method set, including one that is not a candidate for the port; a port
the ext26 pipeline cannot drive; a candidate without drvdata being
skipped; a port without routes and an index past the last port.

No functional change.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Review at 17db3f1.

The test calls the real apple_typec_port_rgb8_only() (made non-static through VISIBLE_IF_KUNIT; the test is #included into dcp-fabric.c in the same appledrm module, so no export is needed) and the real dcp_typec_port_has_candidate() over ports added to the real dcp_typec_ports list. Non-KUnit builds are unchanged. Fine to merge. Two notes:

  1. drivers/gpu/drm/apple/dcp-fabric-topology-test.c:488: no case has the ext26 pipeline at index 0 of dcp[] (all puts it at 1, nodata_first at 2). The mutant for (i = 1; ...) at apple_drv.c:1279 survives. Adding { ext26, plain, nodata } with NULL, both -> true would kill it.
  2. CI: tests/topology.kunitconfig is not run by any workflow. host-tests.yml runs tools/asahi/run-host-tests.py, which does not touch KUnit, and mt7932-kunit.yml is wifi only. The new case runs only by hand. This gap predates this PR, but the suite's coverage claims depend on it.

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.

1 participant