Lines Matching refs:vma
362 static int igt_check_page_sizes(struct i915_vma *vma) in igt_check_page_sizes() argument
364 struct drm_i915_private *i915 = vma->vm->i915; in igt_check_page_sizes()
366 struct drm_i915_gem_object *obj = vma->obj; in igt_check_page_sizes()
370 err = i915_vma_sync(vma); in igt_check_page_sizes()
374 if (!HAS_PAGE_SIZES(i915, vma->page_sizes.sg)) { in igt_check_page_sizes()
376 vma->page_sizes.sg & ~supported, supported); in igt_check_page_sizes()
380 if (!HAS_PAGE_SIZES(i915, vma->resource->page_sizes_gtt)) { in igt_check_page_sizes()
382 vma->resource->page_sizes_gtt & ~supported, supported); in igt_check_page_sizes()
386 if (vma->page_sizes.phys != obj->mm.page_sizes.phys) { in igt_check_page_sizes()
388 vma->page_sizes.phys, obj->mm.page_sizes.phys); in igt_check_page_sizes()
392 if (vma->page_sizes.sg != obj->mm.page_sizes.sg) { in igt_check_page_sizes()
394 vma->page_sizes.sg, obj->mm.page_sizes.sg); in igt_check_page_sizes()
411 IS_ALIGNED(i915_vma_offset(vma), SZ_2M) && in igt_check_page_sizes()
412 vma->page_sizes.sg & SZ_2M && in igt_check_page_sizes()
413 vma->resource->page_sizes_gtt < SZ_2M) { in igt_check_page_sizes()
415 vma->page_sizes.sg, vma->resource->page_sizes_gtt); in igt_check_page_sizes()
428 struct i915_vma *vma; in igt_mock_exhaust_device_supported_pages() local
461 vma = i915_vma_instance(obj, &ppgtt->vm, NULL); in igt_mock_exhaust_device_supported_pages()
462 if (IS_ERR(vma)) { in igt_mock_exhaust_device_supported_pages()
463 err = PTR_ERR(vma); in igt_mock_exhaust_device_supported_pages()
467 err = i915_vma_pin(vma, 0, 0, PIN_USER); in igt_mock_exhaust_device_supported_pages()
471 err = igt_check_page_sizes(vma); in igt_mock_exhaust_device_supported_pages()
473 if (vma->page_sizes.sg != combination) { in igt_mock_exhaust_device_supported_pages()
475 vma->page_sizes.sg, combination); in igt_mock_exhaust_device_supported_pages()
479 i915_vma_unpin(vma); in igt_mock_exhaust_device_supported_pages()
505 struct i915_vma *vma; in igt_mock_memory_region_huge_pages() local
529 vma = i915_vma_instance(obj, &ppgtt->vm, NULL); in igt_mock_memory_region_huge_pages()
530 if (IS_ERR(vma)) { in igt_mock_memory_region_huge_pages()
531 err = PTR_ERR(vma); in igt_mock_memory_region_huge_pages()
535 err = i915_vma_pin(vma, 0, 0, PIN_USER); in igt_mock_memory_region_huge_pages()
539 err = igt_check_page_sizes(vma); in igt_mock_memory_region_huge_pages()
551 if (vma->resource->page_sizes_gtt != page_size) { in igt_mock_memory_region_huge_pages()
553 __func__, vma->resource->page_sizes_gtt, in igt_mock_memory_region_huge_pages()
559 i915_vma_unpin(vma); in igt_mock_memory_region_huge_pages()
568 i915_vma_unpin(vma); in igt_mock_memory_region_huge_pages()
601 struct i915_vma *vma; in igt_mock_ppgtt_misaligned_dma() local
621 vma = i915_vma_instance(obj, &ppgtt->vm, NULL); in igt_mock_ppgtt_misaligned_dma()
622 if (IS_ERR(vma)) { in igt_mock_ppgtt_misaligned_dma()
623 err = PTR_ERR(vma); in igt_mock_ppgtt_misaligned_dma()
627 err = i915_vma_pin(vma, 0, 0, flags); in igt_mock_ppgtt_misaligned_dma()
632 err = igt_check_page_sizes(vma); in igt_mock_ppgtt_misaligned_dma()
634 if (vma->resource->page_sizes_gtt != page_size) { in igt_mock_ppgtt_misaligned_dma()
636 vma->resource->page_sizes_gtt, page_size); in igt_mock_ppgtt_misaligned_dma()
640 i915_vma_unpin(vma); in igt_mock_ppgtt_misaligned_dma()
651 err = i915_vma_unbind_unlocked(vma); in igt_mock_ppgtt_misaligned_dma()
655 err = i915_vma_pin(vma, 0, 0, flags | offset); in igt_mock_ppgtt_misaligned_dma()
659 err = igt_check_page_sizes(vma); in igt_mock_ppgtt_misaligned_dma()
661 if (vma->resource->page_sizes_gtt != I915_GTT_PAGE_SIZE_4K) { in igt_mock_ppgtt_misaligned_dma()
663 vma->resource->page_sizes_gtt, in igt_mock_ppgtt_misaligned_dma()
668 i915_vma_unpin(vma); in igt_mock_ppgtt_misaligned_dma()
745 struct i915_vma *vma; in igt_ppgtt_huge_fill() local
771 vma = i915_vma_instance(obj, vm, NULL); in igt_ppgtt_huge_fill()
772 if (IS_ERR(vma)) { in igt_ppgtt_huge_fill()
773 err = PTR_ERR(vma); in igt_ppgtt_huge_fill()
778 err = i915_vma_pin(vma, 0, BIT(21), PIN_USER); in igt_ppgtt_huge_fill()
782 err = igt_check_page_sizes(vma); in igt_ppgtt_huge_fill()
784 i915_vma_unpin(vma); in igt_ppgtt_huge_fill()
810 i915_vma_unpin(vma); in igt_ppgtt_huge_fill()
812 if (!has_pte64 && vma->page_sizes.sg & I915_GTT_PAGE_SIZE_64K) { in igt_ppgtt_huge_fill()
813 if (!IS_ALIGNED(vma->node.start, in igt_ppgtt_huge_fill()
816 vma->node.start); in igt_ppgtt_huge_fill()
821 if (!IS_ALIGNED(vma->node.size, in igt_ppgtt_huge_fill()
824 vma->node.size); in igt_ppgtt_huge_fill()
830 if (vma->resource->page_sizes_gtt != expected_gtt) { in igt_ppgtt_huge_fill()
832 vma->resource->page_sizes_gtt, expected_gtt, in igt_ppgtt_huge_fill()
923 struct i915_vma *vma; in igt_ppgtt_64K() local
982 vma = i915_vma_instance(obj, vm, NULL); in igt_ppgtt_64K()
983 if (IS_ERR(vma)) { in igt_ppgtt_64K()
984 err = PTR_ERR(vma); in igt_ppgtt_64K()
991 err = i915_vma_pin(vma, 0, 0, flags); in igt_ppgtt_64K()
995 err = igt_check_page_sizes(vma); in igt_ppgtt_64K()
1000 vma->page_sizes.sg & I915_GTT_PAGE_SIZE_64K) { in igt_ppgtt_64K()
1001 if (!IS_ALIGNED(vma->node.start, in igt_ppgtt_64K()
1004 vma->node.start); in igt_ppgtt_64K()
1009 if (!IS_ALIGNED(vma->node.size, in igt_ppgtt_64K()
1012 vma->node.size); in igt_ppgtt_64K()
1018 if (vma->resource->page_sizes_gtt != expected_gtt) { in igt_ppgtt_64K()
1020 vma->resource->page_sizes_gtt, in igt_ppgtt_64K()
1027 i915_vma_unpin(vma); in igt_ppgtt_64K()
1041 i915_vma_unpin(vma); in igt_ppgtt_64K()
1056 struct i915_vma *vma, in gpu_write() argument
1062 i915_gem_object_lock(vma->obj, NULL); in gpu_write()
1063 err = i915_gem_object_set_to_gtt_domain(vma->obj, true); in gpu_write()
1064 i915_gem_object_unlock(vma->obj); in gpu_write()
1068 return igt_gpu_fill_dw(ce, vma, dw * sizeof(u32), in gpu_write()
1069 vma->size >> PAGE_SHIFT, val); in gpu_write()
1152 struct i915_vma *vma; in __igt_write_huge() local
1155 vma = i915_vma_instance(obj, ce->vm, NULL); in __igt_write_huge()
1156 if (IS_ERR(vma)) in __igt_write_huge()
1157 return PTR_ERR(vma); in __igt_write_huge()
1159 err = i915_vma_pin(vma, size, 0, flags | offset); in __igt_write_huge()
1171 err = igt_check_page_sizes(vma); in __igt_write_huge()
1175 err = gpu_write(ce, vma, dword, val); in __igt_write_huge()
1188 i915_vma_unpin(vma); in __igt_write_huge()
1625 struct i915_vma *vma; in igt_ppgtt_mixed() local
1672 vma = i915_vma_instance(obj, vm, NULL); in igt_ppgtt_mixed()
1673 if (IS_ERR(vma)) { in igt_ppgtt_mixed()
1674 err = PTR_ERR(vma); in igt_ppgtt_mixed()
1679 err = i915_vma_pin(vma, 0, 0, addr | flags); in igt_ppgtt_mixed()
1684 (vma->resource->page_sizes_gtt & I915_GTT_PAGE_SIZE_4K)) { in igt_ppgtt_mixed()
1766 struct i915_vma *vma; in igt_tmpfs_fallback() local
1806 vma = i915_vma_instance(obj, vm, NULL); in igt_tmpfs_fallback()
1807 if (IS_ERR(vma)) { in igt_tmpfs_fallback()
1808 err = PTR_ERR(vma); in igt_tmpfs_fallback()
1812 err = i915_vma_pin(vma, 0, 0, PIN_USER); in igt_tmpfs_fallback()
1816 err = igt_check_page_sizes(vma); in igt_tmpfs_fallback()
1818 i915_vma_unpin(vma); in igt_tmpfs_fallback()
1838 struct i915_vma *vma; in igt_shrink_thp() local
1873 vma = i915_vma_instance(obj, vm, NULL); in igt_shrink_thp()
1874 if (IS_ERR(vma)) { in igt_shrink_thp()
1875 err = PTR_ERR(vma); in igt_shrink_thp()
1881 err = i915_vma_pin(vma, 0, 0, flags); in igt_shrink_thp()
1890 err = igt_check_page_sizes(vma); in igt_shrink_thp()
1900 err = gpu_write(ce, vma, n++, 0xdeadbeaf); in igt_shrink_thp()
1914 i915_vma_unpin(vma); in igt_shrink_thp()
1942 err = i915_vma_pin(vma, 0, 0, flags); in igt_shrink_thp()
1953 i915_vma_unpin(vma); in igt_shrink_thp()