Lines Matching refs:nr_pages

63 						  int nr_pages)  in videobuf_vmalloc_to_sg()  argument
69 sglist = vzalloc(array_size(nr_pages, sizeof(*sglist))); in videobuf_vmalloc_to_sg()
72 sg_init_table(sglist, nr_pages); in videobuf_vmalloc_to_sg()
73 for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) { in videobuf_vmalloc_to_sg()
93 int nr_pages, int offset, size_t size) in videobuf_pages_to_sg() argument
100 sglist = vmalloc(array_size(nr_pages, sizeof(*sglist))); in videobuf_pages_to_sg()
103 sg_init_table(sglist, nr_pages); in videobuf_pages_to_sg()
111 for (i = 1; i < nr_pages; i++) { in videobuf_pages_to_sg()
174 dma->nr_pages = last-first+1; in videobuf_dma_init_user_locked()
175 dma->pages = kmalloc_array(dma->nr_pages, sizeof(struct page *), in videobuf_dma_init_user_locked()
184 data, size, dma->nr_pages); in videobuf_dma_init_user_locked()
186 err = pin_user_pages(data & PAGE_MASK, dma->nr_pages, in videobuf_dma_init_user_locked()
189 if (err != dma->nr_pages) { in videobuf_dma_init_user_locked()
190 dma->nr_pages = (err >= 0) ? err : 0; in videobuf_dma_init_user_locked()
192 dma->nr_pages); in videobuf_dma_init_user_locked()
211 unsigned long nr_pages) in videobuf_dma_init_kernel() argument
215 dprintk(1, "init kernel [%lu pages]\n", nr_pages); in videobuf_dma_init_kernel()
218 dma->vaddr_pages = kcalloc(nr_pages, sizeof(*dma->vaddr_pages), in videobuf_dma_init_kernel()
223 dma->dma_addr = kcalloc(nr_pages, sizeof(*dma->dma_addr), GFP_KERNEL); in videobuf_dma_init_kernel()
228 for (i = 0; i < nr_pages; i++) { in videobuf_dma_init_kernel()
238 dma->vaddr = vmap(dma->vaddr_pages, nr_pages, VM_MAP | VM_IOREMAP, in videobuf_dma_init_kernel()
241 dprintk(1, "vmalloc_32(%lu pages) failed\n", nr_pages); in videobuf_dma_init_kernel()
246 dma->vaddr, nr_pages << PAGE_SHIFT); in videobuf_dma_init_kernel()
248 memset(dma->vaddr, 0, nr_pages << PAGE_SHIFT); in videobuf_dma_init_kernel()
249 dma->nr_pages = nr_pages; in videobuf_dma_init_kernel()
270 dma_addr_t addr, unsigned long nr_pages) in videobuf_dma_init_overlay() argument
273 nr_pages, (unsigned long)addr); in videobuf_dma_init_overlay()
280 dma->nr_pages = nr_pages; in videobuf_dma_init_overlay()
288 BUG_ON(0 == dma->nr_pages); in videobuf_dma_map()
291 dma->sglist = videobuf_pages_to_sg(dma->pages, dma->nr_pages, in videobuf_dma_map()
296 dma->nr_pages); in videobuf_dma_map()
305 sg_dma_len(&dma->sglist[0]) = dma->nr_pages * PAGE_SIZE; in videobuf_dma_map()
314 dma->nr_pages, dma->direction); in videobuf_dma_map()
335 dma_unmap_sg(dev, dma->sglist, dma->nr_pages, dma->direction); in videobuf_dma_unmap()
352 unpin_user_pages_dirty_lock(dma->pages, dma->nr_pages, in videobuf_dma_free()
359 for (i = 0; i < dma->nr_pages; i++) { in videobuf_dma_free()
583 mem->dma.nr_pages, mem->dma.direction); in __videobuf_sync()