diff options
author | Thomas Hellström <thomas.hellstrom@linux.intel.com> | 2023-05-24 16:52:29 +0000 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-19 18:34:04 -0500 |
commit | 3690a01ba926e3f1314d805d1af500fcf3edef7e (patch) | |
tree | d616d2dc6097df1e3b20f544c18be1be16293b24 /drivers/gpu/drm/xe/tests | |
parent | 9922bb40e2ef98c17fb142d22843c0c70ba35e5b (diff) |
drm/xe: Support copying of data between system memory bos
Modify the xe_migrate_copy() function somewhat to explicitly allow
copying of data between two buffer objects including system memory
buffer objects. Update the migrate test accordingly.
v2:
- Check that buffer object sizes match when copying (Matthew Auld)
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/tests')
-rw-r--r-- | drivers/gpu/drm/xe/tests/xe_migrate.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/gpu/drm/xe/tests/xe_migrate.c b/drivers/gpu/drm/xe/tests/xe_migrate.c index f8ee9b9fca99..4a3ca2960fd5 100644 --- a/drivers/gpu/drm/xe/tests/xe_migrate.c +++ b/drivers/gpu/drm/xe/tests/xe_migrate.c @@ -150,7 +150,7 @@ static void test_copy(struct xe_migrate *m, struct xe_bo *bo, xe_map_memset(xe, &bo->vmap, 0, 0xd0, bo->size); expected = 0xc0c0c0c0c0c0c0c0; - fence = xe_migrate_copy(m, sysmem, sysmem->ttm.resource, + fence = xe_migrate_copy(m, sysmem, bo, sysmem->ttm.resource, bo->ttm.resource); if (!sanity_fence_failed(xe, fence, big ? "Copying big bo sysmem -> vram" : "Copying small bo sysmem -> vram", test)) { @@ -167,7 +167,7 @@ static void test_copy(struct xe_migrate *m, struct xe_bo *bo, xe_map_memset(xe, &sysmem->vmap, 0, 0xd0, sysmem->size); xe_map_memset(xe, &bo->vmap, 0, 0xc0, bo->size); - fence = xe_migrate_copy(m, sysmem, bo->ttm.resource, + fence = xe_migrate_copy(m, bo, sysmem, bo->ttm.resource, sysmem->ttm.resource); if (!sanity_fence_failed(xe, fence, big ? "Copying big bo vram -> sysmem" : "Copying small bo vram -> sysmem", test)) { @@ -347,10 +347,8 @@ static void xe_migrate_sanity_test(struct xe_migrate *m, struct kunit *test) retval = xe_map_rd(xe, &tiny->vmap, tiny->size - 4, u32); check(retval, expected, "Command clear small last value", test); - if (IS_DGFX(xe)) { - kunit_info(test, "Copying small buffer object to system\n"); - test_copy(m, tiny, test); - } + kunit_info(test, "Copying small buffer object to system\n"); + test_copy(m, tiny, test); /* Clear a big bo */ kunit_info(test, "Clearing big buffer object\n"); @@ -366,10 +364,8 @@ static void xe_migrate_sanity_test(struct xe_migrate *m, struct kunit *test) retval = xe_map_rd(xe, &big->vmap, big->size - 4, u32); check(retval, expected, "Command clear big last value", test); - if (IS_DGFX(xe)) { - kunit_info(test, "Copying big buffer object to system\n"); - test_copy(m, big, test); - } + kunit_info(test, "Copying big buffer object to system\n"); + test_copy(m, big, test); kunit_info(test, "Testing page table update using CPU if GPU idle.\n"); test_pt_update(m, pt, test, false); |