diff options
author | Karolina Stolarek <karolina.stolarek@intel.com> | 2023-11-29 13:02:27 +0100 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2023-12-14 11:12:10 +0100 |
commit | 9afc1e0aa4851ef48482b03f6304047cf9b550ca (patch) | |
tree | 2412b145a983bac8da9fe0f1aa6af03406a0e264 /drivers/gpu/drm/ttm/ttm_resource.c | |
parent | 4350aa21cca48a5d951ba108290bad703fbc0630 (diff) | |
download | linux-9afc1e0aa4851ef48482b03f6304047cf9b550ca.tar.gz linux-9afc1e0aa4851ef48482b03f6304047cf9b550ca.tar.bz2 linux-9afc1e0aa4851ef48482b03f6304047cf9b550ca.zip |
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>
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_resource.c')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_resource.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_resource.c b/drivers/gpu/drm/ttm/ttm_resource.c index 46ff9c75bb12..02b96d23fdb9 100644 --- a/drivers/gpu/drm/ttm/ttm_resource.c +++ b/drivers/gpu/drm/ttm/ttm_resource.c @@ -30,6 +30,8 @@ #include <drm/ttm/ttm_placement.h> #include <drm/ttm/ttm_resource.h> +#include <drm/drm_util.h> + /** * ttm_lru_bulk_move_init - initialize a bulk move structure * @bulk: the structure to init @@ -240,6 +242,7 @@ int ttm_resource_alloc(struct ttm_buffer_object *bo, spin_unlock(&bo->bdev->lru_lock); return 0; } +EXPORT_SYMBOL_FOR_TESTS_ONLY(ttm_resource_alloc); void ttm_resource_free(struct ttm_buffer_object *bo, struct ttm_resource **res) { |