drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man
authorKarolina Stolarek <karolina.stolarek@intel.com>
Wed, 29 Nov 2023 12:02:27 +0000 (13:02 +0100)
committerChristian König <christian.koenig@amd.com>
Thu, 14 Dec 2023 10:12:10 +0000 (11:12 +0100)
commit9afc1e0aa4851ef48482b03f6304047cf9b550ca
tree2412b145a983bac8da9fe0f1aa6af03406a0e264
parent4350aa21cca48a5d951ba108290bad703fbc0630
drm/ttm/tests: Add tests for ttm_resource and ttm_sys_man

Test initialization of ttm_resource using different memory domains.
Add tests for a system memory manager and functions that can be
tested without a fully-featured resource manager. Update
ttm_bo_kunit_init() to initialize BO's kref and a genuine GEM drm
object. Export ttm_resource_alloc for test purposes only.

Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com>
Tested-by: Amaranath Somalapuram <Amaranath.Somalapuram@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/68b8b293b6bf5f1170d49a1a089ccce9172e2855.1701257386.git.karolina.stolarek@intel.com
Signed-off-by: Christian König <christian.koenig@amd.com>
drivers/gpu/drm/ttm/tests/Makefile
drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.c
drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h
drivers/gpu/drm/ttm/tests/ttm_resource_test.c [new file with mode: 0644]
drivers/gpu/drm/ttm/ttm_resource.c