All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karolina Stolarek <karolina.stolarek@intel.com>
To: dri-devel@lists.freedesktop.org
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Mauro Carvalho Chehab" <mauro.chehab@linux.intel.com>,
	"Karolina Stolarek" <karolina.stolarek@intel.com>,
	"Andi Shyti" <andi.shyti@linux.intel.com>,
	"Shuah Khan" <shuah@kernel.org>,
	"Christian König" <christian.koenig@amd.com>,
	"Nirmoy Das" <nirmoy.das@intel.com>
Subject: [RFC PATCH 0/3] Introduce KUnit tests for TTM subsystem
Date: Mon, 12 Jun 2023 12:55:24 +0200	[thread overview]
Message-ID: <cover.1686563485.git.karolina.stolarek@intel.com> (raw)

This series introduces KUnit[1] tests for TTM (Translation Table Manager)
subsystem, a memory manager used by graphics drivers to create and manage
memory buffers across different memory domains, such as system memory
or VRAM.

Unit tests implemented here cover two data structures:
  - ttm_device -- referred as a buffer object device, which stores
    resource managers and page pools
  - ttm_pool -- a struct of pools (ttm_pool_type) of different page
    orders and caching attributes, with pages that can be reused on
    the next buffer allocation

Use kunit_tool script to manually run the tests:

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

To build a kernel with TTM KUnit tests, enable CONFIG_DRM_TTM_KUNIT_TEST
symbol.

As for now, tests are architecture-agnostic (i.e. KUnit runner uses UML
kernel), which means that we have limited coverage in some places. For
example, we can't fully test the initialization of global page pools,
such as global_write_combined. It is to be decided if we want to stick
to UML or use CONFIG_X86 (at least to some extent).

These patches are just a beginning of the work to improve the test
coverage of TTM. Feel free to suggest changes, test cases or priorities.

Many thanks,
Karolina
--------------------------------
[1] - https://www.kernel.org/doc/html/latest/dev-tools/kunit/index.html

Karolina Stolarek (3):
  drm/ttm: Introduce KUnit tests
  drm/ttm/tests: Add tests for ttm_device
  drm/ttm/tests: Add tests for ttm_pool

 drivers/gpu/drm/Kconfig                       |  15 +
 drivers/gpu/drm/ttm/Makefile                  |   1 +
 drivers/gpu/drm/ttm/tests/.kunitconfig        |   4 +
 drivers/gpu/drm/ttm/tests/Makefile            |   6 +
 drivers/gpu/drm/ttm/tests/ttm_device_test.c   | 213 ++++++++++
 drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c |  80 ++++
 drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h |  34 ++
 drivers/gpu/drm/ttm/tests/ttm_pool_test.c     | 401 ++++++++++++++++++
 8 files changed, 754 insertions(+)
 create mode 100644 drivers/gpu/drm/ttm/tests/.kunitconfig
 create mode 100644 drivers/gpu/drm/ttm/tests/Makefile
 create mode 100644 drivers/gpu/drm/ttm/tests/ttm_device_test.c
 create mode 100644 drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c
 create mode 100644 drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h
 create mode 100644 drivers/gpu/drm/ttm/tests/ttm_pool_test.c

-- 
2.25.1


             reply	other threads:[~2023-06-12 10:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12 10:55 Karolina Stolarek [this message]
2023-06-12 10:55 ` [RFC PATCH 1/3] drm/ttm: Introduce KUnit tests Karolina Stolarek
2023-06-12 22:44   ` kernel test robot
2023-06-12 10:55 ` [RFC PATCH 2/3] drm/ttm/tests: Add tests for ttm_device Karolina Stolarek
2023-06-12 10:55 ` [RFC PATCH 3/3] drm/ttm/tests: Add tests for ttm_pool Karolina Stolarek
2023-06-12 11:22   ` Karolina Stolarek
2023-06-13  6:39   ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1686563485.git.karolina.stolarek@intel.com \
    --to=karolina.stolarek@intel.com \
    --cc=andi.shyti@linux.intel.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=mauro.chehab@linux.intel.com \
    --cc=nirmoy.das@intel.com \
    --cc=shuah@kernel.org \
    --cc=thomas.hellstrom@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.