mirror of
https://github.com/torvalds/linux.git
synced 2026-04-19 23:34:00 -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
@@ -51,7 +51,8 @@ EXPORT_SYMBOL_GPL(ttm_device_kunit_init);
|
||||
|
||||
struct ttm_buffer_object *ttm_bo_kunit_init(struct kunit *test,
|
||||
struct ttm_test_devices *devs,
|
||||
size_t size)
|
||||
size_t size,
|
||||
struct dma_resv *obj)
|
||||
{
|
||||
struct drm_gem_object gem_obj = { };
|
||||
struct ttm_buffer_object *bo;
|
||||
@@ -61,6 +62,10 @@ struct ttm_buffer_object *ttm_bo_kunit_init(struct kunit *test,
|
||||
KUNIT_ASSERT_NOT_NULL(test, bo);
|
||||
|
||||
bo->base = gem_obj;
|
||||
|
||||
if (obj)
|
||||
bo->base.resv = obj;
|
||||
|
||||
err = drm_gem_object_init(devs->drm, &bo->base, size);
|
||||
KUNIT_ASSERT_EQ(test, err, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user