Lines Matching refs:ttm

46 static int nouveau_ttm_tt_bind(struct ttm_device *bdev, struct ttm_tt *ttm,
48 static void nouveau_ttm_tt_unbind(struct ttm_device *bdev, struct ttm_tt *ttm);
220 nvbo->bo.bdev = &drm->ttm.bdev; in nouveau_bo_alloc()
552 struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm; in nouveau_bo_sync_for_device()
588 struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm; in nouveau_bo_sync_for_cpu()
625 mutex_lock(&drm->ttm.io_reserve_mutex); in nouveau_bo_add_io_reserve_lru()
626 list_move_tail(&nvbo->io_reserve_lru, &drm->ttm.io_reserve_lru); in nouveau_bo_add_io_reserve_lru()
627 mutex_unlock(&drm->ttm.io_reserve_mutex); in nouveau_bo_add_io_reserve_lru()
635 mutex_lock(&drm->ttm.io_reserve_mutex); in nouveau_bo_del_io_reserve_lru()
637 mutex_unlock(&drm->ttm.io_reserve_mutex); in nouveau_bo_del_io_reserve_lru()
713 nouveau_ttm_tt_bind(struct ttm_device *bdev, struct ttm_tt *ttm, in nouveau_ttm_tt_bind() argument
723 return ttm_agp_bind(ttm, reg); in nouveau_ttm_tt_bind()
725 return nouveau_sgdma_bind(bdev, ttm, reg); in nouveau_ttm_tt_bind()
729 nouveau_ttm_tt_unbind(struct ttm_device *bdev, struct ttm_tt *ttm) in nouveau_ttm_tt_unbind() argument
735 ttm_agp_unbind(ttm); in nouveau_ttm_tt_unbind()
739 nouveau_sgdma_unbind(bdev, ttm); in nouveau_ttm_tt_unbind()
798 struct nouveau_channel *chan = drm->ttm.chan; in nouveau_bo_move_m2mf()
819 ret = drm->ttm.move(chan, bo, bo->resource, new_reg); in nouveau_bo_move_m2mf()
886 &drm->ttm.copy); in nouveau_bo_move_init()
888 ret = mthd->init(chan, drm->ttm.copy.handle); in nouveau_bo_move_init()
890 nvif_object_dtor(&drm->ttm.copy); in nouveau_bo_move_init()
894 drm->ttm.move = mthd->exec; in nouveau_bo_move_init()
895 drm->ttm.chan = chan; in nouveau_bo_move_init()
982 ret = nouveau_ttm_tt_bind(bo->bdev, bo->ttm, new_reg); in nouveau_bo_move()
1002 if (old_reg->mem_type == TTM_PL_SYSTEM && !bo->ttm) { in nouveau_bo_move()
1015 nouveau_ttm_tt_unbind(bo->bdev, bo->ttm); in nouveau_bo_move()
1022 if (drm->ttm.move) { in nouveau_bo_move()
1087 mutex_lock(&drm->ttm.io_reserve_mutex); in nouveau_ttm_io_mem_reserve()
1117 mmu->type[drm->ttm.type_vram].type & NVIF_MEM_UNCACHED) in nouveau_ttm_io_mem_reserve()
1170 nvbo = list_first_entry_or_null(&drm->ttm.io_reserve_lru, in nouveau_ttm_io_mem_reserve()
1182 mutex_unlock(&drm->ttm.io_reserve_mutex); in nouveau_ttm_io_mem_reserve()
1191 mutex_lock(&drm->ttm.io_reserve_mutex); in nouveau_ttm_io_mem_free()
1193 mutex_unlock(&drm->ttm.io_reserve_mutex); in nouveau_ttm_io_mem_free()
1248 struct ttm_tt *ttm, struct ttm_operation_ctx *ctx) in nouveau_ttm_tt_populate() argument
1250 struct ttm_tt *ttm_dma = (void *)ttm; in nouveau_ttm_tt_populate()
1252 bool slave = !!(ttm->page_flags & TTM_TT_FLAG_EXTERNAL); in nouveau_ttm_tt_populate()
1254 if (ttm_tt_is_populated(ttm)) in nouveau_ttm_tt_populate()
1257 if (slave && ttm->sg) { in nouveau_ttm_tt_populate()
1258 drm_prime_sg_to_dma_addr_array(ttm->sg, ttm_dma->dma_address, in nouveau_ttm_tt_populate()
1259 ttm->num_pages); in nouveau_ttm_tt_populate()
1265 return ttm_pool_alloc(&drm->ttm.bdev.pool, ttm, ctx); in nouveau_ttm_tt_populate()
1270 struct ttm_tt *ttm) in nouveau_ttm_tt_unpopulate() argument
1273 bool slave = !!(ttm->page_flags & TTM_TT_FLAG_EXTERNAL); in nouveau_ttm_tt_unpopulate()
1278 nouveau_ttm_tt_unbind(bdev, ttm); in nouveau_ttm_tt_unpopulate()
1282 return ttm_pool_free(&drm->ttm.bdev.pool, ttm); in nouveau_ttm_tt_unpopulate()
1287 struct ttm_tt *ttm) in nouveau_ttm_tt_destroy() argument
1292 ttm_agp_destroy(ttm); in nouveau_ttm_tt_destroy()
1296 nouveau_sgdma_destroy(bdev, ttm); in nouveau_ttm_tt_destroy()