mirror of
https://github.com/torvalds/linux.git
synced 2026-04-21 00:04:01 -04:00
drm/ttm/tests: Fix a warning in ttm_bo_unreserve_bulk
BOs in a bulk move have to share the same reservation object. That is
not the case in the ttm_bo_unreserve_bulk subtest. Update
ttm_bo_kunit_init() helper to accept dma_resv object so we can define
buffer objects that share the same resv. Update calls to that helper
accordingly.
Fixes: 995279d280 ("drm/ttm/tests: Add tests for ttm_bo functions")
Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Karolina Stolarek <karolina.stolarek@intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/c5bd2df114781b4eb5c1e8295b2ae4ac2c30a179.1718192625.git.karolina.stolarek@intel.com
This commit is contained in:
committed by
Arunpravin Paneer Selvam
parent
699f411dce
commit
588c4c8d58
@@ -63,7 +63,7 @@ static void ttm_tt_init_basic(struct kunit *test)
|
||||
tt = kunit_kzalloc(test, sizeof(*tt), GFP_KERNEL);
|
||||
KUNIT_ASSERT_NOT_NULL(test, tt);
|
||||
|
||||
bo = ttm_bo_kunit_init(test, test->priv, params->size);
|
||||
bo = ttm_bo_kunit_init(test, test->priv, params->size, NULL);
|
||||
|
||||
err = ttm_tt_init(tt, bo, page_flags, caching, extra_pages);
|
||||
KUNIT_ASSERT_EQ(test, err, 0);
|
||||
@@ -89,7 +89,7 @@ static void ttm_tt_init_misaligned(struct kunit *test)
|
||||
tt = kunit_kzalloc(test, sizeof(*tt), GFP_KERNEL);
|
||||
KUNIT_ASSERT_NOT_NULL(test, tt);
|
||||
|
||||
bo = ttm_bo_kunit_init(test, test->priv, size);
|
||||
bo = ttm_bo_kunit_init(test, test->priv, size, NULL);
|
||||
|
||||
/* Make the object size misaligned */
|
||||
bo->base.size += 1;
|
||||
@@ -110,7 +110,7 @@ static void ttm_tt_fini_basic(struct kunit *test)
|
||||
tt = kunit_kzalloc(test, sizeof(*tt), GFP_KERNEL);
|
||||
KUNIT_ASSERT_NOT_NULL(test, tt);
|
||||
|
||||
bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE);
|
||||
bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE, NULL);
|
||||
|
||||
err = ttm_tt_init(tt, bo, 0, caching, 0);
|
||||
KUNIT_ASSERT_EQ(test, err, 0);
|
||||
@@ -130,7 +130,7 @@ static void ttm_tt_fini_sg(struct kunit *test)
|
||||
tt = kunit_kzalloc(test, sizeof(*tt), GFP_KERNEL);
|
||||
KUNIT_ASSERT_NOT_NULL(test, tt);
|
||||
|
||||
bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE);
|
||||
bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE, NULL);
|
||||
|
||||
err = ttm_sg_tt_init(tt, bo, 0, caching);
|
||||
KUNIT_ASSERT_EQ(test, err, 0);
|
||||
@@ -151,7 +151,7 @@ static void ttm_tt_fini_shmem(struct kunit *test)
|
||||
tt = kunit_kzalloc(test, sizeof(*tt), GFP_KERNEL);
|
||||
KUNIT_ASSERT_NOT_NULL(test, tt);
|
||||
|
||||
bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE);
|
||||
bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE, NULL);
|
||||
|
||||
err = ttm_tt_init(tt, bo, 0, caching, 0);
|
||||
KUNIT_ASSERT_EQ(test, err, 0);
|
||||
@@ -168,7 +168,7 @@ static void ttm_tt_create_basic(struct kunit *test)
|
||||
struct ttm_buffer_object *bo;
|
||||
int err;
|
||||
|
||||
bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE);
|
||||
bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE, NULL);
|
||||
bo->type = ttm_bo_type_device;
|
||||
|
||||
dma_resv_lock(bo->base.resv, NULL);
|
||||
@@ -187,7 +187,7 @@ static void ttm_tt_create_invalid_bo_type(struct kunit *test)
|
||||
struct ttm_buffer_object *bo;
|
||||
int err;
|
||||
|
||||
bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE);
|
||||
bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE, NULL);
|
||||
bo->type = ttm_bo_type_sg + 1;
|
||||
|
||||
dma_resv_lock(bo->base.resv, NULL);
|
||||
@@ -208,7 +208,7 @@ static void ttm_tt_create_ttm_exists(struct kunit *test)
|
||||
tt = kunit_kzalloc(test, sizeof(*tt), GFP_KERNEL);
|
||||
KUNIT_ASSERT_NOT_NULL(test, tt);
|
||||
|
||||
bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE);
|
||||
bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE, NULL);
|
||||
|
||||
err = ttm_tt_init(tt, bo, 0, caching, 0);
|
||||
KUNIT_ASSERT_EQ(test, err, 0);
|
||||
@@ -239,7 +239,7 @@ static void ttm_tt_create_failed(struct kunit *test)
|
||||
struct ttm_buffer_object *bo;
|
||||
int err;
|
||||
|
||||
bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE);
|
||||
bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE, NULL);
|
||||
|
||||
/* Update ttm_device_funcs so we don't alloc ttm_tt */
|
||||
devs->ttm_dev->funcs = &ttm_dev_empty_funcs;
|
||||
@@ -257,7 +257,7 @@ static void ttm_tt_destroy_basic(struct kunit *test)
|
||||
struct ttm_buffer_object *bo;
|
||||
int err;
|
||||
|
||||
bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE);
|
||||
bo = ttm_bo_kunit_init(test, test->priv, BO_SIZE, NULL);
|
||||
|
||||
dma_resv_lock(bo->base.resv, NULL);
|
||||
err = ttm_tt_create(bo, false);
|
||||
|
||||
Reference in New Issue
Block a user