Lines Matching refs:ttm
47 static int nouveau_ttm_tt_bind(struct ttm_device *bdev, struct ttm_tt *ttm,
49 static void nouveau_ttm_tt_unbind(struct ttm_device *bdev, struct ttm_tt *ttm);
221 nvbo->bo.bdev = &drm->ttm.bdev; in nouveau_bo_alloc()
555 struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm; in nouveau_bo_sync_for_device()
591 struct ttm_tt *ttm_dma = (struct ttm_tt *)nvbo->bo.ttm; in nouveau_bo_sync_for_cpu()
628 mutex_lock(&drm->ttm.io_reserve_mutex); in nouveau_bo_add_io_reserve_lru()
629 list_move_tail(&nvbo->io_reserve_lru, &drm->ttm.io_reserve_lru); in nouveau_bo_add_io_reserve_lru()
630 mutex_unlock(&drm->ttm.io_reserve_mutex); in nouveau_bo_add_io_reserve_lru()
638 mutex_lock(&drm->ttm.io_reserve_mutex); in nouveau_bo_del_io_reserve_lru()
640 mutex_unlock(&drm->ttm.io_reserve_mutex); in nouveau_bo_del_io_reserve_lru()
716 nouveau_ttm_tt_bind(struct ttm_device *bdev, struct ttm_tt *ttm, in nouveau_ttm_tt_bind() argument
726 return ttm_agp_bind(ttm, reg); in nouveau_ttm_tt_bind()
728 return nouveau_sgdma_bind(bdev, ttm, reg); in nouveau_ttm_tt_bind()
732 nouveau_ttm_tt_unbind(struct ttm_device *bdev, struct ttm_tt *ttm) in nouveau_ttm_tt_unbind() argument
738 ttm_agp_unbind(ttm); in nouveau_ttm_tt_unbind()
742 nouveau_sgdma_unbind(bdev, ttm); in nouveau_ttm_tt_unbind()
801 struct nouveau_channel *chan = drm->ttm.chan; in nouveau_bo_move_m2mf()
822 ret = drm->ttm.move(chan, bo, bo->resource, new_reg); in nouveau_bo_move_m2mf()
901 &drm->ttm.copy); in nouveau_bo_move_init()
903 ret = mthd->init(chan, drm->ttm.copy.handle); in nouveau_bo_move_init()
905 nvif_object_dtor(&drm->ttm.copy); in nouveau_bo_move_init()
909 drm->ttm.move = mthd->exec; in nouveau_bo_move_init()
910 drm->ttm.chan = chan; in nouveau_bo_move_init()
1008 ret = nouveau_ttm_tt_bind(bo->bdev, bo->ttm, new_reg); in nouveau_bo_move()
1029 !bo->ttm)) { in nouveau_bo_move()
1042 nouveau_ttm_tt_unbind(bo->bdev, bo->ttm); in nouveau_bo_move()
1049 if (drm->ttm.move) { in nouveau_bo_move()
1114 mutex_lock(&drm->ttm.io_reserve_mutex); in nouveau_ttm_io_mem_reserve()
1144 mmu->type[drm->ttm.type_vram].type & NVIF_MEM_UNCACHED) in nouveau_ttm_io_mem_reserve()
1197 nvbo = list_first_entry_or_null(&drm->ttm.io_reserve_lru, in nouveau_ttm_io_mem_reserve()
1209 mutex_unlock(&drm->ttm.io_reserve_mutex); in nouveau_ttm_io_mem_reserve()
1218 mutex_lock(&drm->ttm.io_reserve_mutex); in nouveau_ttm_io_mem_free()
1220 mutex_unlock(&drm->ttm.io_reserve_mutex); in nouveau_ttm_io_mem_free()
1275 struct ttm_tt *ttm, struct ttm_operation_ctx *ctx) in nouveau_ttm_tt_populate() argument
1277 struct ttm_tt *ttm_dma = (void *)ttm; in nouveau_ttm_tt_populate()
1279 bool slave = !!(ttm->page_flags & TTM_TT_FLAG_EXTERNAL); in nouveau_ttm_tt_populate()
1281 if (ttm_tt_is_populated(ttm)) in nouveau_ttm_tt_populate()
1284 if (slave && ttm->sg) { in nouveau_ttm_tt_populate()
1285 drm_prime_sg_to_dma_addr_array(ttm->sg, ttm_dma->dma_address, in nouveau_ttm_tt_populate()
1286 ttm->num_pages); in nouveau_ttm_tt_populate()
1292 return ttm_pool_alloc(&drm->ttm.bdev.pool, ttm, ctx); in nouveau_ttm_tt_populate()
1297 struct ttm_tt *ttm) in nouveau_ttm_tt_unpopulate() argument
1300 bool slave = !!(ttm->page_flags & TTM_TT_FLAG_EXTERNAL); in nouveau_ttm_tt_unpopulate()
1305 nouveau_ttm_tt_unbind(bdev, ttm); in nouveau_ttm_tt_unpopulate()
1309 return ttm_pool_free(&drm->ttm.bdev.pool, ttm); in nouveau_ttm_tt_unpopulate()
1314 struct ttm_tt *ttm) in nouveau_ttm_tt_destroy() argument
1319 ttm_agp_destroy(ttm); in nouveau_ttm_tt_destroy()
1323 nouveau_sgdma_destroy(bdev, ttm); in nouveau_ttm_tt_destroy()