Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * helper functions for vmalloc capture buffers
0004  *
0005  * The functions expect the hardware being able to scatter gather
0006  * (i.e. the buffers are not linear in physical memory, but fragmented
0007  * into PAGE_SIZE chunks).  They also assume the driver does not need
0008  * to touch the video data.
0009  *
0010  * (c) 2007 Mauro Carvalho Chehab, <mchehab@kernel.org>
0011  */
0012 #ifndef _VIDEOBUF_VMALLOC_H
0013 #define _VIDEOBUF_VMALLOC_H
0014 
0015 #include <media/videobuf-core.h>
0016 
0017 /* --------------------------------------------------------------------- */
0018 
0019 struct videobuf_vmalloc_memory {
0020     u32                 magic;
0021 
0022     void                *vaddr;
0023 
0024     /* remap_vmalloc_range seems to need to run
0025      * after mmap() on some cases */
0026     struct vm_area_struct *vma;
0027 };
0028 
0029 void videobuf_queue_vmalloc_init(struct videobuf_queue *q,
0030              const struct videobuf_queue_ops *ops,
0031              struct device *dev,
0032              spinlock_t *irqlock,
0033              enum v4l2_buf_type type,
0034              enum v4l2_field field,
0035              unsigned int msize,
0036              void *priv,
0037              struct mutex *ext_lock);
0038 
0039 void *videobuf_to_vmalloc(struct videobuf_buffer *buf);
0040 
0041 void videobuf_vmalloc_free(struct videobuf_buffer *buf);
0042 
0043 #endif