Lines Matching +full:offset +full:- +full:y
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);
76 if (vma->vm != vm) {
78 vma->vm, vm);
90 return ERR_PTR(-EINVAL);
93 if (i915_vma_compare(vma, vma->vm,
94 i915_vma_is_ggtt(vma) ? &vma->gtt_view : NULL)) {
96 return ERR_PTR(-EINVAL);
101 return ERR_PTR(-EINVAL);
130 return -EINVAL;
152 struct drm_i915_private *i915 = ggtt->vm.i915;
160 int err = -ENOMEM;
168 for_each_prime_number(num_obj, ULONG_MAX - 1) {
174 list_add(&obj->st_link, &objects);
184 list_move(&ctx->link, &contexts);
198 list_del_init(&ctx->link);
210 list_del_init(&ctx->link);
235 if (i915_vma_misplaced(vma, mode->size, 0, mode->flags))
246 return result == -ENOSPC;
254 return result == -EINVAL;
270 VALID(0, PIN_GLOBAL | PIN_OFFSET_BIAS | (ggtt->mappable_end - 4096)),
271 VALID(0, PIN_GLOBAL | PIN_MAPPABLE | PIN_OFFSET_BIAS | (ggtt->mappable_end - 4096)),
272 VALID(0, PIN_GLOBAL | PIN_OFFSET_BIAS | (ggtt->vm.total - 4096)),
274 VALID(0, PIN_GLOBAL | PIN_MAPPABLE | PIN_OFFSET_FIXED | (ggtt->mappable_end - 4096)),
275 INVALID(0, PIN_GLOBAL | PIN_MAPPABLE | PIN_OFFSET_FIXED | ggtt->mappable_end),
276 VALID(0, PIN_GLOBAL | PIN_OFFSET_FIXED | (ggtt->vm.total - 4096)),
277 INVALID(0, PIN_GLOBAL | PIN_OFFSET_FIXED | ggtt->vm.total),
282 VALID(ggtt->mappable_end - 4096, PIN_GLOBAL | PIN_MAPPABLE),
283 VALID(ggtt->mappable_end, PIN_GLOBAL | PIN_MAPPABLE),
284 NOSPACE(ggtt->mappable_end + 4096, PIN_GLOBAL | PIN_MAPPABLE),
285 VALID(ggtt->vm.total - 4096, PIN_GLOBAL),
286 VALID(ggtt->vm.total, PIN_GLOBAL),
287 NOSPACE(ggtt->vm.total + 4096, PIN_GLOBAL),
289 INVALID(8192, PIN_GLOBAL | PIN_MAPPABLE | PIN_OFFSET_FIXED | (ggtt->mappable_end - 4096)),
290 INVALID(8192, PIN_GLOBAL | PIN_OFFSET_FIXED | (ggtt->vm.total - 4096)),
291 INVALID(8192, PIN_GLOBAL | PIN_OFFSET_FIXED | (round_down(U64_MAX, PAGE_SIZE) - 4096)),
293 VALID(8192, PIN_GLOBAL | PIN_OFFSET_BIAS | (ggtt->mappable_end - 4096)),
302 NOSPACE(0, PIN_GLOBAL | PIN_MAPPABLE | PIN_OFFSET_BIAS | ggtt->mappable_end),
303 NOSPACE(0, PIN_GLOBAL | PIN_OFFSET_BIAS | ggtt->vm.total),
304 NOSPACE(8192, PIN_GLOBAL | PIN_MAPPABLE | PIN_OFFSET_BIAS | (ggtt->mappable_end - 4096)),
305 NOSPACE(8192, PIN_GLOBAL | PIN_OFFSET_BIAS | (ggtt->vm.total - 4096)),
315 int err = -EINVAL;
322 GEM_BUG_ON(!drm_mm_clean(&ggtt->vm.mm));
324 obj = i915_gem_object_create_internal(ggtt->vm.i915, PAGE_SIZE);
328 vma = checked_vma_instance(obj, &ggtt->vm, NULL);
332 for (m = modes; m->assert; m++) {
333 err = i915_vma_pin(vma, m->size, 0, m->flags);
334 if (!m->assert(vma, m, err)) {
336 m->assert == assert_pin_valid ? "Failed" : "Unexpectedly succeeded",
337 (int)(m - modes), m->string, m->size, m->flags,
341 err = -EINVAL;
366 unsigned int y)
368 return (r->plane[n].src_stride * (r->plane[n].height - y - 1) +
369 r->plane[n].offset + x);
377 unsigned int x, y;
379 for (x = 0; x < r->plane[n].width; x++) {
382 for (y = 0; y < r->plane[n].height; y++) {
388 n, x, y);
389 return ERR_PTR(-EINVAL);
392 src_idx = rotated_index(r, n, x, y);
398 x, y, src_idx);
399 return ERR_PTR(-EINVAL);
404 x, y, src_idx);
405 return ERR_PTR(-EINVAL);
411 left = (r->plane[n].dst_stride - y) * PAGE_SIZE;
418 n, x, y);
419 return ERR_PTR(-EINVAL);
424 sg_dma_len(sg), left, x, y);
425 return ERR_PTR(-EINVAL);
430 &sg_dma_address(sg), x, y);
431 return ERR_PTR(-EINVAL);
443 unsigned int y)
445 return (r->plane[n].src_stride * y +
446 r->plane[n].offset + x);
454 unsigned int x, y;
456 unsigned int offset;
458 for (y = 0; y < r->plane[n].height; y++) {
459 for (x = 0; x < r->plane[n].width; x++) {
465 n, x, y);
466 return ERR_PTR(-EINVAL);
469 offset = 0;
473 src_idx = remapped_index(r, n, x, y);
476 if (left < PAGE_SIZE || left & (PAGE_SIZE-1)) {
479 x, y, src_idx);
480 return ERR_PTR(-EINVAL);
483 if (sg_dma_address(sg) + offset != src) {
485 x, y, src_idx);
486 return ERR_PTR(-EINVAL);
489 left -= PAGE_SIZE;
490 offset += PAGE_SIZE;
500 x, y);
501 return ERR_PTR(-EINVAL);
504 left = (r->plane[n].dst_stride - r->plane[n].width) * PAGE_SIZE;
511 n, x, y);
512 return ERR_PTR(-EINVAL);
518 x, y);
519 return ERR_PTR(-EINVAL);
525 x, y);
526 return ERR_PTR(-EINVAL);
542 return a->dst_stride * a->width + b->dst_stride * b->width;
544 return a->dst_stride * a->height + b->dst_stride * b->height;
550 struct i915_address_space *vm = &ggtt->vm;
581 int err = -ENOMEM;
588 obj = i915_gem_object_create_internal(vm->i915, max_pages * PAGE_SIZE);
593 for (a = planes; a->width; a++) {
594 for (b = planes + ARRAY_SIZE(planes); b-- != planes; ) {
606 max_offset = max_pages - max_offset;
617 for_each_prime_number_from(plane_info[0].offset, 0, max_offset) {
618 for_each_prime_number_from(plane_info[1].offset, 0, max_offset) {
638 vma->size != expected_pages * PAGE_SIZE) {
640 PAGE_SIZE * expected_pages, vma->size);
641 err = -EINVAL;
646 vma->size > expected_pages * PAGE_SIZE) {
648 PAGE_SIZE * expected_pages, vma->size);
649 err = -EINVAL;
653 if (vma->pages->nents > expected_pages) {
655 expected_pages, vma->pages->nents);
656 err = -EINVAL;
660 if (vma->node.size < vma->size) {
662 vma->size, vma->node.size);
663 err = -EINVAL;
667 if (vma->pages == obj->mm.pages) {
669 err = -EINVAL;
673 sg = vma->pages->sgl;
687 plane_info[0].offset,
692 plane_info[1].offset);
693 err = -EINVAL;
719 unsigned long offset,
725 for_each_sgt_daddr(dma, sgt, vma->pages) {
733 src = i915_gem_object_get_dma_address(obj, offset);
735 pr_err("DMA mismatch for partial page offset %lu\n",
736 offset);
740 offset++;
741 size--;
754 if (vma->size != size) {
756 name, size, vma->size);
760 if (vma->node.size < vma->size) {
762 name, vma->size, vma->node.size);
766 if (view && view->type != I915_GTT_VIEW_NORMAL) {
767 if (memcmp(&vma->gtt_view, view, sizeof(*view))) {
773 if (vma->pages == vma->obj->mm.pages) {
779 if (vma->gtt_view.type != I915_GTT_VIEW_NORMAL) {
781 vma->gtt_view.type);
785 if (vma->pages != vma->obj->mm.pages) {
797 struct i915_address_space *vm = &ggtt->vm;
807 unsigned int sz, offset;
809 int err = -ENOMEM;
816 obj = i915_gem_object_create_internal(vm->i915, npages * PAGE_SIZE);
820 for (p = phases; p->name; p++) { /* exercise both create/lookup */
825 for_each_prime_number_from(offset, 0, npages - sz) {
829 view.partial.offset = offset;
845 if (!assert_pin(vma, &view, sz*PAGE_SIZE, p->name)) {
846 pr_err("(%s) Inconsistent partial pinning for (offset=%d, size=%d)\n",
847 p->name, offset, sz);
848 err = -EINVAL;
852 if (!assert_partial(obj, vma, offset, sz)) {
853 pr_err("(%s) Inconsistent partial pages for (offset=%d, size=%d)\n",
854 p->name, offset, sz);
855 err = -EINVAL;
872 list_for_each_entry(vma, &obj->vma.list, obj_link)
875 pr_err("(%s) All partial vma were not recorded on the obj->vma_list: found %u, expected %u\n",
876 p->name, count, nvma);
877 err = -EINVAL;
892 if (!assert_pin(vma, NULL, obj->base.size, p->name)) {
893 pr_err("(%s) inconsistent full pin\n", p->name);
894 err = -EINVAL;
907 list_for_each_entry(vma, &obj->vma.list, obj_link)
910 pr_err("(%s) allocated an extra full vma!\n", p->name);
911 err = -EINVAL;
936 return -ENOMEM;
947 err = i915_subtests(tests, gt->ggtt);
951 mock_fini_ggtt(gt->ggtt);
993 if (!i915_ggtt_has_aperture(to_gt(i915)->ggtt))
1000 wakeref = intel_runtime_pm_get(&i915->runtime_pm);
1003 for (p = planes; p->width; p++) {
1011 unsigned int x, y;
1021 p->height : p->width;
1029 GEM_BUG_ON(vma->gtt_view.type != *t);
1038 for (y = 0 ; y < plane_info[0].height; y++) {
1040 unsigned int offset;
1041 u32 val = y << 16 | x;
1044 offset = (x * plane_info[0].dst_stride + y) * PAGE_SIZE;
1046 offset = (y * plane_info[0].dst_stride + x) * PAGE_SIZE;
1048 iowrite32(val, &map[offset / sizeof(*map)]);
1060 GEM_BUG_ON(vma->gtt_view.type != I915_GTT_VIEW_NORMAL);
1069 for (y = 0 ; y < plane_info[0].height; y++) {
1071 unsigned int offset, src_idx;
1072 u32 exp = y << 16 | x;
1076 src_idx = rotated_index(&view.rotated, 0, x, y);
1078 src_idx = remapped_index(&view.remapped, 0, x, y);
1079 offset = src_idx * PAGE_SIZE;
1081 val = ioread32(&map[offset / sizeof(*map)]);
1087 err = -EINVAL;
1099 intel_runtime_pm_put(&i915->runtime_pm, wakeref);