Lines Matching refs:xe

15 static bool sanity_fence_failed(struct xe_device *xe, struct dma_fence *fence,  in sanity_fence_failed()  argument
37 static int run_sanity_job(struct xe_migrate *m, struct xe_device *xe, in run_sanity_job() argument
41 u64 batch_base = xe_migrate_batch_base(m, xe->info.has_usm); in run_sanity_job()
57 if (sanity_fence_failed(xe, fence, str, test)) in run_sanity_job()
75 struct xe_device *xe = tile_to_xe(m->tile); in test_copy() local
82 struct xe_bo *remote = xe_bo_create_locked(xe, m->tile, NULL, in test_copy()
108 xe_map_memset(xe, &remote->vmap, 0, 0xd0, remote->size); in test_copy()
111 if (!sanity_fence_failed(xe, fence, big ? "Clearing remote big bo" : in test_copy()
113 retval = xe_map_rd(xe, &remote->vmap, 0, u64); in test_copy()
116 retval = xe_map_rd(xe, &remote->vmap, remote->size - 8, u64); in test_copy()
123 xe_map_memset(xe, &remote->vmap, 0, 0xc0, remote->size); in test_copy()
124 xe_map_memset(xe, &bo->vmap, 0, 0xd0, bo->size); in test_copy()
129 if (!sanity_fence_failed(xe, fence, big ? "Copying big bo remote -> vram" : in test_copy()
131 retval = xe_map_rd(xe, &bo->vmap, 0, u64); in test_copy()
134 retval = xe_map_rd(xe, &bo->vmap, bo->size - 8, u64); in test_copy()
141 xe_map_memset(xe, &remote->vmap, 0, 0xd0, remote->size); in test_copy()
142 xe_map_memset(xe, &bo->vmap, 0, 0xc0, bo->size); in test_copy()
146 if (!sanity_fence_failed(xe, fence, big ? "Copying big bo vram -> remote" : in test_copy()
148 retval = xe_map_rd(xe, &remote->vmap, 0, u64); in test_copy()
151 retval = xe_map_rd(xe, &remote->vmap, bo->size - 8, u64); in test_copy()
187 struct xe_device *xe = tile_to_xe(tile); in xe_migrate_sanity_test() local
203 big = xe_bo_create_pin_map(xe, tile, m->q->vm, SZ_4M, in xe_migrate_sanity_test()
212 pt = xe_bo_create_pin_map(xe, tile, m->q->vm, XE_PAGE_SIZE, in xe_migrate_sanity_test()
222 tiny = xe_bo_create_pin_map(xe, tile, m->q->vm, in xe_migrate_sanity_test()
233 bb = xe_bb_new(tile->primary_gt, 32, xe->info.has_usm); in xe_migrate_sanity_test()
245 xe_map_wr(xe, &bo->vmap, XE_PAGE_SIZE * (NUM_KERNEL_PDE - 1), u64, in xe_migrate_sanity_test()
247 expected = m->q->vm->pt_ops->pte_encode_bo(pt, 0, xe->pat.idx[XE_CACHE_WB], 0); in xe_migrate_sanity_test()
258 run_sanity_job(m, xe, bb, bb->len, "Writing PTE for our fake PT", test); in xe_migrate_sanity_test()
260 retval = xe_map_rd(xe, &bo->vmap, XE_PAGE_SIZE * (NUM_KERNEL_PDE - 1), in xe_migrate_sanity_test()
267 xe_map_wr(xe, &pt->vmap, 0, u32, 0xdeaddead); in xe_migrate_sanity_test()
271 IS_DGFX(xe)); in xe_migrate_sanity_test()
272 run_sanity_job(m, xe, bb, 1, "Writing to our newly mapped pagetable", in xe_migrate_sanity_test()
275 retval = xe_map_rd(xe, &pt->vmap, 0, u32); in xe_migrate_sanity_test()
282 xe_map_memset(xe, &tiny->vmap, 0, 0x22, tiny->size); in xe_migrate_sanity_test()
286 if (sanity_fence_failed(xe, fence, "Clearing small bo", test)) in xe_migrate_sanity_test()
290 retval = xe_map_rd(xe, &tiny->vmap, 0, u32); in xe_migrate_sanity_test()
292 retval = xe_map_rd(xe, &tiny->vmap, tiny->size - 4, u32); in xe_migrate_sanity_test()
297 if (xe->info.tile_count > 1) { in xe_migrate_sanity_test()
304 xe_map_memset(xe, &big->vmap, 0, 0x11, big->size); in xe_migrate_sanity_test()
308 if (sanity_fence_failed(xe, fence, "Clearing big bo", test)) in xe_migrate_sanity_test()
312 retval = xe_map_rd(xe, &big->vmap, 0, u32); in xe_migrate_sanity_test()
314 retval = xe_map_rd(xe, &big->vmap, big->size - 4, u32); in xe_migrate_sanity_test()
319 if (xe->info.tile_count > 1) { in xe_migrate_sanity_test()
339 static int migrate_test_run_device(struct xe_device *xe) in migrate_test_run_device() argument
345 xe_pm_runtime_get(xe); in migrate_test_run_device()
347 for_each_tile(tile, xe, id) { in migrate_test_run_device()
356 xe_pm_runtime_put(xe); in migrate_test_run_device()
363 struct xe_device *xe = test->priv; in xe_migrate_sanity_kunit() local
365 migrate_test_run_device(xe); in xe_migrate_sanity_kunit()
374 struct xe_device *xe = gt_to_xe(gt); in blt_copy() local
402 u32 avail_pts = max_mem_transfer_per_pass(xe) / LEVEL0_PAGE_TABLE_ENCODE_SIZE; in blt_copy()
424 ((xe_device_has_flat_ccs(xe) && copy_only_ccs) ? EMIT_COPY_CCS_DW : 0); in blt_copy()
426 bb = xe_bb_new(gt, batch_size, xe->info.has_usm); in blt_copy()
456 xe_migrate_batch_base(m, xe->info.has_usm), in blt_copy()
494 static void test_migrate(struct xe_device *xe, struct xe_tile *tile, in test_migrate() argument
504 xe_map_memset(xe, &sys_bo->vmap, 0, 0xd0, sys_bo->size); in test_migrate()
507 if (!sanity_fence_failed(xe, fence, "Blit copy from sysmem to vram", test)) { in test_migrate()
508 retval = xe_map_rd(xe, &vram_bo->vmap, 0, u64); in test_migrate()
527 retval = xe_map_rd(xe, &vram_bo->vmap, 0, u64); in test_migrate()
529 retval = xe_map_rd(xe, &vram_bo->vmap, vram_bo->size - 8, u64); in test_migrate()
534 if (!sanity_fence_failed(xe, fence, "Clear ccs buffer data", test)) { in test_migrate()
535 retval = xe_map_rd(xe, &ccs_bo->vmap, 0, u64); in test_migrate()
538 retval = xe_map_rd(xe, &ccs_bo->vmap, ccs_bo->size - 8, u64); in test_migrate()
566 retval = xe_map_rd(xe, &vram_bo->vmap, 0, u64); in test_migrate()
568 retval = xe_map_rd(xe, &vram_bo->vmap, vram_bo->size - 8, u64); in test_migrate()
573 if (!sanity_fence_failed(xe, fence, "Clear ccs buffer data", test)) { in test_migrate()
574 retval = xe_map_rd(xe, &ccs_bo->vmap, 0, u64); in test_migrate()
576 retval = xe_map_rd(xe, &ccs_bo->vmap, ccs_bo->size - 8, u64); in test_migrate()
582 static void test_clear(struct xe_device *xe, struct xe_tile *tile, in test_clear() argument
589 xe_map_memset(xe, &sys_bo->vmap, 0, 0xd0, sys_bo->size); in test_clear()
592 if (!sanity_fence_failed(xe, fence, "Blit copy from sysmem to vram", test)) { in test_clear()
593 retval = xe_map_rd(xe, &vram_bo->vmap, 0, u64); in test_clear()
600 if (!sanity_fence_failed(xe, fence, "Blit copy from vram to sysmem", test)) { in test_clear()
601 retval = xe_map_rd(xe, &sys_bo->vmap, 0, u64); in test_clear()
603 retval = xe_map_rd(xe, &sys_bo->vmap, sys_bo->size - 8, u64); in test_clear()
612 if (sanity_fence_failed(xe, fence, "Clear vram_bo", test)) in test_clear()
618 if (!sanity_fence_failed(xe, fence, "Clear main buffer data", test)) { in test_clear()
619 retval = xe_map_rd(xe, &sys_bo->vmap, 0, u64); in test_clear()
621 retval = xe_map_rd(xe, &sys_bo->vmap, sys_bo->size - 8, u64); in test_clear()
628 if (!sanity_fence_failed(xe, fence, "Clear ccs buffer data", test)) { in test_clear()
629 retval = xe_map_rd(xe, &sys_bo->vmap, 0, u64); in test_clear()
631 retval = xe_map_rd(xe, &sys_bo->vmap, sys_bo->size - 8, u64); in test_clear()
637 static void validate_ccs_test_run_tile(struct xe_device *xe, struct xe_tile *tile, in validate_ccs_test_run_tile() argument
644 sys_bo = xe_bo_create_user(xe, NULL, NULL, SZ_4M, in validate_ccs_test_run_tile()
670 ccs_bo = xe_bo_create_user(xe, NULL, NULL, SZ_4M, in validate_ccs_test_run_tile()
695 vram_bo = xe_bo_create_user(xe, NULL, NULL, SZ_4M, in validate_ccs_test_run_tile()
718 test_clear(xe, tile, sys_bo, vram_bo, test); in validate_ccs_test_run_tile()
719 test_migrate(xe, tile, sys_bo, vram_bo, ccs_bo, test); in validate_ccs_test_run_tile()
741 static int validate_ccs_test_run_device(struct xe_device *xe) in validate_ccs_test_run_device() argument
747 if (!xe_device_has_flat_ccs(xe)) { in validate_ccs_test_run_device()
752 if (!(GRAPHICS_VER(xe) >= 20 && IS_DGFX(xe))) { in validate_ccs_test_run_device()
757 xe_pm_runtime_get(xe); in validate_ccs_test_run_device()
759 for_each_tile(tile, xe, id) in validate_ccs_test_run_device()
760 validate_ccs_test_run_tile(xe, tile, test); in validate_ccs_test_run_device()
762 xe_pm_runtime_put(xe); in validate_ccs_test_run_device()
769 struct xe_device *xe = test->priv; in xe_validate_ccs_kunit() local
771 validate_ccs_test_run_device(xe); in xe_validate_ccs_kunit()