Lines Matching refs:p
84 struct page *p; in ttm_pool_alloc_page() local
96 p = alloc_pages_node(pool->nid, gfp_flags, order); in ttm_pool_alloc_page()
97 if (p) in ttm_pool_alloc_page()
98 p->private = order; in ttm_pool_alloc_page()
99 return p; in ttm_pool_alloc_page()
118 p = vmalloc_to_page(vaddr); in ttm_pool_alloc_page()
120 p = virt_to_page(vaddr); in ttm_pool_alloc_page()
123 p->private = (unsigned long)dma; in ttm_pool_alloc_page()
124 return p; in ttm_pool_alloc_page()
133 unsigned int order, struct page *p) in ttm_pool_free_page() argument
143 if (caching != ttm_cached && !PageHighMem(p)) in ttm_pool_free_page()
144 set_pages_wb(p, 1 << order); in ttm_pool_free_page()
148 __free_pages(p, order); in ttm_pool_free_page()
155 dma = (void *)p->private; in ttm_pool_free_page()
186 struct page *p, dma_addr_t **dma_addr) in ttm_pool_map() argument
192 struct ttm_pool_dma *dma = (void *)p->private; in ttm_pool_map()
198 addr = dma_map_page(pool->dev, p, 0, size, DMA_BIDIRECTIONAL); in ttm_pool_map()
224 static void ttm_pool_type_give(struct ttm_pool_type *pt, struct page *p) in ttm_pool_type_give() argument
229 if (PageHighMem(p)) in ttm_pool_type_give()
230 clear_highpage(p + i); in ttm_pool_type_give()
232 clear_page(page_address(p + i)); in ttm_pool_type_give()
236 list_add(&p->lru, &pt->pages); in ttm_pool_type_give()
244 struct page *p; in ttm_pool_type_take() local
247 p = list_first_entry_or_null(&pt->pages, typeof(*p), lru); in ttm_pool_type_take()
248 if (p) { in ttm_pool_type_take()
250 list_del(&p->lru); in ttm_pool_type_take()
254 return p; in ttm_pool_type_take()
275 struct page *p; in ttm_pool_type_fini() local
281 while ((p = ttm_pool_type_take(pt))) in ttm_pool_type_fini()
282 ttm_pool_free_page(pt->pool, pt->caching, pt->order, p); in ttm_pool_type_fini()
324 struct page *p; in ttm_pool_shrink() local
331 p = ttm_pool_type_take(pt); in ttm_pool_shrink()
332 if (p) { in ttm_pool_shrink()
333 ttm_pool_free_page(pt->pool, pt->caching, pt->order, p); in ttm_pool_shrink()
343 static unsigned int ttm_pool_page_order(struct ttm_pool *pool, struct page *p) in ttm_pool_page_order() argument
346 struct ttm_pool_dma *dma = (void *)p->private; in ttm_pool_page_order()
351 return p->private; in ttm_pool_page_order()
356 struct page *p, dma_addr_t **dma_addr, in ttm_pool_page_allocated() argument
364 r = ttm_pool_map(pool, order, p, dma_addr); in ttm_pool_page_allocated()
370 for (i = 1 << order; i; --i, ++(*pages), ++p) in ttm_pool_page_allocated()
371 **pages = p; in ttm_pool_page_allocated()
436 struct page *p; in ttm_pool_alloc() local
460 p = pt ? ttm_pool_type_take(pt) : NULL; in ttm_pool_alloc()
461 if (p) { in ttm_pool_alloc()
469 r = ttm_pool_page_allocated(pool, order, p, in ttm_pool_alloc()
480 p = ttm_pool_type_take(pt); in ttm_pool_alloc()
481 } while (p); in ttm_pool_alloc()
486 (p = ttm_pool_alloc_page(pool, gfp_flags, order))) { in ttm_pool_alloc()
488 if (PageHighMem(p)) { in ttm_pool_alloc()
495 r = ttm_pool_page_allocated(pool, order, p, &dma_addr, in ttm_pool_alloc()
499 if (PageHighMem(p)) in ttm_pool_alloc()
503 if (!p) { in ttm_pool_alloc()
520 ttm_pool_free_page(pool, page_caching, order, p); in ttm_pool_alloc()
645 struct page *p; in ttm_pool_type_count() local
649 list_for_each_entry(p, &pt->pages, lru) in ttm_pool_type_count()