#include <linux/dma-buf.h>
#include <linux/module.h>
#include <linux/refcount.h>
#include <linux/scatterlist.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/dma-mapping.h>
#include <linux/highmem.h>
#include <media/videobuf2-v4l2.h>
#include <media/videobuf2-dma-contig.h>
#include <media/videobuf2-memops.h>
struct vb2_dc_buf { … };
static unsigned long vb2_dc_get_contiguous_size(struct sg_table *sgt)
{ … }
static void *vb2_dc_cookie(struct vb2_buffer *vb, void *buf_priv)
{ … }
static void *vb2_dc_vaddr(struct vb2_buffer *vb, void *buf_priv)
{ … }
static unsigned int vb2_dc_num_users(void *buf_priv)
{ … }
static void vb2_dc_prepare(void *buf_priv)
{ … }
static void vb2_dc_finish(void *buf_priv)
{ … }
static void vb2_dc_put(void *buf_priv)
{ … }
static int vb2_dc_alloc_coherent(struct vb2_dc_buf *buf)
{ … }
static int vb2_dc_alloc_non_coherent(struct vb2_dc_buf *buf)
{ … }
static void *vb2_dc_alloc(struct vb2_buffer *vb,
struct device *dev,
unsigned long size)
{ … }
static int vb2_dc_mmap(void *buf_priv, struct vm_area_struct *vma)
{ … }
struct vb2_dc_attachment { … };
static int vb2_dc_dmabuf_ops_attach(struct dma_buf *dbuf,
struct dma_buf_attachment *dbuf_attach)
{ … }
static void vb2_dc_dmabuf_ops_detach(struct dma_buf *dbuf,
struct dma_buf_attachment *db_attach)
{ … }
static struct sg_table *vb2_dc_dmabuf_ops_map(
struct dma_buf_attachment *db_attach, enum dma_data_direction dma_dir)
{ … }
static void vb2_dc_dmabuf_ops_unmap(struct dma_buf_attachment *db_attach,
struct sg_table *sgt, enum dma_data_direction dma_dir)
{ … }
static void vb2_dc_dmabuf_ops_release(struct dma_buf *dbuf)
{ … }
static int
vb2_dc_dmabuf_ops_begin_cpu_access(struct dma_buf *dbuf,
enum dma_data_direction direction)
{ … }
static int
vb2_dc_dmabuf_ops_end_cpu_access(struct dma_buf *dbuf,
enum dma_data_direction direction)
{ … }
static int vb2_dc_dmabuf_ops_vmap(struct dma_buf *dbuf, struct iosys_map *map)
{ … }
static int vb2_dc_dmabuf_ops_mmap(struct dma_buf *dbuf,
struct vm_area_struct *vma)
{ … }
static const struct dma_buf_ops vb2_dc_dmabuf_ops = …;
static struct sg_table *vb2_dc_get_base_sgt(struct vb2_dc_buf *buf)
{ … }
static struct dma_buf *vb2_dc_get_dmabuf(struct vb2_buffer *vb,
void *buf_priv,
unsigned long flags)
{ … }
static void vb2_dc_put_userptr(void *buf_priv)
{ … }
static void *vb2_dc_get_userptr(struct vb2_buffer *vb, struct device *dev,
unsigned long vaddr, unsigned long size)
{ … }
static int vb2_dc_map_dmabuf(void *mem_priv)
{ … }
static void vb2_dc_unmap_dmabuf(void *mem_priv)
{ … }
static void vb2_dc_detach_dmabuf(void *mem_priv)
{ … }
static void *vb2_dc_attach_dmabuf(struct vb2_buffer *vb, struct device *dev,
struct dma_buf *dbuf, unsigned long size)
{ … }
const struct vb2_mem_ops vb2_dma_contig_memops = …;
EXPORT_SYMBOL_GPL(…);
int vb2_dma_contig_set_max_seg_size(struct device *dev, unsigned int size)
{ … }
EXPORT_SYMBOL_GPL(…);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_IMPORT_NS(…);