mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
Add some basic unit tests for rtp. This is intended to prove the
functionality of the rtp itself, like coalescing entries, rejecting
non-disjoint values, etc.
Contrary to the other tests in xe, this is a unit test to test the
sw-side only, so it can be executed on any machine - it doesn't interact
with the real hardware. Running it produces the following output:
$ ./tools/testing/kunit/kunit.py run --raw_output-kunit \
--kunitconfig drivers/gpu/drm/xe/.kunitconfig xe_rtp
...
[01:26:27] Starting KUnit Kernel (1/1)...
KTAP version 1
1..1
KTAP version 1
# Subtest: xe_rtp
1..1
KTAP version 1
# Subtest: xe_rtp_process_tests
ok 1 coalesce-same-reg
ok 2 no-match-no-add
ok 3 no-match-no-add-multiple-rules
ok 4 two-regs-two-entries
ok 5 clr-one-set-other
ok 6 set-field
[drm:xe_reg_sr_add] *ERROR* Discarding save-restore reg 0001 (clear: 00000001, set: 00000001, masked: no): ret=-22
ok 7 conflict-duplicate
[drm:xe_reg_sr_add] *ERROR* Discarding save-restore reg 0001 (clear: 00000003, set: 00000000, masked: no): ret=-22
ok 8 conflict-not-disjoint
[drm:xe_reg_sr_add] *ERROR* Discarding save-restore reg 0001 (clear: 00000002, set: 00000002, masked: no): ret=-22
[drm:xe_reg_sr_add] *ERROR* Discarding save-restore reg 0001 (clear: 00000001, set: 00000001, masked: yes): ret=-22
ok 9 conflict-reg-type
# xe_rtp_process_tests: pass:9 fail:0 skip:0 total:9
ok 1 xe_rtp_process_tests
# Totals: pass:9 fail:0 skip:0 total:9
ok 1 xe_rtp
...
Note that the ERRORs in the kernel log are expected since it's testing
incompatible entries.
v2:
- Use parameterized table for tests (Michał Winiarski)
- Move everything to the xe_rtp_test.ko and only add a few exports to the
right namespace
- Add more tests to cover FIELD_SET, CLR, partially true rules, etc
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Maarten Lankhorst<maarten.lankhorst@linux.intel.com> # v1
Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
Link: https://lore.kernel.org/r/20230401085151.1786204-7-lucas.demarchi@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
98 lines
2.6 KiB
Plaintext
98 lines
2.6 KiB
Plaintext
# SPDX-License-Identifier: GPL-2.0-only
|
|
config DRM_XE_WERROR
|
|
bool "Force GCC to throw an error instead of a warning when compiling"
|
|
# As this may inadvertently break the build, only allow the user
|
|
# to shoot oneself in the foot iff they aim really hard
|
|
depends on EXPERT
|
|
# We use the dependency on !COMPILE_TEST to not be enabled in
|
|
# allmodconfig or allyesconfig configurations
|
|
depends on !COMPILE_TEST
|
|
default n
|
|
help
|
|
Add -Werror to the build flags for (and only for) xe.ko.
|
|
Do not enable this unless you are writing code for the xe.ko module.
|
|
|
|
Recommended for driver developers only.
|
|
|
|
If in doubt, say "N".
|
|
|
|
config DRM_XE_DEBUG
|
|
bool "Enable additional driver debugging"
|
|
depends on DRM_XE
|
|
depends on EXPERT
|
|
depends on !COMPILE_TEST
|
|
default n
|
|
help
|
|
Choose this option to turn on extra driver debugging that may affect
|
|
performance but will catch some internal issues.
|
|
|
|
Recommended for driver developers only.
|
|
|
|
If in doubt, say "N".
|
|
|
|
config DRM_XE_DEBUG_VM
|
|
bool "Enable extra VM debugging info"
|
|
default n
|
|
help
|
|
Enable extra VM debugging info
|
|
|
|
Recommended for driver developers only.
|
|
|
|
If in doubt, say "N".
|
|
|
|
config DRM_XE_DEBUG_MEM
|
|
bool "Enable passing SYS/VRAM addresses to user space"
|
|
default n
|
|
help
|
|
Pass object location trough uapi. Intended for extended
|
|
testing and development only.
|
|
|
|
Recommended for driver developers only.
|
|
|
|
If in doubt, say "N".
|
|
|
|
config DRM_XE_SIMPLE_ERROR_CAPTURE
|
|
bool "Enable simple error capture to dmesg on job timeout"
|
|
default n
|
|
help
|
|
Choose this option when debugging an unexpected job timeout
|
|
|
|
Recommended for driver developers only.
|
|
|
|
If in doubt, say "N".
|
|
|
|
config DRM_XE_KUNIT_TEST
|
|
tristate "KUnit tests for the drm xe driver" if !KUNIT_ALL_TESTS
|
|
depends on DRM_XE && KUNIT && DEBUG_FS
|
|
default KUNIT_ALL_TESTS
|
|
select DRM_EXPORT_FOR_TESTS if m
|
|
select DRM_KUNIT_TEST_HELPERS
|
|
help
|
|
Choose this option to allow the driver to perform selftests under
|
|
the kunit framework
|
|
|
|
Recommended for driver developers only.
|
|
|
|
If in doubt, say "N".
|
|
|
|
config DRM_XE_LARGE_GUC_BUFFER
|
|
bool "Enable larger guc log buffer"
|
|
default n
|
|
help
|
|
Choose this option when debugging guc issues.
|
|
Buffer should be large enough for complex issues.
|
|
|
|
Recommended for driver developers only.
|
|
|
|
If in doubt, say "N".
|
|
|
|
config DRM_XE_USERPTR_INVAL_INJECT
|
|
bool "Inject userptr invalidation -EINVAL errors"
|
|
default n
|
|
help
|
|
Choose this option when debugging error paths that
|
|
are hit during checks for userptr invalidations.
|
|
|
|
Recomended for driver developers only.
|
|
If in doubt, say "N".
|