Lines Matching refs:tt

382 int ttm_pool_alloc(struct ttm_pool *pool, struct ttm_tt *tt,  in ttm_pool_alloc()  argument
385 unsigned long num_pages = tt->num_pages; in ttm_pool_alloc()
386 dma_addr_t *dma_addr = tt->dma_address; in ttm_pool_alloc()
387 struct page **caching = tt->pages; in ttm_pool_alloc()
388 struct page **pages = tt->pages; in ttm_pool_alloc()
394 WARN_ON(!num_pages || ttm_tt_is_populated(tt)); in ttm_pool_alloc()
397 if (tt->page_flags & TTM_TT_FLAG_ZERO_ALLOC) in ttm_pool_alloc()
413 pt = ttm_pool_select_type(pool, tt->caching, order); in ttm_pool_alloc()
417 tt->caching); in ttm_pool_alloc()
442 tt->caching); in ttm_pool_alloc()
464 r = ttm_pool_apply_caching(caching, pages, tt->caching); in ttm_pool_alloc()
471 ttm_pool_free_page(pool, tt->caching, order, p); in ttm_pool_alloc()
474 num_pages = tt->num_pages - num_pages; in ttm_pool_alloc()
476 order = ttm_pool_page_order(pool, tt->pages[i]); in ttm_pool_alloc()
477 ttm_pool_free_page(pool, tt->caching, order, tt->pages[i]); in ttm_pool_alloc()
493 void ttm_pool_free(struct ttm_pool *pool, struct ttm_tt *tt) in ttm_pool_free() argument
497 for (i = 0; i < tt->num_pages; ) { in ttm_pool_free()
498 struct page *p = tt->pages[i]; in ttm_pool_free()
504 if (tt->dma_address) in ttm_pool_free()
505 ttm_pool_unmap(pool, tt->dma_address[i], num_pages); in ttm_pool_free()
507 pt = ttm_pool_select_type(pool, tt->caching, order); in ttm_pool_free()
509 ttm_pool_type_give(pt, tt->pages[i]); in ttm_pool_free()
511 ttm_pool_free_page(pool, tt->caching, order, in ttm_pool_free()
512 tt->pages[i]); in ttm_pool_free()