All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Improve test coverage of TTM
@ 2023-09-11 10:17 Karolina Stolarek
  2023-09-11 10:17 ` [PATCH v2 1/5] drm/ttm: Update Makefile for KUnit Karolina Stolarek
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Karolina Stolarek @ 2023-09-11 10:17 UTC (permalink / raw)
  To: dri-devel; +Cc: Thomas Hellström, Karolina Stolarek, Christian König

Add tests for building blocks of the TTM subsystem, such as ttm_resource,
ttm_resource_manager, ttm_tt and ttm_buffer_object. This series covers
basic functions such as initialization, allocation and clean-up of each
struct. Testing of ttm_buffer_object also includes locking and unlocking
the object for validation, with special scenarios such as an interrupted
wait or deadlock.

Some of the test cases check the bulk move mechanism and how it interacts
with pinned buffers. This is to be seen if we want to add dedicated testing
for bulk move or not. The resource allocation subtests use ttm_sys_manager
for now. Resources that don't use system memory will be indirectly tested
via tests for ttm_bo_validate()/ttm_bo_init_validate(), using a mock
resource manager.

Use kunit_tool script to manually run all the tests:

$ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/gpu/drm/ttm/tests

To build a kernel with TTM KUnit tests, first enable CONFIG_KUNIT, and
then CONFIG_DRM_TTM_KUNIT_TEST.

Many thanks,
Karolina

v2:
  - Remove Makefile for KUnit tests and move the definitions to the
    TTM's one
  - Switch on CONFIG_DRM_TTM_KUNIT_TEST=m so the tests and TTM module
    are built as one. This allows building the tests as a module, even
    if it uses functions that are not exported
  - Fix ttm_pool_pre_populated(); a wrong flag was passed to
    ttm_tt_kunit_init() function

Karolina Stolarek (5):
  drm/ttm: Update Makefile for KUnit
  drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man
  drm/ttm/tests: Add tests for ttm_tt
  drm/ttm/tests: Add tests for ttm_bo functions
  drm/ttm/tests: Don't pass order as page flags

 drivers/gpu/drm/ttm/Makefile                  |  19 +-
 drivers/gpu/drm/ttm/tests/Makefile            |   6 -
 drivers/gpu/drm/ttm/tests/ttm_bo_test.c       | 620 ++++++++++++++++++
 drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c |  48 ++
 drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h |   4 +
 drivers/gpu/drm/ttm/tests/ttm_pool_test.c     |   3 +-
 drivers/gpu/drm/ttm/tests/ttm_resource_test.c | 335 ++++++++++
 drivers/gpu/drm/ttm/tests/ttm_tt_test.c       | 277 ++++++++
 8 files changed, 1299 insertions(+), 13 deletions(-)
 delete mode 100644 drivers/gpu/drm/ttm/tests/Makefile
 create mode 100644 drivers/gpu/drm/ttm/tests/ttm_bo_test.c
 create mode 100644 drivers/gpu/drm/ttm/tests/ttm_resource_test.c
 create mode 100644 drivers/gpu/drm/ttm/tests/ttm_tt_test.c

-- 
2.25.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-09-12  9:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-11 10:17 [PATCH v2 0/5] Improve test coverage of TTM Karolina Stolarek
2023-09-11 10:17 ` [PATCH v2 1/5] drm/ttm: Update Makefile for KUnit Karolina Stolarek
2023-09-11 10:49   ` Jani Nikula
2023-09-11 11:47     ` Karolina Stolarek
2023-09-11 13:12       ` Christian König
2023-09-11 13:33         ` Karolina Stolarek
2023-09-11 13:42           ` Christian König
2023-09-12  9:51             ` Karolina Stolarek
2023-09-12  9:59               ` Christian König
2023-09-11 10:17 ` [PATCH v2 2/5] drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man Karolina Stolarek
2023-09-11 10:17 ` [PATCH v2 3/5] drm/ttm/tests: Add tests for ttm_tt Karolina Stolarek
2023-09-11 10:17 ` [PATCH v2 4/5] drm/ttm/tests: Add tests for ttm_bo functions Karolina Stolarek
2023-09-11 10:18 ` [PATCH v2 5/5] drm/ttm/tests: Don't pass order as page flags Karolina Stolarek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.