• Home
  • Raw
  • Download

Lines Matching refs:vma

38 	struct i915_vma *vma;  member
251 struct eb_vma *vma; member
379 const struct i915_vma *vma, in eb_vma_misplaced() argument
382 const u64 start = i915_vma_offset(vma); in eb_vma_misplaced()
383 const u64 size = i915_vma_size(vma); in eb_vma_misplaced()
404 !i915_vma_is_map_and_fenceable(vma)) in eb_vma_misplaced()
441 struct i915_vma *vma = ev->vma; in eb_pin_vma() local
445 if (vma->node.size) in eb_pin_vma()
446 pin_flags = __i915_vma_offset(vma); in eb_pin_vma()
455 err = i915_vma_pin_ww(vma, &eb->ww, 0, 0, pin_flags); in eb_pin_vma()
464 err = i915_vma_pin_ww(vma, &eb->ww, in eb_pin_vma()
474 err = i915_vma_pin_fence(vma); in eb_pin_vma()
478 if (vma->fence) in eb_pin_vma()
483 if (eb_vma_misplaced(entry, vma, ev->flags)) in eb_pin_vma()
493 __i915_vma_unpin_fence(ev->vma); in eb_unreserve_vma()
501 struct i915_vma *vma) in eb_validate_vma() argument
544 i915_gem_object_is_tiled(vma->obj)) in eb_validate_vma()
563 struct i915_vma *vma) in eb_add_vma() argument
567 struct eb_vma *ev = &eb->vma[i]; in eb_add_vma()
569 ev->vma = vma; in eb_add_vma()
610 ev->vma->size)) { in eb_add_vma()
616 eb->batch_len[*current_batch] = ev->vma->size - in eb_add_vma()
659 struct i915_vma *vma = ev->vma; in eb_reserve_vma() local
662 if (drm_mm_node_allocated(&vma->node) && in eb_reserve_vma()
663 eb_vma_misplaced(entry, vma, ev->flags)) { in eb_reserve_vma()
664 err = i915_vma_unbind(vma); in eb_reserve_vma()
669 err = i915_vma_pin_ww(vma, &eb->ww, in eb_reserve_vma()
675 if (entry->offset != i915_vma_offset(vma)) { in eb_reserve_vma()
676 entry->offset = i915_vma_offset(vma) | UPDATE; in eb_reserve_vma()
681 err = i915_vma_pin_fence(vma); in eb_reserve_vma()
685 if (vma->fence) in eb_reserve_vma()
690 GEM_BUG_ON(eb_vma_misplaced(entry, vma, ev->flags)); in eb_reserve_vma()
707 struct eb_vma *ev = &eb->vma[i]; in eb_unbind()
838 u32 handle, struct i915_vma *vma) in __eb_add_lut() argument
848 i915_vma_get(vma); in __eb_add_lut()
849 if (!atomic_fetch_inc(&vma->open_count)) in __eb_add_lut()
850 i915_vma_reopen(vma); in __eb_add_lut()
858 err = radix_tree_insert(&ctx->handles_vma, handle, vma); in __eb_add_lut()
862 struct drm_i915_gem_object *obj = vma->obj; in __eb_add_lut()
881 i915_vma_close(vma); in __eb_add_lut()
882 i915_vma_put(vma); in __eb_add_lut()
893 struct i915_vma *vma; in eb_lookup_vma() local
897 vma = radix_tree_lookup(&eb->gem_context->handles_vma, handle); in eb_lookup_vma()
898 if (likely(vma && vma->vm == vm)) in eb_lookup_vma()
899 vma = i915_vma_tryget(vma); in eb_lookup_vma()
901 if (likely(vma)) in eb_lookup_vma()
902 return vma; in eb_lookup_vma()
924 vma = i915_vma_instance(obj, vm, NULL); in eb_lookup_vma()
925 if (IS_ERR(vma)) { in eb_lookup_vma()
927 return vma; in eb_lookup_vma()
930 err = __eb_add_lut(eb, handle, vma); in eb_lookup_vma()
932 return vma; in eb_lookup_vma()
948 struct i915_vma *vma; in eb_lookup_vmas() local
950 vma = eb_lookup_vma(eb, eb->exec[i].handle); in eb_lookup_vmas()
951 if (IS_ERR(vma)) { in eb_lookup_vmas()
952 err = PTR_ERR(vma); in eb_lookup_vmas()
956 err = eb_validate_vma(eb, &eb->exec[i], vma); in eb_lookup_vmas()
958 i915_vma_put(vma); in eb_lookup_vmas()
962 err = eb_add_vma(eb, &current_batch, i, vma); in eb_lookup_vmas()
966 if (i915_gem_object_is_userptr(vma->obj)) { in eb_lookup_vmas()
967 err = i915_gem_object_userptr_submit_init(vma->obj); in eb_lookup_vmas()
976 eb->vma[i + 1].vma = NULL; in eb_lookup_vmas()
982 eb->vma[i].flags |= __EXEC_OBJECT_USERPTR_INIT; in eb_lookup_vmas()
990 eb->vma[i].vma = NULL; in eb_lookup_vmas()
1000 struct eb_vma *ev = &eb->vma[i]; in eb_lock_vmas()
1001 struct i915_vma *vma = ev->vma; in eb_lock_vmas() local
1003 err = i915_gem_object_lock(vma->obj, &eb->ww); in eb_lock_vmas()
1024 struct eb_vma *ev = &eb->vma[i]; in eb_validate_vmas()
1025 struct i915_vma *vma = ev->vma; in eb_validate_vmas() local
1032 if (entry->offset != i915_vma_offset(vma)) { in eb_validate_vmas()
1033 entry->offset = i915_vma_offset(vma) | UPDATE; in eb_validate_vmas()
1040 if (drm_mm_node_allocated(&vma->node)) { in eb_validate_vmas()
1041 err = i915_vma_unbind(vma); in eb_validate_vmas()
1048 err = dma_resv_reserve_fences(vma->obj->base.resv, eb->num_batches); in eb_validate_vmas()
1052 GEM_BUG_ON(drm_mm_node_allocated(&vma->node) && in eb_validate_vmas()
1053 eb_vma_misplaced(&eb->exec[i], vma, ev->flags)); in eb_validate_vmas()
1068 return &eb->vma[handle]; in eb_get_vma()
1088 struct eb_vma *ev = &eb->vma[i]; in eb_release_vmas()
1089 struct i915_vma *vma = ev->vma; in eb_release_vmas() local
1091 if (!vma) in eb_release_vmas()
1097 i915_vma_put(vma); in eb_release_vmas()
1280 struct i915_vma *vma = ERR_PTR(-ENODEV); in reloc_iomap() local
1302 vma = i915_gem_object_ggtt_pin_ww(obj, &eb->ww, NULL, 0, 0, in reloc_iomap()
1308 if (vma == ERR_PTR(-EDEADLK)) in reloc_iomap()
1309 return vma; in reloc_iomap()
1311 if (IS_ERR(vma)) { in reloc_iomap()
1323 cache->node.start = i915_ggtt_offset(vma); in reloc_iomap()
1324 cache->node.mm = (void *)vma; in reloc_iomap()
1348 static void *reloc_vaddr(struct i915_vma *vma, in reloc_vaddr() argument
1360 vaddr = reloc_iomap(vma, eb, page); in reloc_vaddr()
1362 vaddr = reloc_kmap(vma->obj, cache, page); in reloc_vaddr()
1390 relocate_entry(struct i915_vma *vma, in relocate_entry() argument
1401 vaddr = reloc_vaddr(vma, eb, in relocate_entry()
1469 !i915_vma_is_bound(target->vma, I915_VMA_GLOBAL_BIND)) { in eb_relocate_entry()
1470 struct i915_vma *vma = target->vma; in eb_relocate_entry() local
1473 mutex_lock(&vma->vm->mutex); in eb_relocate_entry()
1474 err = i915_vma_bind(target->vma, in eb_relocate_entry()
1475 target->vma->obj->pat_index, in eb_relocate_entry()
1477 mutex_unlock(&vma->vm->mutex); in eb_relocate_entry()
1478 reloc_cache_remap(&eb->reloc_cache, ev->vma->obj); in eb_relocate_entry()
1489 gen8_canonical_addr(i915_vma_offset(target->vma)) == reloc->presumed_offset) in eb_relocate_entry()
1494 ev->vma->size - (eb->reloc_cache.use_64bit_reloc ? 8 : 4))) { in eb_relocate_entry()
1499 (int)ev->vma->size); in eb_relocate_entry()
1521 return relocate_entry(ev->vma, reloc, eb, target->vma); in eb_relocate_entry()
1765 struct eb_vma *ev = &eb->vma[i]; in eb_reinit_userptr()
1767 if (!i915_gem_object_is_userptr(ev->vma->obj)) in eb_reinit_userptr()
1770 ret = i915_gem_object_userptr_submit_init(ev->vma->obj); in eb_reinit_userptr()
2008 struct eb_vma *ev = &eb->vma[i]; in eb_capture_stage()
2009 struct i915_vma *vma = ev->vma; in eb_capture_stage() local
2027 capture->vma_res = i915_vma_resource_get(vma->resource); in eb_capture_stage()
2100 struct eb_vma *ev = &eb->vma[i]; in eb_move_to_gpu()
2101 struct i915_vma *vma = ev->vma; in eb_move_to_gpu() local
2103 struct drm_i915_gem_object *obj = vma->obj; in eb_move_to_gpu()
2105 assert_vma_held(vma); in eb_move_to_gpu()
2148 err = _i915_vma_move_to_active(vma, eb->requests[j], in eb_move_to_gpu()
2167 struct eb_vma *ev = &eb->vma[i]; in eb_move_to_gpu()
2168 struct drm_i915_gem_object *obj = ev->vma->obj; in eb_move_to_gpu()
2258 struct i915_vma *vma; in shadow_batch_pin() local
2261 vma = i915_vma_instance(obj, vm, NULL); in shadow_batch_pin()
2262 if (IS_ERR(vma)) in shadow_batch_pin()
2263 return vma; in shadow_batch_pin()
2265 err = i915_vma_pin_ww(vma, &eb->ww, 0, 0, flags | PIN_VALIDATE); in shadow_batch_pin()
2269 return vma; in shadow_batch_pin()
2272 static struct i915_vma *eb_dispatch_secure(struct i915_execbuffer *eb, struct i915_vma *vma) in eb_dispatch_secure() argument
2279 return i915_gem_object_ggtt_pin_ww(vma->obj, &eb->ww, NULL, 0, 0, PIN_VALIDATE); in eb_dispatch_secure()
2293 batch = eb_dispatch_secure(eb, eb->batches[0]->vma); in eb_parse()
2364 eb->batches[0]->vma, in eb_parse()
2371 eb->batches[0] = &eb->vma[eb->buffer_count++]; in eb_parse()
2372 eb->batches[0]->vma = i915_vma_get(shadow); in eb_parse()
2383 eb->batches[0] = &eb->vma[eb->buffer_count++]; in eb_parse()
2385 eb->batches[0]->vma = i915_vma_get(batch); in eb_parse()
2453 eb->batches[i]->vma, in eb_submit()
3346 if (eb->batches[i]->vma) in eb_requests_create()
3348 i915_vma_resource_get(eb->batches[i]->vma->resource); in eb_requests_create()
3383 eb.vma = (struct eb_vma *)(exec + args->buffer_count + 1); in i915_gem_do_execbuffer()
3384 eb.vma[0].vma = NULL; in i915_gem_do_execbuffer()