[Intel-xe] [PATCH 0/5] drm/xe: Introduce new selftests framework

Michal Wajdeczko michal.wajdeczko at intel.com
Sun Mar 12 20:35:16 UTC 2023


Existing solution has many limitations. With proposed here we can test
every new bound device, write tests in a simpler way, without creating
separate test module for every group of tests, and use same style for
both mock and live tests.

Also Kunit parsing works better (which might be needed by our CI).

And with little more effort, patches pending, we can add support for
rerunning tests on selected device and filtering tests to be executed.

Sample output from mock run:

[ ] Starting KUnit Kernel (1/1)...
[ ] ============================================================
[ ] ================= device_mock (2 subtests) =================
[ ] [PASSED] test_basic
[ ] [PASSED] test_to_gt
[ ] =================== [PASSED] device_mock ===================
[ ] =================== gt_mock (2 subtests) ===================
[ ] [PASSED] test_basic
[ ] [PASSED] test_to_xe
[ ] ===================== [PASSED] gt_mock =====================
[ ] =================== guc_mock (1 subtest) ===================
[ ] [PASSED] test_basic
[ ] ==================== [PASSED] guc_mock =====================
[ ] ================= guc_ct_mock (1 subtest) ==================
[ ] [PASSED] test_basic
[ ] =================== [PASSED] guc_ct_mock ===================
[ ] ============================================================
[ ] Testing complete. Ran 6 tests: passed: 6

Sample output from live run with "dut_filter=*"

[ ] ============================================================
[ ] ================= device_live (2 subtests) =================
[ ] [PASSED] test_to_gt
[ ] [PASSED] test_guc_submission_enabled
[ ] =================== [PASSED] device_live ===================
[ ] =================== gt_live (2 subtests) ===================
[ ] [PASSED] test_gt_info
[ ] [PASSED] test_gt_is_not_media_type
[ ] ===================== [PASSED] gt_live =====================
[ ] ================== guc_live (2 subtests) ===================
[ ] [PASSED] test_guc_fw
[ ] [SKIPPED] test_guc_rejects_unknown_action
[ ] ==================== [PASSED] guc_live =====================
[ ] =================== ct_live (2 subtests) ===================
[ ] [PASSED] test_ct_not_broken
[ ] [PASSED] test_ct_rejects_unknown_action
[ ] ===================== [PASSED] ct_live =====================
[ ] ============================================================
[ ] Testing complete. Ran 8 tests: passed: 7, skipped: 1

Sample raw output from live run with "anonymous_dut=1"

[ ] [drm] Initialized xe 1.1.0 20201103 for 0000:00:02.0 on minor 0
[ ]     # device_live: DUT 0000:00:02.0
[ ]     # Subtest: device_live
[ ]     1..2
[ ]     ok 1 - test_to_gt
[ ]     ok 2 - test_guc_submission_enabled
[ ] # device_live: pass:2 fail:0 skip:0 total:2
[ ] # Totals: pass:2 fail:0 skip:0 total:2
...

Sample raw output from live run with "anonymous_dut=0"

[ ]     # device_live:     # failed to initialize (-25)
[ ] not ok 1 - device_live
...

Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
Cc: Mauro Carvalho Chehab <mauro.chehab at linux.intel.com>

Michal Wajdeczko (5):
  drm/xe: Introduce new selftests framework
  drm/xe: Initial selftests for xe_device
  drm/xe: Initial selftests for xe_gt
  drm/xe: Initial selftests for xe_guc
  drm/xe: Initial selftests for xe_guc_ct

 drivers/gpu/drm/xe/Kconfig.debug              |  22 ++++
 drivers/gpu/drm/xe/Makefile                   |  11 ++
 .../selftests/live/xe_device_live_selftest.c  |  39 ++++++
 .../xe/selftests/live/xe_gt_live_selftest.c   |  40 ++++++
 .../selftests/live/xe_guc_ct_live_selftest.c  |  52 ++++++++
 .../xe/selftests/live/xe_guc_live_selftest.c  |  54 ++++++++
 .../selftests/mock/xe_device_mock_selftest.c  |  41 ++++++
 .../xe/selftests/mock/xe_gt_mock_selftest.c   |  40 ++++++
 .../selftests/mock/xe_guc_ct_mock_selftest.c  |  31 +++++
 .../xe/selftests/mock/xe_guc_mock_selftest.c  |  30 +++++
 drivers/gpu/drm/xe/selftests/xe_selftests.h   |  35 ++++++
 .../gpu/drm/xe/selftests/xe_selftests_auto.c  |  46 +++++++
 .../drm/xe/selftests/xe_selftests_executor.c  | 118 ++++++++++++++++++
 .../drm/xe/selftests/xe_selftests_helpers.c   | 101 +++++++++++++++
 .../drm/xe/selftests/xe_selftests_internal.h  |  22 ++++
 .../gpu/drm/xe/selftests/xe_selftests_mock.c  |  32 +++++
 .../drm/xe/selftests/xe_selftests_params.c    |  23 ++++
 drivers/gpu/drm/xe/xe_device.c                |   6 +
 drivers/gpu/drm/xe/xe_gt.c                    |   6 +
 drivers/gpu/drm/xe/xe_guc.c                   |   6 +
 drivers/gpu/drm/xe/xe_guc_ct.c                |   6 +
 drivers/gpu/drm/xe/xe_module.c                |   2 +
 22 files changed, 763 insertions(+)
 create mode 100644 drivers/gpu/drm/xe/selftests/live/xe_device_live_selftest.c
 create mode 100644 drivers/gpu/drm/xe/selftests/live/xe_gt_live_selftest.c
 create mode 100644 drivers/gpu/drm/xe/selftests/live/xe_guc_ct_live_selftest.c
 create mode 100644 drivers/gpu/drm/xe/selftests/live/xe_guc_live_selftest.c
 create mode 100644 drivers/gpu/drm/xe/selftests/mock/xe_device_mock_selftest.c
 create mode 100644 drivers/gpu/drm/xe/selftests/mock/xe_gt_mock_selftest.c
 create mode 100644 drivers/gpu/drm/xe/selftests/mock/xe_guc_ct_mock_selftest.c
 create mode 100644 drivers/gpu/drm/xe/selftests/mock/xe_guc_mock_selftest.c
 create mode 100644 drivers/gpu/drm/xe/selftests/xe_selftests.h
 create mode 100644 drivers/gpu/drm/xe/selftests/xe_selftests_auto.c
 create mode 100644 drivers/gpu/drm/xe/selftests/xe_selftests_executor.c
 create mode 100644 drivers/gpu/drm/xe/selftests/xe_selftests_helpers.c
 create mode 100644 drivers/gpu/drm/xe/selftests/xe_selftests_internal.h
 create mode 100644 drivers/gpu/drm/xe/selftests/xe_selftests_mock.c
 create mode 100644 drivers/gpu/drm/xe/selftests/xe_selftests_params.c

-- 
2.25.1



More information about the Intel-xe mailing list