Lines Matching refs:vma

37 static bool assert_vma(struct i915_vma *vma,
43 if (vma->vm != ctx->vm) {
48 if (vma->size != obj->base.size) {
50 vma->size, obj->base.size);
54 if (vma->gtt_view.type != I915_GTT_VIEW_NORMAL) {
56 vma->gtt_view.type);
68 struct i915_vma *vma;
71 vma = i915_vma_instance(obj, vm, view);
72 if (IS_ERR(vma))
73 return vma;
76 if (vma->vm != vm) {
78 vma->vm, vm);
82 if (i915_is_ggtt(vm) != i915_vma_is_ggtt(vma)) {
84 i915_vma_is_ggtt(vma), i915_is_ggtt(vm));
88 if (i915_vma_compare(vma, vm, view)) {
93 if (i915_vma_compare(vma, vma->vm,
94 i915_vma_is_ggtt(vma) ? &vma->gtt_view : NULL)) {
104 return vma;
119 struct i915_vma *vma;
123 vma = checked_vma_instance(obj, vm, NULL);
125 if (IS_ERR(vma))
126 return PTR_ERR(vma);
128 if (!assert_vma(vma, obj, ctx)) {
134 err = i915_vma_pin(vma, 0, 0, PIN_USER);
140 i915_vma_unpin(vma);
162 /* Exercise creating many vma amonst many objections, checking the
163 * vma creation and lookup routines.
227 static bool assert_pin_valid(const struct i915_vma *vma,
234 if (i915_vma_misplaced(vma, mode->size, 0, mode->flags))
241 static bool assert_pin_enospc(const struct i915_vma *vma,
249 static bool assert_pin_einval(const struct i915_vma *vma,
312 struct i915_vma *vma;
325 vma = checked_vma_instance(obj, &ggtt->vm, NULL);
326 if (IS_ERR(vma))
330 err = i915_vma_pin(vma, m->size, 0, m->flags);
331 if (!m->assert(vma, m, err)) {
337 i915_vma_unpin(vma);
343 i915_vma_unpin(vma);
344 err = i915_vma_unbind_unlocked(vma);
616 struct i915_vma *vma;
619 vma = checked_vma_instance(obj, vm, &view);
620 if (IS_ERR(vma)) {
621 err = PTR_ERR(vma);
625 err = i915_vma_pin(vma, 0, 0, PIN_GLOBAL);
634 vma->size != expected_pages * PAGE_SIZE) {
636 PAGE_SIZE * expected_pages, vma->size);
642 vma->size > expected_pages * PAGE_SIZE) {
644 PAGE_SIZE * expected_pages, vma->size);
649 if (vma->pages->nents > expected_pages) {
651 expected_pages, vma->pages->nents);
656 if (vma->node.size < vma->size) {
658 vma->size, vma->node.size);
663 if (vma->pages == obj->mm.pages) {
669 sg = vma->pages->sgl;
694 i915_vma_unpin(vma);
695 err = i915_vma_unbind_unlocked(vma);
714 struct i915_vma *vma,
721 for_each_sgt_daddr(dma, sgt, vma->pages) {
743 static bool assert_pin(struct i915_vma *vma,
750 if (vma->size != size) {
752 name, size, vma->size);
756 if (vma->node.size < vma->size) {
758 name, vma->size, vma->node.size);
763 if (memcmp(&vma->gtt_view, view, sizeof(*view))) {
769 if (vma->pages == vma->obj->mm.pages) {
775 if (vma->gtt_view.type != I915_GTT_VIEW_NORMAL) {
777 vma->gtt_view.type);
781 if (vma->pages != vma->obj->mm.pages) {
804 struct i915_vma *vma;
830 vma = checked_vma_instance(obj, vm, &view);
831 if (IS_ERR(vma)) {
832 err = PTR_ERR(vma);
836 err = i915_vma_pin(vma, 0, 0, PIN_GLOBAL);
840 if (!assert_pin(vma, &view, sz*PAGE_SIZE, p->name)) {
847 if (!assert_partial(obj, vma, offset, sz)) {
854 i915_vma_unpin(vma);
856 err = i915_vma_unbind_unlocked(vma);
867 list_for_each_entry(vma, &obj->vma.list, obj_link)
870 pr_err("(%s) All partial vma were not recorded on the obj->vma_list: found %u, expected %u\n",
877 vma = checked_vma_instance(obj, vm, NULL);
878 if (IS_ERR(vma)) {
879 err = PTR_ERR(vma);
883 err = i915_vma_pin(vma, 0, 0, PIN_GLOBAL);
887 if (!assert_pin(vma, NULL, obj->base.size, p->name)) {
893 i915_vma_unpin(vma);
895 err = i915_vma_unbind_unlocked(vma);
902 list_for_each_entry(vma, &obj->vma.list, obj_link)
905 pr_err("(%s) allocated an extra full vma!\n", p->name);
1004 struct i915_vma *vma;
1018 vma = i915_gem_object_ggtt_pin(obj, &view, 0, 0, PIN_MAPPABLE);
1019 if (IS_ERR(vma)) {
1020 err = PTR_ERR(vma);
1024 GEM_BUG_ON(vma->gtt_view.type != *t);
1026 map = i915_vma_pin_iomap(vma);
1027 i915_vma_unpin(vma);
1047 i915_vma_unpin_iomap(vma);
1049 vma = i915_gem_object_ggtt_pin(obj, NULL, 0, 0, PIN_MAPPABLE);
1050 if (IS_ERR(vma)) {
1051 err = PTR_ERR(vma);
1055 GEM_BUG_ON(vma->gtt_view.type != I915_GTT_VIEW_NORMAL);
1057 map = i915_vma_pin_iomap(vma);
1058 i915_vma_unpin(vma);
1081 i915_vma_unpin_iomap(vma);
1087 i915_vma_unpin_iomap(vma);