#include <linux/io.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/refcount.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <media/videobuf2-v4l2.h>
#include <media/videobuf2-vmalloc.h>
#include <media/videobuf2-memops.h>
struct vb2_vmalloc_buf { … };
static void vb2_vmalloc_put(void *buf_priv);
static void *vb2_vmalloc_alloc(struct vb2_buffer *vb, struct device *dev,
unsigned long size)
{ … }
static void vb2_vmalloc_put(void *buf_priv)
{ … }
static void *vb2_vmalloc_get_userptr(struct vb2_buffer *vb, struct device *dev,
unsigned long vaddr, unsigned long size)
{ … }
static void vb2_vmalloc_put_userptr(void *buf_priv)
{ … }
static void *vb2_vmalloc_vaddr(struct vb2_buffer *vb, void *buf_priv)
{ … }
static unsigned int vb2_vmalloc_num_users(void *buf_priv)
{ … }
static int vb2_vmalloc_mmap(void *buf_priv, struct vm_area_struct *vma)
{ … }
#ifdef CONFIG_HAS_DMA
struct vb2_vmalloc_attachment { … };
static int vb2_vmalloc_dmabuf_ops_attach(struct dma_buf *dbuf,
struct dma_buf_attachment *dbuf_attach)
{ … }
static void vb2_vmalloc_dmabuf_ops_detach(struct dma_buf *dbuf,
struct dma_buf_attachment *db_attach)
{ … }
static struct sg_table *vb2_vmalloc_dmabuf_ops_map(
struct dma_buf_attachment *db_attach, enum dma_data_direction dma_dir)
{ … }
static void vb2_vmalloc_dmabuf_ops_unmap(struct dma_buf_attachment *db_attach,
struct sg_table *sgt, enum dma_data_direction dma_dir)
{ … }
static void vb2_vmalloc_dmabuf_ops_release(struct dma_buf *dbuf)
{ … }
static int vb2_vmalloc_dmabuf_ops_vmap(struct dma_buf *dbuf,
struct iosys_map *map)
{ … }
static int vb2_vmalloc_dmabuf_ops_mmap(struct dma_buf *dbuf,
struct vm_area_struct *vma)
{ … }
static const struct dma_buf_ops vb2_vmalloc_dmabuf_ops = …;
static struct dma_buf *vb2_vmalloc_get_dmabuf(struct vb2_buffer *vb,
void *buf_priv,
unsigned long flags)
{ … }
#endif
static int vb2_vmalloc_map_dmabuf(void *mem_priv)
{ … }
static void vb2_vmalloc_unmap_dmabuf(void *mem_priv)
{ … }
static void vb2_vmalloc_detach_dmabuf(void *mem_priv)
{ … }
static void *vb2_vmalloc_attach_dmabuf(struct vb2_buffer *vb,
struct device *dev,
struct dma_buf *dbuf,
unsigned long size)
{ … }
const struct vb2_mem_ops vb2_vmalloc_memops = …;
EXPORT_SYMBOL_GPL(…);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_IMPORT_NS(…);