summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/tests/xe_migrate.c
diff options
context:
space:
mode:
authorBalasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>2023-03-17 18:35:30 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-20 02:30:20 +0300
commit11a2407ed5f017edcea436220ebba7c8619924f2 (patch)
tree0911604f77b6cd0de8ff6465470d3417d6142ac8 /drivers/gpu/drm/xe/tests/xe_migrate.c
parenteb230dc47dd6f543ae2ff9c85bbe86243502e171 (diff)
downloadlinux-11a2407ed5f017edcea436220ebba7c8619924f2.tar.xz
drm/xe: Stop accepting value in xe_migrate_clear
Although xe_migrate_clear() has a value argument, currently the driver is only passing 0 at all the places this function is invoked with the exception the kunit tests are using the parameter to validate this function with different values. xe_migrate_clear() is failing on platforms with link copy engines because xe_migrate_clear() via emit_clear() is using the blitter instruction XY_FAST_COLOR_BLT to clear the memory. But this instruction is not supported by link copy engine. So the solution is to use the alternate instruction MEM_SET when platform contains link copy engine. But MEM_SET instruction accepts only 8-bit value for setting whereas the value agrument of xe_migrate_clear() is 32-bit. So instead of spreading this limitation around all invocations of xe_migrate_clear() and causing more confusion, it was decided to not accept any value itself as driver does not really need this currently. All the kunit tests are adapted as per the new function prototype. This will be followed by a patch to add support for link copy engines. Signed-off-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/tests/xe_migrate.c')
-rw-r--r--drivers/gpu/drm/xe/tests/xe_migrate.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/drm/xe/tests/xe_migrate.c b/drivers/gpu/drm/xe/tests/xe_migrate.c
index e50b6ceb56e6..17829f878757 100644
--- a/drivers/gpu/drm/xe/tests/xe_migrate.c
+++ b/drivers/gpu/drm/xe/tests/xe_migrate.c
@@ -99,7 +99,7 @@ static void test_copy(struct xe_migrate *m, struct xe_bo *bo,
struct kunit *test)
{
struct xe_device *xe = gt_to_xe(m->gt);
- u64 retval, expected = 0xc0c0c0c0c0c0c0c0ULL;
+ u64 retval, expected = 0;
bool big = bo->size >= SZ_2M;
struct dma_fence *fence;
const char *str = big ? "Copying big bo" : "Copying small bo";
@@ -130,7 +130,7 @@ static void test_copy(struct xe_migrate *m, struct xe_bo *bo,
}
xe_map_memset(xe, &sysmem->vmap, 0, 0xd0, sysmem->size);
- fence = xe_migrate_clear(m, sysmem, sysmem->ttm.resource, 0xc0c0c0c0);
+ fence = xe_migrate_clear(m, sysmem, sysmem->ttm.resource);
if (!sanity_fence_failed(xe, fence, big ? "Clearing sysmem big bo" :
"Clearing sysmem small bo", test)) {
retval = xe_map_rd(xe, &sysmem->vmap, 0, u64);
@@ -311,10 +311,10 @@ static void xe_migrate_sanity_test(struct xe_migrate *m, struct kunit *test)
bb->len = 0;
bb->cs[bb->len++] = MI_BATCH_BUFFER_END;
xe_map_wr(xe, &pt->vmap, 0, u32, 0xdeaddead);
- expected = 0x12345678U;
+ expected = 0;
emit_clear(m->gt, bb, xe_migrate_vm_addr(NUM_KERNEL_PDE - 1, 0), 4, 4,
- expected, IS_DGFX(xe));
+ IS_DGFX(xe));
run_sanity_job(m, xe, bb, 1, "Writing to our newly mapped pagetable",
test);
@@ -326,8 +326,8 @@ static void xe_migrate_sanity_test(struct xe_migrate *m, struct kunit *test)
/* Clear a small bo */
kunit_info(test, "Clearing small buffer object\n");
xe_map_memset(xe, &tiny->vmap, 0, 0x22, tiny->size);
- expected = 0x224488ff;
- fence = xe_migrate_clear(m, tiny, tiny->ttm.resource, expected);
+ expected = 0;
+ fence = xe_migrate_clear(m, tiny, tiny->ttm.resource);
if (sanity_fence_failed(xe, fence, "Clearing small bo", test))
goto out;
@@ -342,11 +342,11 @@ static void xe_migrate_sanity_test(struct xe_migrate *m, struct kunit *test)
test_copy(m, tiny, test);
}
- /* Clear a big bo with a fixed value */
+ /* Clear a big bo */
kunit_info(test, "Clearing big buffer object\n");
xe_map_memset(xe, &big->vmap, 0, 0x11, big->size);
- expected = 0x11223344U;
- fence = xe_migrate_clear(m, big, big->ttm.resource, expected);
+ expected = 0;
+ fence = xe_migrate_clear(m, big, big->ttm.resource);
if (sanity_fence_failed(xe, fence, "Clearing big bo", test))
goto out;