Lines Matching +full:height +full:- +full:mm

43 	if (vma->vm != ctx->vm) {  in assert_vma()
48 if (vma->size != obj->base.size) { in assert_vma()
50 vma->size, obj->base.size); in assert_vma()
54 if (vma->gtt_view.type != I915_GTT_VIEW_NORMAL) { in assert_vma()
56 vma->gtt_view.type); in assert_vma()
76 if (vma->vm != vm) { in checked_vma_instance()
78 vma->vm, vm); in checked_vma_instance()
90 return ERR_PTR(-EINVAL); in checked_vma_instance()
93 if (i915_vma_compare(vma, vma->vm, in checked_vma_instance()
94 i915_vma_is_ggtt(vma) ? &vma->gtt_view : NULL)) { in checked_vma_instance()
96 return ERR_PTR(-EINVAL); in checked_vma_instance()
101 return ERR_PTR(-EINVAL); in checked_vma_instance()
130 return -EINVAL; in create_vmas()
152 struct drm_i915_private *i915 = ggtt->vm.i915; in igt_vma_create()
160 int err = -ENOMEM; in igt_vma_create()
167 for_each_prime_number(num_obj, ULONG_MAX - 1) { in igt_vma_create()
173 list_add(&obj->st_link, &objects); in igt_vma_create()
183 list_move(&ctx->link, &contexts); in igt_vma_create()
197 list_del_init(&ctx->link); in igt_vma_create()
209 list_del_init(&ctx->link); in igt_vma_create()
234 if (i915_vma_misplaced(vma, mode->size, 0, mode->flags)) in assert_pin_valid()
245 return result == -ENOSPC; in assert_pin_enospc()
253 return result == -EINVAL; in assert_pin_einval()
269 VALID(0, PIN_GLOBAL | PIN_OFFSET_BIAS | (ggtt->mappable_end - 4096)), in igt_vma_pin1()
270 VALID(0, PIN_GLOBAL | PIN_MAPPABLE | PIN_OFFSET_BIAS | (ggtt->mappable_end - 4096)), in igt_vma_pin1()
271 VALID(0, PIN_GLOBAL | PIN_OFFSET_BIAS | (ggtt->vm.total - 4096)), in igt_vma_pin1()
273 VALID(0, PIN_GLOBAL | PIN_MAPPABLE | PIN_OFFSET_FIXED | (ggtt->mappable_end - 4096)), in igt_vma_pin1()
274 INVALID(0, PIN_GLOBAL | PIN_MAPPABLE | PIN_OFFSET_FIXED | ggtt->mappable_end), in igt_vma_pin1()
275 VALID(0, PIN_GLOBAL | PIN_OFFSET_FIXED | (ggtt->vm.total - 4096)), in igt_vma_pin1()
276 INVALID(0, PIN_GLOBAL | PIN_OFFSET_FIXED | ggtt->vm.total), in igt_vma_pin1()
281 VALID(ggtt->mappable_end - 4096, PIN_GLOBAL | PIN_MAPPABLE), in igt_vma_pin1()
282 VALID(ggtt->mappable_end, PIN_GLOBAL | PIN_MAPPABLE), in igt_vma_pin1()
283 NOSPACE(ggtt->mappable_end + 4096, PIN_GLOBAL | PIN_MAPPABLE), in igt_vma_pin1()
284 VALID(ggtt->vm.total - 4096, PIN_GLOBAL), in igt_vma_pin1()
285 VALID(ggtt->vm.total, PIN_GLOBAL), in igt_vma_pin1()
286 NOSPACE(ggtt->vm.total + 4096, PIN_GLOBAL), in igt_vma_pin1()
288 INVALID(8192, PIN_GLOBAL | PIN_MAPPABLE | PIN_OFFSET_FIXED | (ggtt->mappable_end - 4096)), in igt_vma_pin1()
289 INVALID(8192, PIN_GLOBAL | PIN_OFFSET_FIXED | (ggtt->vm.total - 4096)), in igt_vma_pin1()
290 INVALID(8192, PIN_GLOBAL | PIN_OFFSET_FIXED | (round_down(U64_MAX, PAGE_SIZE) - 4096)), in igt_vma_pin1()
292 VALID(8192, PIN_GLOBAL | PIN_OFFSET_BIAS | (ggtt->mappable_end - 4096)), in igt_vma_pin1()
300 NOSPACE(0, PIN_GLOBAL | PIN_MAPPABLE | PIN_OFFSET_BIAS | ggtt->mappable_end), in igt_vma_pin1()
301 NOSPACE(0, PIN_GLOBAL | PIN_OFFSET_BIAS | ggtt->vm.total), in igt_vma_pin1()
302 NOSPACE(8192, PIN_GLOBAL | PIN_MAPPABLE | PIN_OFFSET_BIAS | (ggtt->mappable_end - 4096)), in igt_vma_pin1()
303 NOSPACE(8192, PIN_GLOBAL | PIN_OFFSET_BIAS | (ggtt->vm.total - 4096)), in igt_vma_pin1()
313 int err = -EINVAL; in igt_vma_pin1()
319 GEM_BUG_ON(!drm_mm_clean(&ggtt->vm.mm)); in igt_vma_pin1()
321 obj = i915_gem_object_create_internal(ggtt->vm.i915, PAGE_SIZE); in igt_vma_pin1()
325 vma = checked_vma_instance(obj, &ggtt->vm, NULL); in igt_vma_pin1()
329 for (m = modes; m->assert; m++) { in igt_vma_pin1()
330 err = i915_vma_pin(vma, m->size, 0, m->flags); in igt_vma_pin1()
331 if (!m->assert(vma, m, err)) { in igt_vma_pin1()
333 m->assert == assert_pin_valid ? "Failed" : "Unexpectedly succeeded", in igt_vma_pin1()
334 (int)(m - modes), m->string, m->size, m->flags, in igt_vma_pin1()
338 err = -EINVAL; in igt_vma_pin1()
365 return (r->plane[n].src_stride * (r->plane[n].height - y - 1) + in rotated_index()
366 r->plane[n].offset + x); in rotated_index()
376 for (x = 0; x < r->plane[n].width; x++) { in assert_rotated()
379 for (y = 0; y < r->plane[n].height; y++) { in assert_rotated()
386 return ERR_PTR(-EINVAL); in assert_rotated()
396 return ERR_PTR(-EINVAL); in assert_rotated()
402 return ERR_PTR(-EINVAL); in assert_rotated()
408 left = (r->plane[n].dst_stride - y) * PAGE_SIZE; in assert_rotated()
416 return ERR_PTR(-EINVAL); in assert_rotated()
422 return ERR_PTR(-EINVAL); in assert_rotated()
428 return ERR_PTR(-EINVAL); in assert_rotated()
442 return (r->plane[n].src_stride * y + in remapped_index()
443 r->plane[n].offset + x); in remapped_index()
455 for (y = 0; y < r->plane[n].height; y++) { in assert_remapped()
456 for (x = 0; x < r->plane[n].width; x++) { in assert_remapped()
463 return ERR_PTR(-EINVAL); in assert_remapped()
473 if (left < PAGE_SIZE || left & (PAGE_SIZE-1)) { in assert_remapped()
477 return ERR_PTR(-EINVAL); in assert_remapped()
483 return ERR_PTR(-EINVAL); in assert_remapped()
486 left -= PAGE_SIZE; in assert_remapped()
498 return ERR_PTR(-EINVAL); in assert_remapped()
501 left = (r->plane[n].dst_stride - r->plane[n].width) * PAGE_SIZE; in assert_remapped()
509 return ERR_PTR(-EINVAL); in assert_remapped()
516 return ERR_PTR(-EINVAL); in assert_remapped()
523 return ERR_PTR(-EINVAL); in assert_remapped()
539 return a->dst_stride * a->width + b->dst_stride * b->width; in remapped_size()
541 return a->dst_stride * a->height + b->dst_stride * b->height; in remapped_size()
547 struct i915_address_space *vm = &ggtt->vm; in igt_vma_rotate_remap()
550 { .width = 1, .height = 1, .src_stride = 1 }, in igt_vma_rotate_remap()
551 { .width = 2, .height = 2, .src_stride = 2 }, in igt_vma_rotate_remap()
552 { .width = 4, .height = 4, .src_stride = 4 }, in igt_vma_rotate_remap()
553 { .width = 8, .height = 8, .src_stride = 8 }, in igt_vma_rotate_remap()
555 { .width = 3, .height = 5, .src_stride = 3 }, in igt_vma_rotate_remap()
556 { .width = 3, .height = 5, .src_stride = 4 }, in igt_vma_rotate_remap()
557 { .width = 3, .height = 5, .src_stride = 5 }, in igt_vma_rotate_remap()
559 { .width = 5, .height = 3, .src_stride = 5 }, in igt_vma_rotate_remap()
560 { .width = 5, .height = 3, .src_stride = 7 }, in igt_vma_rotate_remap()
561 { .width = 5, .height = 3, .src_stride = 9 }, in igt_vma_rotate_remap()
563 { .width = 4, .height = 6, .src_stride = 6 }, in igt_vma_rotate_remap()
564 { .width = 6, .height = 4, .src_stride = 6 }, in igt_vma_rotate_remap()
566 { .width = 2, .height = 2, .src_stride = 2, .dst_stride = 2 }, in igt_vma_rotate_remap()
567 { .width = 3, .height = 3, .src_stride = 3, .dst_stride = 4 }, in igt_vma_rotate_remap()
568 { .width = 5, .height = 6, .src_stride = 7, .dst_stride = 8 }, in igt_vma_rotate_remap()
578 int err = -ENOMEM; in igt_vma_rotate_remap()
584 obj = i915_gem_object_create_internal(vm->i915, max_pages * PAGE_SIZE); in igt_vma_rotate_remap()
589 for (a = planes; a->width; a++) { in igt_vma_rotate_remap()
590 for (b = planes + ARRAY_SIZE(planes); b-- != planes; ) { in igt_vma_rotate_remap()
599 max_offset = max(plane_info[0].src_stride * plane_info[0].height, in igt_vma_rotate_remap()
600 plane_info[1].src_stride * plane_info[1].height); in igt_vma_rotate_remap()
602 max_offset = max_pages - max_offset; in igt_vma_rotate_remap()
606 plane_info[0].height : in igt_vma_rotate_remap()
610 plane_info[1].height : in igt_vma_rotate_remap()
634 vma->size != expected_pages * PAGE_SIZE) { in igt_vma_rotate_remap()
636 PAGE_SIZE * expected_pages, vma->size); in igt_vma_rotate_remap()
637 err = -EINVAL; in igt_vma_rotate_remap()
642 vma->size > expected_pages * PAGE_SIZE) { in igt_vma_rotate_remap()
644 PAGE_SIZE * expected_pages, vma->size); in igt_vma_rotate_remap()
645 err = -EINVAL; in igt_vma_rotate_remap()
649 if (vma->pages->nents > expected_pages) { in igt_vma_rotate_remap()
651 expected_pages, vma->pages->nents); in igt_vma_rotate_remap()
652 err = -EINVAL; in igt_vma_rotate_remap()
656 if (vma->node.size < vma->size) { in igt_vma_rotate_remap()
658 vma->size, vma->node.size); in igt_vma_rotate_remap()
659 err = -EINVAL; in igt_vma_rotate_remap()
663 if (vma->pages == obj->mm.pages) { in igt_vma_rotate_remap()
665 err = -EINVAL; in igt_vma_rotate_remap()
669 sg = vma->pages->sgl; in igt_vma_rotate_remap()
680 plane_info[0].height, in igt_vma_rotate_remap()
685 plane_info[1].height, in igt_vma_rotate_remap()
689 err = -EINVAL; in igt_vma_rotate_remap()
721 for_each_sgt_daddr(dma, sgt, vma->pages) { in assert_partial()
737 size--; in assert_partial()
750 if (vma->size != size) { in assert_pin()
752 name, size, vma->size); in assert_pin()
756 if (vma->node.size < vma->size) { in assert_pin()
758 name, vma->size, vma->node.size); in assert_pin()
762 if (view && view->type != I915_GTT_VIEW_NORMAL) { in assert_pin()
763 if (memcmp(&vma->gtt_view, view, sizeof(*view))) { in assert_pin()
769 if (vma->pages == vma->obj->mm.pages) { in assert_pin()
775 if (vma->gtt_view.type != I915_GTT_VIEW_NORMAL) { in assert_pin()
777 vma->gtt_view.type); in assert_pin()
781 if (vma->pages != vma->obj->mm.pages) { in assert_pin()
793 struct i915_address_space *vm = &ggtt->vm; in igt_vma_partial()
805 int err = -ENOMEM; in igt_vma_partial()
811 obj = i915_gem_object_create_internal(vm->i915, npages * PAGE_SIZE); in igt_vma_partial()
815 for (p = phases; p->name; p++) { /* exercise both create/lookup */ in igt_vma_partial()
820 for_each_prime_number_from(offset, 0, npages - sz) { in igt_vma_partial()
840 if (!assert_pin(vma, &view, sz*PAGE_SIZE, p->name)) { in igt_vma_partial()
842 p->name, offset, sz); in igt_vma_partial()
843 err = -EINVAL; in igt_vma_partial()
849 p->name, offset, sz); in igt_vma_partial()
850 err = -EINVAL; in igt_vma_partial()
867 list_for_each_entry(vma, &obj->vma.list, obj_link) in igt_vma_partial()
870 pr_err("(%s) All partial vma were not recorded on the obj->vma_list: found %u, expected %u\n", in igt_vma_partial()
871 p->name, count, nvma); in igt_vma_partial()
872 err = -EINVAL; in igt_vma_partial()
887 if (!assert_pin(vma, NULL, obj->base.size, p->name)) { in igt_vma_partial()
888 pr_err("(%s) inconsistent full pin\n", p->name); in igt_vma_partial()
889 err = -EINVAL; in igt_vma_partial()
902 list_for_each_entry(vma, &obj->vma.list, obj_link) in igt_vma_partial()
905 pr_err("(%s) allocated an extra full vma!\n", p->name); in igt_vma_partial()
906 err = -EINVAL; in igt_vma_partial()
931 return -ENOMEM; in i915_vma_mock_selftests()
942 err = i915_subtests(tests, gt->ggtt); in i915_vma_mock_selftests()
946 mock_fini_ggtt(gt->ggtt); in i915_vma_mock_selftests()
957 { .width = 1, .height = 1, .src_stride = 1 }, in igt_vma_remapped_gtt()
958 { .width = 2, .height = 2, .src_stride = 2 }, in igt_vma_remapped_gtt()
959 { .width = 4, .height = 4, .src_stride = 4 }, in igt_vma_remapped_gtt()
960 { .width = 8, .height = 8, .src_stride = 8 }, in igt_vma_remapped_gtt()
962 { .width = 3, .height = 5, .src_stride = 3 }, in igt_vma_remapped_gtt()
963 { .width = 3, .height = 5, .src_stride = 4 }, in igt_vma_remapped_gtt()
964 { .width = 3, .height = 5, .src_stride = 5 }, in igt_vma_remapped_gtt()
966 { .width = 5, .height = 3, .src_stride = 5 }, in igt_vma_remapped_gtt()
967 { .width = 5, .height = 3, .src_stride = 7 }, in igt_vma_remapped_gtt()
968 { .width = 5, .height = 3, .src_stride = 9 }, in igt_vma_remapped_gtt()
970 { .width = 4, .height = 6, .src_stride = 6 }, in igt_vma_remapped_gtt()
971 { .width = 6, .height = 4, .src_stride = 6 }, in igt_vma_remapped_gtt()
973 { .width = 2, .height = 2, .src_stride = 2, .dst_stride = 2 }, in igt_vma_remapped_gtt()
974 { .width = 3, .height = 3, .src_stride = 3, .dst_stride = 4 }, in igt_vma_remapped_gtt()
975 { .width = 5, .height = 6, .src_stride = 7, .dst_stride = 8 }, in igt_vma_remapped_gtt()
988 if (!i915_ggtt_has_aperture(to_gt(i915)->ggtt)) in igt_vma_remapped_gtt()
995 wakeref = intel_runtime_pm_get(&i915->runtime_pm); in igt_vma_remapped_gtt()
998 for (p = planes; p->width; p++) { in igt_vma_remapped_gtt()
1016 p->height : p->width; in igt_vma_remapped_gtt()
1024 GEM_BUG_ON(vma->gtt_view.type != *t); in igt_vma_remapped_gtt()
1033 for (y = 0 ; y < plane_info[0].height; y++) { in igt_vma_remapped_gtt()
1055 GEM_BUG_ON(vma->gtt_view.type != I915_GTT_VIEW_NORMAL); in igt_vma_remapped_gtt()
1064 for (y = 0 ; y < plane_info[0].height; y++) { in igt_vma_remapped_gtt()
1082 err = -EINVAL; in igt_vma_remapped_gtt()
1094 intel_runtime_pm_put(&i915->runtime_pm, wakeref); in igt_vma_remapped_gtt()