mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-20 03:04:01 +08:00
V4L/DVB: videobuf: rename videobuf_alloc to videobuf_alloc_vb
These functions allocate videobuf_buffer structures only. Renaming in order to prevent confusion with functions allocating actual video buffer memory. Rename the functions in videobuf-core.h videobuf-dma-sg.c as well. Signed-off-by: Pawel Osciak <p.osciak@samsung.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
c6cfe05532
commit
33c38283f0
@ -52,18 +52,18 @@ MODULE_LICENSE("GPL");
|
||||
#define CALL(q, f, arg...) \
|
||||
((q->int_ops->f) ? q->int_ops->f(arg) : 0)
|
||||
|
||||
struct videobuf_buffer *videobuf_alloc(struct videobuf_queue *q)
|
||||
struct videobuf_buffer *videobuf_alloc_vb(struct videobuf_queue *q)
|
||||
{
|
||||
struct videobuf_buffer *vb;
|
||||
|
||||
BUG_ON(q->msize < sizeof(*vb));
|
||||
|
||||
if (!q->int_ops || !q->int_ops->alloc) {
|
||||
if (!q->int_ops || !q->int_ops->alloc_vb) {
|
||||
printk(KERN_ERR "No specific ops defined!\n");
|
||||
BUG();
|
||||
}
|
||||
|
||||
vb = q->int_ops->alloc(q->msize);
|
||||
vb = q->int_ops->alloc_vb(q->msize);
|
||||
if (NULL != vb) {
|
||||
init_waitqueue_head(&vb->done);
|
||||
vb->magic = MAGIC_BUFFER;
|
||||
@ -71,7 +71,7 @@ struct videobuf_buffer *videobuf_alloc(struct videobuf_queue *q)
|
||||
|
||||
return vb;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(videobuf_alloc);
|
||||
EXPORT_SYMBOL_GPL(videobuf_alloc_vb);
|
||||
|
||||
#define WAITON_CONDITION (vb->state != VIDEOBUF_ACTIVE &&\
|
||||
vb->state != VIDEOBUF_QUEUED)
|
||||
@ -359,7 +359,7 @@ int __videobuf_mmap_setup(struct videobuf_queue *q,
|
||||
|
||||
/* Allocate and initialize buffers */
|
||||
for (i = 0; i < bcount; i++) {
|
||||
q->bufs[i] = videobuf_alloc(q);
|
||||
q->bufs[i] = videobuf_alloc_vb(q);
|
||||
|
||||
if (NULL == q->bufs[i])
|
||||
break;
|
||||
@ -766,7 +766,7 @@ static ssize_t videobuf_read_zerocopy(struct videobuf_queue *q,
|
||||
MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS);
|
||||
|
||||
/* setup stuff */
|
||||
q->read_buf = videobuf_alloc(q);
|
||||
q->read_buf = videobuf_alloc_vb(q);
|
||||
if (NULL == q->read_buf)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -871,7 +871,7 @@ ssize_t videobuf_read_one(struct videobuf_queue *q,
|
||||
if (NULL == q->read_buf) {
|
||||
/* need to capture a new frame */
|
||||
retval = -ENOMEM;
|
||||
q->read_buf = videobuf_alloc(q);
|
||||
q->read_buf = videobuf_alloc_vb(q);
|
||||
|
||||
dprintk(1, "video alloc=0x%p\n", q->read_buf);
|
||||
if (NULL == q->read_buf)
|
||||
|
@ -190,7 +190,7 @@ static int videobuf_dma_contig_user_get(struct videobuf_dma_contig_memory *mem,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct videobuf_buffer *__videobuf_alloc(size_t size)
|
||||
static struct videobuf_buffer *__videobuf_alloc_vb(size_t size)
|
||||
{
|
||||
struct videobuf_dma_contig_memory *mem;
|
||||
struct videobuf_buffer *vb;
|
||||
@ -338,7 +338,7 @@ error:
|
||||
static struct videobuf_qtype_ops qops = {
|
||||
.magic = MAGIC_QTYPE_OPS,
|
||||
|
||||
.alloc = __videobuf_alloc,
|
||||
.alloc_vb = __videobuf_alloc_vb,
|
||||
.iolock = __videobuf_iolock,
|
||||
.mmap_mapper = __videobuf_mmap_mapper,
|
||||
.vaddr = __videobuf_to_vaddr,
|
||||
|
@ -428,7 +428,7 @@ static const struct vm_operations_struct videobuf_vm_ops = {
|
||||
struct videobuf_dma_sg_memory
|
||||
*/
|
||||
|
||||
static struct videobuf_buffer *__videobuf_alloc(size_t size)
|
||||
static struct videobuf_buffer *__videobuf_alloc_vb(size_t size)
|
||||
{
|
||||
struct videobuf_dma_sg_memory *mem;
|
||||
struct videobuf_buffer *vb;
|
||||
@ -638,7 +638,7 @@ done:
|
||||
static struct videobuf_qtype_ops sg_ops = {
|
||||
.magic = MAGIC_QTYPE_OPS,
|
||||
|
||||
.alloc = __videobuf_alloc,
|
||||
.alloc_vb = __videobuf_alloc_vb,
|
||||
.iolock = __videobuf_iolock,
|
||||
.sync = __videobuf_sync,
|
||||
.mmap_mapper = __videobuf_mmap_mapper,
|
||||
@ -654,7 +654,7 @@ void *videobuf_sg_alloc(size_t size)
|
||||
|
||||
q.msize = size;
|
||||
|
||||
return videobuf_alloc(&q);
|
||||
return videobuf_alloc_vb(&q);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(videobuf_sg_alloc);
|
||||
|
||||
|
@ -135,7 +135,7 @@ static const struct vm_operations_struct videobuf_vm_ops = {
|
||||
struct videobuf_dma_sg_memory
|
||||
*/
|
||||
|
||||
static struct videobuf_buffer *__videobuf_alloc(size_t size)
|
||||
static struct videobuf_buffer *__videobuf_alloc_vb(size_t size)
|
||||
{
|
||||
struct videobuf_vmalloc_memory *mem;
|
||||
struct videobuf_buffer *vb;
|
||||
@ -293,7 +293,7 @@ error:
|
||||
static struct videobuf_qtype_ops qops = {
|
||||
.magic = MAGIC_QTYPE_OPS,
|
||||
|
||||
.alloc = __videobuf_alloc,
|
||||
.alloc_vb = __videobuf_alloc_vb,
|
||||
.iolock = __videobuf_iolock,
|
||||
.mmap_mapper = __videobuf_mmap_mapper,
|
||||
.vaddr = videobuf_to_vmalloc,
|
||||
|
@ -127,7 +127,7 @@ struct videobuf_queue_ops {
|
||||
struct videobuf_qtype_ops {
|
||||
u32 magic;
|
||||
|
||||
struct videobuf_buffer *(*alloc)(size_t size);
|
||||
struct videobuf_buffer *(*alloc_vb)(size_t size);
|
||||
void *(*vaddr) (struct videobuf_buffer *buf);
|
||||
int (*iolock) (struct videobuf_queue *q,
|
||||
struct videobuf_buffer *vb,
|
||||
@ -173,7 +173,7 @@ int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr);
|
||||
int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb,
|
||||
struct v4l2_framebuffer *fbuf);
|
||||
|
||||
struct videobuf_buffer *videobuf_alloc(struct videobuf_queue *q);
|
||||
struct videobuf_buffer *videobuf_alloc_vb(struct videobuf_queue *q);
|
||||
|
||||
/* Used on videobuf-dvb */
|
||||
void *videobuf_queue_to_vaddr(struct videobuf_queue *q,
|
||||
|
Loading…
Reference in New Issue
Block a user