Lines Matching refs:mem
139 struct videobuf_dma_sg_memory *mem = buf->priv; in videobuf_to_dma() local
140 BUG_ON(!mem); in videobuf_to_dma()
142 MAGIC_CHECK(mem->magic, MAGIC_SG_MEM); in videobuf_to_dma()
144 return &mem->dma; in videobuf_to_dma()
398 struct videobuf_dma_sg_memory *mem; in videobuf_vm_close() local
411 mem = q->bufs[i]->priv; in videobuf_vm_close()
412 if (!mem) in videobuf_vm_close()
415 MAGIC_CHECK(mem->magic, MAGIC_SG_MEM); in videobuf_vm_close()
470 struct videobuf_dma_sg_memory *mem; in __videobuf_alloc_vb() local
473 vb = kzalloc(size + sizeof(*mem), GFP_KERNEL); in __videobuf_alloc_vb()
477 mem = vb->priv = ((char *)vb) + size; in __videobuf_alloc_vb()
478 mem->magic = MAGIC_SG_MEM; in __videobuf_alloc_vb()
480 videobuf_dma_init(&mem->dma); in __videobuf_alloc_vb()
484 mem, (long)sizeof(*mem)); in __videobuf_alloc_vb()
491 struct videobuf_dma_sg_memory *mem = buf->priv; in __videobuf_to_vaddr() local
492 BUG_ON(!mem); in __videobuf_to_vaddr()
494 MAGIC_CHECK(mem->magic, MAGIC_SG_MEM); in __videobuf_to_vaddr()
496 return mem->dma.vaddr; in __videobuf_to_vaddr()
505 struct videobuf_dma_sg_memory *mem = vb->priv; in __videobuf_iolock() local
506 BUG_ON(!mem); in __videobuf_iolock()
508 MAGIC_CHECK(mem->magic, MAGIC_SG_MEM); in __videobuf_iolock()
510 if (!mem->dma.dev) in __videobuf_iolock()
511 mem->dma.dev = q->dev; in __videobuf_iolock()
513 WARN_ON(mem->dma.dev != q->dev); in __videobuf_iolock()
521 err = videobuf_dma_init_kernel(&mem->dma, in __videobuf_iolock()
528 err = videobuf_dma_init_user(&mem->dma, in __videobuf_iolock()
539 err = videobuf_dma_init_user_locked(&mem->dma, in __videobuf_iolock()
557 err = videobuf_dma_init_overlay(&mem->dma, DMA_FROM_DEVICE, in __videobuf_iolock()
565 err = videobuf_dma_map(q->dev, &mem->dma); in __videobuf_iolock()
575 struct videobuf_dma_sg_memory *mem = buf->priv; in __videobuf_sync() local
576 BUG_ON(!mem || !mem->dma.sglen); in __videobuf_sync()
578 MAGIC_CHECK(mem->magic, MAGIC_SG_MEM); in __videobuf_sync()
579 MAGIC_CHECK(mem->dma.magic, MAGIC_DMABUF); in __videobuf_sync()
581 dma_sync_sg_for_cpu(q->dev, mem->dma.sglist, in __videobuf_sync()
582 mem->dma.sglen, mem->dma.direction); in __videobuf_sync()
591 struct videobuf_dma_sg_memory *mem = buf->priv; in __videobuf_mmap_mapper() local
598 BUG_ON(!mem); in __videobuf_mmap_mapper()
599 MAGIC_CHECK(mem->magic, MAGIC_SG_MEM); in __videobuf_mmap_mapper()