All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karolina Stolarek <karolina.stolarek@intel.com>
To: dri-devel@lists.freedesktop.org
Cc: "Christian König" <christian.koenig@amd.com>,
	"Matthew Auld" <matthew.auld@intel.com>,
	"Amaranath Somalapuram" <asomalap@amd.com>,
	"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
	"Karolina Stolarek" <karolina.stolarek@intel.com>
Subject: [PATCH v12 00/10] Improve test coverage of TTM
Date: Wed, 15 May 2024 13:24:23 +0200	[thread overview]
Message-ID: <cover.1715767062.git.karolina.stolarek@intel.com> (raw)

Introduce tests for ttm_bo_validate()/ttm_bo_init_validate() that exercise
simple BO placement as well as eviction (including the case where the evict
domain also requires eviction to fit the incoming buffer). Prepare KUnit
helpers to handle such scenarios and add a mock VRAM manager. This series also
includes some updates to the helpers and more definitions used to define
"special" memory domains (e.g., one that can't allocate resources or is busy),
as well as drive-by fixes for the tests.

There are a couple of areas in which this test suite can be improved.
Suggestions for future work can be found in the TODO file.

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, use a UML configuration,
enable CONFIG_KUNIT, and then select CONFIG_DRM_TTM_KUNIT_TEST.

Many thanks,
Karolina

v12:
  - Rewrite "drm/ttm/tests: Fix a warning in ttm_bo_unreserve_bulk" patch to
    extend ttm_bo_kunit_init() helper to accept a dma_resv object and update
    calls to that helper (Christian)
  - Update drm_buddy_free_list() calls with an extra argument

v11:
  - Delete CONFIG_DRM_KUNIT_TEST_HELPERS from .kunitconfig file, as it gets
    automatically selected when TTM KUnit tests are enabled
  - Call ttm_bo_put() in ttm_bo_validate_pinned() test case (Matt)
  - Fix a copy-paste mistake in ttm_mem_type_cases definition (Matt)
  - Update mock_move definition to do a hop on VRAM -> sysmem move and
    delete a dummy multihop domain. Fix the eviction tests accordingly (Matt)
  - Update ttm_bo_validate_swapout() to use TT domain instead of VRAM
  - Update eviction test cases to create TT domain, so they can perform multihop
  - Update TODO file, as it got outdated already

v10:
  Many things have happened over the course of three months, so the series
  had to be slightly reworked and expanded to accommodate these changes:
   - Set DMA coherent mapping mask in the KUnit device so ttm_pool_alloc
     tests can be executed
   - Update ttm_bo_validate_invalid_placement() test case to check against
     the right return error. It's no longer -EINVAL (which only is returned
     for pinned buffers), but -ENOMEM. The behaviour has changed in
     commit cc941c70df39 ("drm/ttm: improve idle/busy handling v5")
   - Rework ttm_placement_kunit_init() to accept only one array of places
     and update the tests that use that helper
   - Set fallback flags in eviction domains defined in TTM KUnit helpers
   - Fix a warning raised by ttm_bo_unreserve_bulk() test case
   - Scrap all r-bs and tested-by, as many things were updated and should
     be checked again

Karolina Stolarek (10):
  drm/ttm/tests: Fix a warning in ttm_bo_unreserve_bulk
  drm/ttm/tests: Delete unnecessary config option
  drm/ttm/tests: Set DMA mask in KUnit device
  drm/ttm/tests: Use an init function from the helpers lib
  drm/ttm/tests: Test simple BO creation and validation
  drm/ttm/tests: Add tests with mock resource managers
  drm/ttm/tests: Add test cases dependent on fence signaling
  drm/ttm/tests: Add eviction testing
  drm/ttm/tests: Add tests for ttm_tt_populate
  drm/ttm/tests: Add TODO file

 drivers/gpu/drm/Kconfig                       |    1 +
 drivers/gpu/drm/ttm/tests/.kunitconfig        |    2 +-
 drivers/gpu/drm/ttm/tests/Makefile            |    2 +
 drivers/gpu/drm/ttm/tests/TODO                |   25 +
 drivers/gpu/drm/ttm/tests/ttm_bo_test.c       |   40 +-
 .../gpu/drm/ttm/tests/ttm_bo_validate_test.c  | 1225 +++++++++++++++++
 drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c |  178 ++-
 drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h |   13 +-
 drivers/gpu/drm/ttm/tests/ttm_mock_manager.c  |  235 ++++
 drivers/gpu/drm/ttm/tests/ttm_mock_manager.h  |   33 +
 drivers/gpu/drm/ttm/tests/ttm_pool_test.c     |    4 +-
 drivers/gpu/drm/ttm/tests/ttm_resource_test.c |    2 +-
 drivers/gpu/drm/ttm/tests/ttm_tt_test.c       |  154 ++-
 drivers/gpu/drm/ttm/ttm_tt.c                  |    3 +
 14 files changed, 1862 insertions(+), 55 deletions(-)
 create mode 100644 drivers/gpu/drm/ttm/tests/TODO
 create mode 100644 drivers/gpu/drm/ttm/tests/ttm_bo_validate_test.c
 create mode 100644 drivers/gpu/drm/ttm/tests/ttm_mock_manager.c
 create mode 100644 drivers/gpu/drm/ttm/tests/ttm_mock_manager.h

-- 
2.34.1


             reply	other threads:[~2024-05-15 11:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-15 11:24 Karolina Stolarek [this message]
2024-05-15 11:24 ` [PATCH v12 01/10] drm/ttm/tests: Fix a warning in ttm_bo_unreserve_bulk Karolina Stolarek
2024-05-24 15:16   ` Thomas Hellström
2024-05-15 11:24 ` [PATCH v12 02/10] drm/ttm/tests: Delete unnecessary config option Karolina Stolarek
2024-05-15 11:24 ` [PATCH v12 03/10] drm/ttm/tests: Set DMA mask in KUnit device Karolina Stolarek
2024-05-15 11:24 ` [PATCH v12 04/10] drm/ttm/tests: Use an init function from the helpers lib Karolina Stolarek
2024-05-15 11:24 ` [PATCH v12 05/10] drm/ttm/tests: Test simple BO creation and validation Karolina Stolarek
2024-05-15 11:24 ` [PATCH v12 06/10] drm/ttm/tests: Add tests with mock resource managers Karolina Stolarek
2024-05-29 12:58   ` Thomas Hellström
2024-06-03  6:55     ` Karolina Stolarek
2024-06-03  7:24       ` Thomas Hellström
2024-06-03  8:28         ` Karolina Stolarek
2024-06-03  9:30           ` Thomas Hellström
2024-06-03  9:46             ` Karolina Stolarek
2024-05-15 11:24 ` [PATCH v12 07/10] drm/ttm/tests: Add test cases dependent on fence signaling Karolina Stolarek
2024-05-15 11:24 ` [PATCH v12 08/10] drm/ttm/tests: Add eviction testing Karolina Stolarek
2024-05-15 11:24 ` [PATCH v12 09/10] drm/ttm/tests: Add tests for ttm_tt_populate Karolina Stolarek
2024-05-15 11:24 ` [PATCH v12 10/10] drm/ttm/tests: Add TODO file Karolina Stolarek
2024-05-24 15:29   ` Thomas Hellström
2024-05-17  3:37 ` [PATCH v12 00/10] Improve test coverage of TTM Somalapuram, Amaranath

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.1715767062.git.karolina.stolarek@intel.com \
    --to=karolina.stolarek@intel.com \
    --cc=asomalap@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --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.