Commit 07430fa5 authored by Karolina Stolarek's avatar Karolina Stolarek Committed by Arunpravin Paneer Selvam
parent be487a29
...@@ -243,7 +243,7 @@ static void ttm_bo_unreserve_basic(struct kunit *test) ...@@ -243,7 +243,7 @@ static void ttm_bo_unreserve_basic(struct kunit *test)
struct ttm_place *place; struct ttm_place *place;
struct ttm_resource_manager *man; struct ttm_resource_manager *man;
unsigned int bo_prio = TTM_MAX_BO_PRIORITY - 1; unsigned int bo_prio = TTM_MAX_BO_PRIORITY - 1;
uint32_t mem_type = TTM_PL_SYSTEM; u32 mem_type = TTM_PL_SYSTEM;
int err; int err;
place = ttm_place_kunit_init(test, mem_type, 0); place = ttm_place_kunit_init(test, mem_type, 0);
...@@ -284,7 +284,7 @@ static void ttm_bo_unreserve_pinned(struct kunit *test) ...@@ -284,7 +284,7 @@ static void ttm_bo_unreserve_pinned(struct kunit *test)
struct ttm_device *ttm_dev; struct ttm_device *ttm_dev;
struct ttm_resource *res1, *res2; struct ttm_resource *res1, *res2;
struct ttm_place *place; struct ttm_place *place;
uint32_t mem_type = TTM_PL_SYSTEM; u32 mem_type = TTM_PL_SYSTEM;
int err; int err;
ttm_dev = kunit_kzalloc(test, sizeof(*ttm_dev), GFP_KERNEL); ttm_dev = kunit_kzalloc(test, sizeof(*ttm_dev), GFP_KERNEL);
...@@ -328,7 +328,7 @@ static void ttm_bo_unreserve_bulk(struct kunit *test) ...@@ -328,7 +328,7 @@ static void ttm_bo_unreserve_bulk(struct kunit *test)
struct ttm_device *ttm_dev; struct ttm_device *ttm_dev;
struct ttm_place *place; struct ttm_place *place;
struct dma_resv *resv; struct dma_resv *resv;
uint32_t mem_type = TTM_PL_SYSTEM; u32 mem_type = TTM_PL_SYSTEM;
unsigned int bo_priority = 0; unsigned int bo_priority = 0;
int err; int err;
...@@ -386,7 +386,7 @@ static void ttm_bo_put_basic(struct kunit *test) ...@@ -386,7 +386,7 @@ static void ttm_bo_put_basic(struct kunit *test)
struct ttm_resource *res; struct ttm_resource *res;
struct ttm_device *ttm_dev; struct ttm_device *ttm_dev;
struct ttm_place *place; struct ttm_place *place;
uint32_t mem_type = TTM_PL_SYSTEM; u32 mem_type = TTM_PL_SYSTEM;
int err; int err;
place = ttm_place_kunit_init(test, mem_type, 0); place = ttm_place_kunit_init(test, mem_type, 0);
...@@ -501,7 +501,7 @@ static void ttm_bo_pin_unpin_resource(struct kunit *test) ...@@ -501,7 +501,7 @@ static void ttm_bo_pin_unpin_resource(struct kunit *test)
struct ttm_resource *res; struct ttm_resource *res;
struct ttm_device *ttm_dev; struct ttm_device *ttm_dev;
struct ttm_place *place; struct ttm_place *place;
uint32_t mem_type = TTM_PL_SYSTEM; u32 mem_type = TTM_PL_SYSTEM;
unsigned int bo_priority = 0; unsigned int bo_priority = 0;
int err; int err;
...@@ -552,7 +552,7 @@ static void ttm_bo_multiple_pin_one_unpin(struct kunit *test) ...@@ -552,7 +552,7 @@ static void ttm_bo_multiple_pin_one_unpin(struct kunit *test)
struct ttm_resource *res; struct ttm_resource *res;
struct ttm_device *ttm_dev; struct ttm_device *ttm_dev;
struct ttm_place *place; struct ttm_place *place;
uint32_t mem_type = TTM_PL_SYSTEM; u32 mem_type = TTM_PL_SYSTEM;
unsigned int bo_priority = 0; unsigned int bo_priority = 0;
int err; int err;
......
...@@ -42,8 +42,7 @@ static struct ttm_placement mock_placement = { ...@@ -42,8 +42,7 @@ static struct ttm_placement mock_placement = {
.placement = &mock2_place, .placement = &mock2_place,
}; };
static struct ttm_tt *ttm_tt_simple_create(struct ttm_buffer_object *bo, static struct ttm_tt *ttm_tt_simple_create(struct ttm_buffer_object *bo, u32 page_flags)
uint32_t page_flags)
{ {
struct ttm_tt *tt; struct ttm_tt *tt;
...@@ -197,8 +196,7 @@ struct ttm_buffer_object *ttm_bo_kunit_init(struct kunit *test, ...@@ -197,8 +196,7 @@ struct ttm_buffer_object *ttm_bo_kunit_init(struct kunit *test,
} }
EXPORT_SYMBOL_GPL(ttm_bo_kunit_init); EXPORT_SYMBOL_GPL(ttm_bo_kunit_init);
struct ttm_place *ttm_place_kunit_init(struct kunit *test, struct ttm_place *ttm_place_kunit_init(struct kunit *test, u32 mem_type, u32 flags)
uint32_t mem_type, uint32_t flags)
{ {
struct ttm_place *place; struct ttm_place *place;
......
...@@ -38,8 +38,8 @@ struct ttm_buffer_object *ttm_bo_kunit_init(struct kunit *test, ...@@ -38,8 +38,8 @@ struct ttm_buffer_object *ttm_bo_kunit_init(struct kunit *test,
struct ttm_test_devices *devs, struct ttm_test_devices *devs,
size_t size, size_t size,
struct dma_resv *obj); struct dma_resv *obj);
struct ttm_place *ttm_place_kunit_init(struct kunit *test, struct ttm_place *ttm_place_kunit_init(struct kunit *test, u32 mem_type,
uint32_t mem_type, uint32_t flags); u32 flags);
void dummy_ttm_bo_destroy(struct ttm_buffer_object *bo); void dummy_ttm_bo_destroy(struct ttm_buffer_object *bo);
struct ttm_test_devices *ttm_test_devices_basic(struct kunit *test); struct ttm_test_devices *ttm_test_devices_basic(struct kunit *test);
......
...@@ -48,7 +48,7 @@ static void ttm_pool_test_fini(struct kunit *test) ...@@ -48,7 +48,7 @@ static void ttm_pool_test_fini(struct kunit *test)
} }
static struct ttm_tt *ttm_tt_kunit_init(struct kunit *test, static struct ttm_tt *ttm_tt_kunit_init(struct kunit *test,
uint32_t page_flags, u32 page_flags,
enum ttm_caching caching, enum ttm_caching caching,
size_t size) size_t size)
{ {
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
struct ttm_resource_test_case { struct ttm_resource_test_case {
const char *description; const char *description;
uint32_t mem_type; u32 mem_type;
uint32_t flags; u32 flags;
}; };
struct ttm_resource_test_priv { struct ttm_resource_test_priv {
...@@ -47,7 +47,7 @@ static void ttm_resource_test_fini(struct kunit *test) ...@@ -47,7 +47,7 @@ static void ttm_resource_test_fini(struct kunit *test)
static void ttm_init_test_mocks(struct kunit *test, static void ttm_init_test_mocks(struct kunit *test,
struct ttm_resource_test_priv *priv, struct ttm_resource_test_priv *priv,
uint32_t mem_type, uint32_t flags) u32 mem_type, u32 flags)
{ {
size_t size = RES_SIZE; size_t size = RES_SIZE;
...@@ -60,7 +60,7 @@ static void ttm_init_test_mocks(struct kunit *test, ...@@ -60,7 +60,7 @@ static void ttm_init_test_mocks(struct kunit *test,
static void ttm_init_test_manager(struct kunit *test, static void ttm_init_test_manager(struct kunit *test,
struct ttm_resource_test_priv *priv, struct ttm_resource_test_priv *priv,
uint32_t mem_type) u32 mem_type)
{ {
struct ttm_device *ttm_dev = priv->devs->ttm_dev; struct ttm_device *ttm_dev = priv->devs->ttm_dev;
struct ttm_resource_manager *man; struct ttm_resource_manager *man;
...@@ -112,7 +112,7 @@ static void ttm_resource_init_basic(struct kunit *test) ...@@ -112,7 +112,7 @@ static void ttm_resource_init_basic(struct kunit *test)
struct ttm_buffer_object *bo; struct ttm_buffer_object *bo;
struct ttm_place *place; struct ttm_place *place;
struct ttm_resource_manager *man; struct ttm_resource_manager *man;
uint64_t expected_usage; u64 expected_usage;
ttm_init_test_mocks(test, priv, params->mem_type, params->flags); ttm_init_test_mocks(test, priv, params->mem_type, params->flags);
bo = priv->bo; bo = priv->bo;
...@@ -230,7 +230,7 @@ static void ttm_resource_manager_usage_basic(struct kunit *test) ...@@ -230,7 +230,7 @@ static void ttm_resource_manager_usage_basic(struct kunit *test)
struct ttm_buffer_object *bo; struct ttm_buffer_object *bo;
struct ttm_place *place; struct ttm_place *place;
struct ttm_resource_manager *man; struct ttm_resource_manager *man;
uint64_t actual_usage; u64 actual_usage;
ttm_init_test_mocks(test, priv, TTM_PL_SYSTEM, TTM_PL_FLAG_TOPDOWN); ttm_init_test_mocks(test, priv, TTM_PL_SYSTEM, TTM_PL_FLAG_TOPDOWN);
bo = priv->bo; bo = priv->bo;
...@@ -268,7 +268,7 @@ static void ttm_sys_man_alloc_basic(struct kunit *test) ...@@ -268,7 +268,7 @@ static void ttm_sys_man_alloc_basic(struct kunit *test)
struct ttm_buffer_object *bo; struct ttm_buffer_object *bo;
struct ttm_place *place; struct ttm_place *place;
struct ttm_resource *res; struct ttm_resource *res;
uint32_t mem_type = TTM_PL_SYSTEM; u32 mem_type = TTM_PL_SYSTEM;
int ret; int ret;
ttm_init_test_mocks(test, priv, mem_type, 0); ttm_init_test_mocks(test, priv, mem_type, 0);
...@@ -293,7 +293,7 @@ static void ttm_sys_man_free_basic(struct kunit *test) ...@@ -293,7 +293,7 @@ static void ttm_sys_man_free_basic(struct kunit *test)
struct ttm_buffer_object *bo; struct ttm_buffer_object *bo;
struct ttm_place *place; struct ttm_place *place;
struct ttm_resource *res; struct ttm_resource *res;
uint32_t mem_type = TTM_PL_SYSTEM; u32 mem_type = TTM_PL_SYSTEM;
ttm_init_test_mocks(test, priv, mem_type, 0); ttm_init_test_mocks(test, priv, mem_type, 0);
bo = priv->bo; bo = priv->bo;
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
struct ttm_tt_test_case { struct ttm_tt_test_case {
const char *description; const char *description;
uint32_t size; u32 size;
uint32_t extra_pages_num; u32 extra_pages_num;
}; };
static const struct ttm_tt_test_case ttm_tt_init_basic_cases[] = { static const struct ttm_tt_test_case ttm_tt_init_basic_cases[] = {
...@@ -41,9 +41,9 @@ static void ttm_tt_init_basic(struct kunit *test) ...@@ -41,9 +41,9 @@ static void ttm_tt_init_basic(struct kunit *test)
const struct ttm_tt_test_case *params = test->param_value; const struct ttm_tt_test_case *params = test->param_value;
struct ttm_buffer_object *bo; struct ttm_buffer_object *bo;
struct ttm_tt *tt; struct ttm_tt *tt;
uint32_t page_flags = TTM_TT_FLAG_ZERO_ALLOC; u32 page_flags = TTM_TT_FLAG_ZERO_ALLOC;
enum ttm_caching caching = ttm_cached; enum ttm_caching caching = ttm_cached;
uint32_t extra_pages = params->extra_pages_num; u32 extra_pages = params->extra_pages_num;
int num_pages = params->size >> PAGE_SHIFT; int num_pages = params->size >> PAGE_SHIFT;
int err; int err;
...@@ -69,7 +69,7 @@ static void ttm_tt_init_misaligned(struct kunit *test) ...@@ -69,7 +69,7 @@ static void ttm_tt_init_misaligned(struct kunit *test)
struct ttm_buffer_object *bo; struct ttm_buffer_object *bo;
struct ttm_tt *tt; struct ttm_tt *tt;
enum ttm_caching caching = ttm_cached; enum ttm_caching caching = ttm_cached;
uint32_t size = SZ_8K; u32 size = SZ_8K;
int num_pages = (size + SZ_4K) >> PAGE_SHIFT; int num_pages = (size + SZ_4K) >> PAGE_SHIFT;
int err; int err;
...@@ -211,7 +211,7 @@ static void ttm_tt_create_ttm_exists(struct kunit *test) ...@@ -211,7 +211,7 @@ static void ttm_tt_create_ttm_exists(struct kunit *test)
} }
static struct ttm_tt *ttm_tt_null_create(struct ttm_buffer_object *bo, static struct ttm_tt *ttm_tt_null_create(struct ttm_buffer_object *bo,
uint32_t page_flags) u32 page_flags)
{ {
return NULL; return NULL;
} }
......
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