[PATCH 0/4] drm/xe/kunit: Simplify live tests code layout

Michal Wajdeczko michal.wajdeczko at intel.com
Mon Jul 8 11:12:06 UTC 2024


The test case logic is implemented by the functions compiled as
part of the core Xe driver module and then exported to build and
register the test suite in the live test module:

    xe.ko                         | xe_live_test.ko
    ------------------------------+-----------------------
    xe_foo.c                      | tests\xe_foo_test.c
      tests\xe_foo_test.h         |   tests\xe_foo_test.h
      tests\xe_foo.c              |   foo_suite
        foo_case_1                |     foo_case_1
        foo_case_2                |     foo_case_2
        EXPORT(foo_case_1)        |   REGISTER(foo_suite)
        EXPORT(foo_case_2)        | tests\xe_live_test.c

But we don't need to export individual test case functions, we may
just export the entire test suite. And we don't need to register
this test suite in a separate file, it can be done in the main
file of the live test module:

    xe.ko                         | xe_live_test.ko
    ------------------------------+-----------------------
    xe_foo.c                      | tests\xe_live_test.c
      tests\xe_foo.c              |   REGISTER(foo_suite)
        foo_suite                 |
	  foo_case_1              |
          foo_case_2              |
        EXPORT(foo_suite)         |  

Cc: Lucas De Marchi <lucas.demarchi at intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>

Michal Wajdeczko (4):
  drm/xe/kunit: Simplify xe_bo live tests code layout
  drm/xe/kunit: Simplify xe_dma_buf live tests code layout
  drm/xe/kunit: Simplify xe_migrate live tests code layout
  drm/xe/kunit: Simplify xe_mocs live tests code layout

 drivers/gpu/drm/xe/tests/Makefile           |  6 +-----
 drivers/gpu/drm/xe/tests/xe_bo.c            | 20 +++++++++++++++-----
 drivers/gpu/drm/xe/tests/xe_bo_test.c       | 21 ---------------------
 drivers/gpu/drm/xe/tests/xe_bo_test.h       | 14 --------------
 drivers/gpu/drm/xe/tests/xe_dma_buf.c       | 16 +++++++++++++---
 drivers/gpu/drm/xe/tests/xe_dma_buf_test.c  | 20 --------------------
 drivers/gpu/drm/xe/tests/xe_dma_buf_test.h  | 13 -------------
 drivers/gpu/drm/xe/tests/xe_live_test_mod.c | 11 +++++++++++
 drivers/gpu/drm/xe/tests/xe_migrate.c       | 16 +++++++++++++---
 drivers/gpu/drm/xe/tests/xe_migrate_test.c  | 20 --------------------
 drivers/gpu/drm/xe/tests/xe_migrate_test.h  | 13 -------------
 drivers/gpu/drm/xe/tests/xe_mocs.c          | 20 +++++++++++++++-----
 drivers/gpu/drm/xe/tests/xe_mocs_test.c     | 21 ---------------------
 drivers/gpu/drm/xe/tests/xe_mocs_test.h     | 14 --------------
 14 files changed, 68 insertions(+), 157 deletions(-)
 delete mode 100644 drivers/gpu/drm/xe/tests/xe_bo_test.c
 delete mode 100644 drivers/gpu/drm/xe/tests/xe_bo_test.h
 delete mode 100644 drivers/gpu/drm/xe/tests/xe_dma_buf_test.c
 delete mode 100644 drivers/gpu/drm/xe/tests/xe_dma_buf_test.h
 delete mode 100644 drivers/gpu/drm/xe/tests/xe_migrate_test.c
 delete mode 100644 drivers/gpu/drm/xe/tests/xe_migrate_test.h
 delete mode 100644 drivers/gpu/drm/xe/tests/xe_mocs_test.c
 delete mode 100644 drivers/gpu/drm/xe/tests/xe_mocs_test.h

-- 
2.43.0



More information about the Intel-xe mailing list