Commit 995279d2 authored by Karolina Stolarek's avatar Karolina Stolarek Committed by Christian König

drm/ttm/tests: Add tests for ttm_bo functions

Test reservation and release of TTM buffer objects. Add tests to check
pin and unpin operations.
Signed-off-by: default avatarKarolina Stolarek <karolina.stolarek@intel.com>
Tested-by: default avatarAmaranath Somalapuram <Amaranath.Somalapuram@amd.com>
Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/fcd53970f55ae4be8c738e03f9fcf45366d20b47.1701257386.git.karolina.stolarek@intel.comSigned-off-by: default avatarChristian König <christian.koenig@amd.com>
parent e6f7c641
......@@ -5,4 +5,5 @@ obj-$(CONFIG_DRM_TTM_KUNIT_TEST) += \
ttm_pool_test.o \
ttm_resource_test.o \
ttm_tt_test.o \
ttm_bo_test.o \
ttm_kunit_helpers.o
This diff is collapsed.
......@@ -22,6 +22,10 @@ static void ttm_tt_simple_destroy(struct ttm_device *bdev, struct ttm_tt *ttm)
kfree(ttm);
}
static void dummy_ttm_bo_destroy(struct ttm_buffer_object *bo)
{
}
struct ttm_device_funcs ttm_dev_funcs = {
.ttm_tt_create = ttm_tt_simple_create,
.ttm_tt_destroy = ttm_tt_simple_destroy,
......@@ -61,6 +65,8 @@ struct ttm_buffer_object *ttm_bo_kunit_init(struct kunit *test,
KUNIT_ASSERT_EQ(test, err, 0);
bo->bdev = devs->ttm_dev;
bo->destroy = dummy_ttm_bo_destroy;
kref_init(&bo->kref);
return bo;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment