Lines Matching refs:bo

129 nouveau_bo_del_ttm(struct ttm_buffer_object *bo)  in nouveau_bo_del_ttm()  argument
131 struct nouveau_drm *drm = nouveau_bdev(bo->bdev); in nouveau_bo_del_ttm()
133 struct nouveau_bo *nvbo = nouveau_bo(bo); in nouveau_bo_del_ttm()
136 DRM_ERROR("bo %p still attached to GEM object\n", bo); in nouveau_bo_del_ttm()
146 struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev); in nouveau_bo_fixup_align()
210 nvbo->bo.bdev = &drm->ttm.bdev; in nouveau_bo_new()
222 nvbo->bo.mem.num_pages = size >> PAGE_SHIFT; in nouveau_bo_new()
228 ret = ttm_bo_init(&drm->ttm.bdev, &nvbo->bo, size, in nouveau_bo_new()
257 struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev); in set_placement_range()
263 nvbo->bo.mem.num_pages < vram_pages / 4) { in set_placement_range()
310 struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev); in nouveau_bo_pin()
311 struct ttm_buffer_object *bo = &nvbo->bo; in nouveau_bo_pin() local
315 ret = ttm_bo_reserve(bo, false, false, false, NULL); in nouveau_bo_pin()
322 if (bo->mem.mem_type == TTM_PL_VRAM) { in nouveau_bo_pin()
323 struct nvkm_mem *mem = bo->mem.mm_node; in nouveau_bo_pin()
333 if (!(memtype & (1 << bo->mem.mem_type)) || evict) { in nouveau_bo_pin()
335 "0x%08x vs 0x%08x\n", bo, in nouveau_bo_pin()
336 1 << bo->mem.mem_type, memtype); in nouveau_bo_pin()
363 switch (bo->mem.mem_type) { in nouveau_bo_pin()
365 drm->gem.vram_available -= bo->mem.size; in nouveau_bo_pin()
368 drm->gem.gart_available -= bo->mem.size; in nouveau_bo_pin()
377 ttm_bo_unreserve(bo); in nouveau_bo_pin()
384 struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev); in nouveau_bo_unpin()
385 struct ttm_buffer_object *bo = &nvbo->bo; in nouveau_bo_unpin() local
388 ret = ttm_bo_reserve(bo, false, false, false, NULL); in nouveau_bo_unpin()
397 nouveau_bo_placement_set(nvbo, bo->mem.placement, 0); in nouveau_bo_unpin()
401 switch (bo->mem.mem_type) { in nouveau_bo_unpin()
403 drm->gem.vram_available += bo->mem.size; in nouveau_bo_unpin()
406 drm->gem.gart_available += bo->mem.size; in nouveau_bo_unpin()
414 ttm_bo_unreserve(bo); in nouveau_bo_unpin()
423 ret = ttm_bo_reserve(&nvbo->bo, false, false, false, NULL); in nouveau_bo_map()
432 ret = ttm_bo_kmap(&nvbo->bo, 0, nvbo->bo.mem.num_pages, in nouveau_bo_map()
435 ttm_bo_unreserve(&nvbo->bo); in nouveau_bo_map()
456 struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev); in nouveau_bo_sync_for_device()
458 struct ttm_dma_tt *ttm_dma = (struct ttm_dma_tt *)nvbo->bo.ttm; in nouveau_bo_sync_for_device()
476 struct nouveau_drm *drm = nouveau_bdev(nvbo->bo.bdev); in nouveau_bo_sync_for_cpu()
478 struct ttm_dma_tt *ttm_dma = (struct ttm_dma_tt *)nvbo->bo.ttm; in nouveau_bo_sync_for_cpu()
499 ret = ttm_bo_validate(&nvbo->bo, &nvbo->placement, in nouveau_bo_validate()
522 dma_tt = (struct ttm_dma_tt *)nvbo->bo.ttm; in _nouveau_bo_mem_index()
658 nouveau_bo_evict_flags(struct ttm_buffer_object *bo, struct ttm_placement *pl) in nouveau_bo_evict_flags() argument
660 struct nouveau_bo *nvbo = nouveau_bo(bo); in nouveau_bo_evict_flags()
662 switch (bo->mem.mem_type) { in nouveau_bo_evict_flags()
689 nve0_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo, in nve0_bo_move_copy() argument
721 nvc0_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo, in nvc0_bo_move_copy() argument
759 nvc0_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, in nvc0_bo_move_m2mf() argument
798 nva3_bo_move_copy(struct nouveau_channel *chan, struct ttm_buffer_object *bo, in nva3_bo_move_copy() argument
836 nv98_bo_move_exec(struct nouveau_channel *chan, struct ttm_buffer_object *bo, in nv98_bo_move_exec() argument
854 nv84_bo_move_exec(struct nouveau_channel *chan, struct ttm_buffer_object *bo, in nv84_bo_move_exec() argument
888 nv50_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, in nv50_bo_move_m2mf() argument
975 nouveau_bo_mem_ctxdma(struct ttm_buffer_object *bo, in nouveau_bo_mem_ctxdma() argument
984 nv04_bo_move_m2mf(struct nouveau_channel *chan, struct ttm_buffer_object *bo, in nv04_bo_move_m2mf() argument
997 OUT_RING (chan, nouveau_bo_mem_ctxdma(bo, chan, old_mem)); in nv04_bo_move_m2mf()
998 OUT_RING (chan, nouveau_bo_mem_ctxdma(bo, chan, new_mem)); in nv04_bo_move_m2mf()
1030 nouveau_bo_move_prep(struct nouveau_drm *drm, struct ttm_buffer_object *bo, in nouveau_bo_move_prep() argument
1033 struct nvkm_mem *old_node = bo->mem.mm_node; in nouveau_bo_move_prep()
1056 nouveau_bo_move_m2mf(struct ttm_buffer_object *bo, int evict, bool intr, in nouveau_bo_move_m2mf() argument
1059 struct nouveau_drm *drm = nouveau_bdev(bo->bdev); in nouveau_bo_move_m2mf()
1070 ret = nouveau_bo_move_prep(drm, bo, new_mem); in nouveau_bo_move_m2mf()
1076 ret = nouveau_fence_sync(nouveau_bo(bo), chan, true, intr); in nouveau_bo_move_m2mf()
1078 ret = drm->ttm.move(chan, bo, &bo->mem, new_mem); in nouveau_bo_move_m2mf()
1082 ret = ttm_bo_move_accel_cleanup(bo, in nouveau_bo_move_m2mf()
1156 nouveau_bo_move_flipd(struct ttm_buffer_object *bo, bool evict, bool intr, in nouveau_bo_move_flipd() argument
1173 ret = ttm_bo_mem_space(bo, &placement, &tmp_mem, intr, no_wait_gpu); in nouveau_bo_move_flipd()
1177 ret = ttm_tt_bind(bo->ttm, &tmp_mem); in nouveau_bo_move_flipd()
1181 ret = nouveau_bo_move_m2mf(bo, true, intr, no_wait_gpu, &tmp_mem); in nouveau_bo_move_flipd()
1185 ret = ttm_bo_move_ttm(bo, true, no_wait_gpu, new_mem); in nouveau_bo_move_flipd()
1187 ttm_bo_mem_put(bo, &tmp_mem); in nouveau_bo_move_flipd()
1192 nouveau_bo_move_flips(struct ttm_buffer_object *bo, bool evict, bool intr, in nouveau_bo_move_flips() argument
1209 ret = ttm_bo_mem_space(bo, &placement, &tmp_mem, intr, no_wait_gpu); in nouveau_bo_move_flips()
1213 ret = ttm_bo_move_ttm(bo, true, no_wait_gpu, &tmp_mem); in nouveau_bo_move_flips()
1217 ret = nouveau_bo_move_m2mf(bo, true, intr, no_wait_gpu, new_mem); in nouveau_bo_move_flips()
1222 ttm_bo_mem_put(bo, &tmp_mem); in nouveau_bo_move_flips()
1227 nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, struct ttm_mem_reg *new_mem) in nouveau_bo_move_ntfy() argument
1229 struct nouveau_bo *nvbo = nouveau_bo(bo); in nouveau_bo_move_ntfy()
1233 if (bo->destroy != nouveau_bo_del_ttm) in nouveau_bo_move_ntfy()
1248 nouveau_bo_vm_bind(struct ttm_buffer_object *bo, struct ttm_mem_reg *new_mem, in nouveau_bo_vm_bind() argument
1251 struct nouveau_drm *drm = nouveau_bdev(bo->bdev); in nouveau_bo_vm_bind()
1253 struct nouveau_bo *nvbo = nouveau_bo(bo); in nouveau_bo_vm_bind()
1270 nouveau_bo_vm_cleanup(struct ttm_buffer_object *bo, in nouveau_bo_vm_cleanup() argument
1274 struct nouveau_drm *drm = nouveau_bdev(bo->bdev); in nouveau_bo_vm_cleanup()
1276 struct fence *fence = reservation_object_get_excl(bo->resv); in nouveau_bo_vm_cleanup()
1283 nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, bool intr, in nouveau_bo_move() argument
1286 struct nouveau_drm *drm = nouveau_bdev(bo->bdev); in nouveau_bo_move()
1287 struct nouveau_bo *nvbo = nouveau_bo(bo); in nouveau_bo_move()
1288 struct ttm_mem_reg *old_mem = &bo->mem; in nouveau_bo_move()
1296 ret = nouveau_bo_vm_bind(bo, new_mem, &new_tile); in nouveau_bo_move()
1302 if (old_mem->mem_type == TTM_PL_SYSTEM && !bo->ttm) { in nouveau_bo_move()
1303 BUG_ON(bo->mem.mm_node != NULL); in nouveau_bo_move()
1304 bo->mem = *new_mem; in nouveau_bo_move()
1312 ret = nouveau_bo_move_flipd(bo, evict, intr, in nouveau_bo_move()
1315 ret = nouveau_bo_move_flips(bo, evict, intr, in nouveau_bo_move()
1318 ret = nouveau_bo_move_m2mf(bo, evict, intr, in nouveau_bo_move()
1325 ret = ttm_bo_wait(bo, true, intr, no_wait_gpu); in nouveau_bo_move()
1327 ret = ttm_bo_move_memcpy(bo, evict, no_wait_gpu, new_mem); in nouveau_bo_move()
1332 nouveau_bo_vm_cleanup(bo, NULL, &new_tile); in nouveau_bo_move()
1334 nouveau_bo_vm_cleanup(bo, new_tile, &nvbo->tile); in nouveau_bo_move()
1341 nouveau_bo_verify_access(struct ttm_buffer_object *bo, struct file *filp) in nouveau_bo_verify_access() argument
1343 struct nouveau_bo *nvbo = nouveau_bo(bo); in nouveau_bo_verify_access()
1418 nouveau_ttm_fault_reserve_notify(struct ttm_buffer_object *bo) in nouveau_ttm_fault_reserve_notify() argument
1420 struct nouveau_drm *drm = nouveau_bdev(bo->bdev); in nouveau_ttm_fault_reserve_notify()
1421 struct nouveau_bo *nvbo = nouveau_bo(bo); in nouveau_ttm_fault_reserve_notify()
1429 if (bo->mem.mem_type != TTM_PL_VRAM) { in nouveau_ttm_fault_reserve_notify()
1434 if (bo->mem.mem_type == TTM_PL_SYSTEM) { in nouveau_ttm_fault_reserve_notify()
1446 bo->mem.start + bo->mem.num_pages < mappable) in nouveau_ttm_fault_reserve_notify()
1593 struct reservation_object *resv = nvbo->bo.resv; in nouveau_bo_fence()
1632 const u32 size = nvbo->bo.mem.num_pages << PAGE_SHIFT; in nouveau_bo_vma_add()
1640 if ( nvbo->bo.mem.mem_type != TTM_PL_SYSTEM && in nouveau_bo_vma_add()
1641 (nvbo->bo.mem.mem_type == TTM_PL_VRAM || in nouveau_bo_vma_add()
1643 nvkm_vm_map(vma, nvbo->bo.mem.mm_node); in nouveau_bo_vma_add()
1654 if (nvbo->bo.mem.mem_type != TTM_PL_SYSTEM) in nouveau_bo_vma_del()