Skip to content

Commit

Permalink
media: videobuf2: core: Rename min_buffers_needed field in vb2_queue
Browse files Browse the repository at this point in the history
Rename min_buffers_needed into min_queued_buffers and update
the documentation about it.

Signed-off-by: Benjamin Gaignard <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
[hverkuil: Drop the change where min_queued_buffers + 1 buffers would be]
[hverkuil: allocated. Now this patch only renames this field instead of making]
[hverkuil: a functional change as well.]
[hverkuil: Renamed 3 remaining min_buffers_needed occurrences.]
  • Loading branch information
Benjamin Gaignard authored and Hans Verkuil committed Dec 13, 2023
1 parent a3e28ea commit 80c2b40
Show file tree
Hide file tree
Showing 68 changed files with 103 additions and 100 deletions.
2 changes: 1 addition & 1 deletion drivers/input/touchscreen/atmel_mxt_ts.c
Original file line number Diff line number Diff line change
Expand Up @@ -2546,7 +2546,7 @@ static const struct vb2_queue mxt_queue = {
.ops = &mxt_queue_ops,
.mem_ops = &vb2_vmalloc_memops,
.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC,
.min_buffers_needed = 1,
.min_queued_buffers = 1,
};

static int mxt_vidioc_querycap(struct file *file, void *priv,
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/touchscreen/sur40.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ static const struct vb2_queue sur40_queue = {
.ops = &sur40_queue_ops,
.mem_ops = &vb2_dma_sg_memops,
.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC,
.min_buffers_needed = 3,
.min_queued_buffers = 3,
};

static const struct v4l2_file_operations sur40_video_fops = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/common/saa7146/saa7146_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ int saa7146_register_device(struct video_device *vfd, struct saa7146_dev *dev,
q->gfp_flags = __GFP_DMA32;
q->buf_struct_size = sizeof(struct saa7146_buf);
q->lock = &dev->v4l2_lock;
q->min_buffers_needed = 2;
q->min_queued_buffers = 2;
q->dev = &dev->pci->dev;
err = vb2_queue_init(q);
if (err)
Expand Down
28 changes: 14 additions & 14 deletions drivers/media/common/videobuf2/videobuf2-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
/*
* Make sure the requested values and current defaults are sane.
*/
num_buffers = max_t(unsigned int, *count, q->min_buffers_needed);
num_buffers = max_t(unsigned int, *count, q->min_queued_buffers);
num_buffers = min_t(unsigned int, num_buffers, q->max_num_buffers);
memset(q->alloc_devs, 0, sizeof(q->alloc_devs));
/*
Expand Down Expand Up @@ -917,7 +917,7 @@ int vb2_core_reqbufs(struct vb2_queue *q, enum vb2_memory memory,
* There is no point in continuing if we can't allocate the minimum
* number of buffers needed by this vb2_queue.
*/
if (allocated_buffers < q->min_buffers_needed)
if (allocated_buffers < q->min_queued_buffers)
ret = -ENOMEM;

/*
Expand Down Expand Up @@ -1653,7 +1653,7 @@ EXPORT_SYMBOL_GPL(vb2_core_prepare_buf);
* @q: videobuf2 queue
*
* Attempt to start streaming. When this function is called there must be
* at least q->min_buffers_needed buffers queued up (i.e. the minimum
* at least q->min_queued_buffers queued up (i.e. the minimum
* number of buffers required for the DMA engine to function). If the
* @start_streaming op fails it is supposed to return all the driver-owned
* buffers back to vb2 in state QUEUED. Check if that happened and if
Expand Down Expand Up @@ -1846,7 +1846,7 @@ int vb2_core_qbuf(struct vb2_queue *q, struct vb2_buffer *vb, void *pb,
* then we can finally call start_streaming().
*/
if (q->streaming && !q->start_streaming_called &&
q->queued_count >= q->min_buffers_needed) {
q->queued_count >= q->min_queued_buffers) {
ret = vb2_start_streaming(q);
if (ret) {
/*
Expand Down Expand Up @@ -2210,9 +2210,9 @@ int vb2_core_streamon(struct vb2_queue *q, unsigned int type)
return -EINVAL;
}

if (q_num_bufs < q->min_buffers_needed) {
dprintk(q, 1, "need at least %u allocated buffers\n",
q->min_buffers_needed);
if (q_num_bufs < q->min_queued_buffers) {
dprintk(q, 1, "need at least %u queued buffers\n",
q->min_queued_buffers);
return -EINVAL;
}

Expand All @@ -2224,7 +2224,7 @@ int vb2_core_streamon(struct vb2_queue *q, unsigned int type)
* Tell driver to start streaming provided sufficient buffers
* are available.
*/
if (q->queued_count >= q->min_buffers_needed) {
if (q->queued_count >= q->min_queued_buffers) {
ret = vb2_start_streaming(q);
if (ret)
goto unprepare;
Expand Down Expand Up @@ -2504,21 +2504,21 @@ int vb2_core_queue_init(struct vb2_queue *q)
return -EINVAL;

if (WARN_ON(q->max_num_buffers > MAX_BUFFER_INDEX) ||
WARN_ON(q->min_buffers_needed > q->max_num_buffers))
WARN_ON(q->min_queued_buffers > q->max_num_buffers))
return -EINVAL;

if (WARN_ON(q->requires_requests && !q->supports_requests))
return -EINVAL;

/*
* This combination is not allowed since a non-zero value of
* q->min_buffers_needed can cause vb2_core_qbuf() to fail if
* q->min_queued_buffers can cause vb2_core_qbuf() to fail if
* it has to call start_streaming(), and the Request API expects
* that queueing a request (and thus queueing a buffer contained
* in that request) will always succeed. There is no method of
* propagating an error back to userspace.
*/
if (WARN_ON(q->supports_requests && q->min_buffers_needed))
if (WARN_ON(q->supports_requests && q->min_queued_buffers))
return -EINVAL;

INIT_LIST_HEAD(&q->queued_list);
Expand Down Expand Up @@ -2735,14 +2735,14 @@ static int __vb2_init_fileio(struct vb2_queue *q, int read)
return -EBUSY;

/*
* Start with q->min_buffers_needed + 1, driver can increase it in
* Start with q->min_queued_buffers + 1, driver can increase it in
* queue_setup()
*
* 'min_buffers_needed' buffers need to be queued up before you
* 'min_queued_buffers' buffers need to be queued up before you
* can start streaming, plus 1 for userspace (or in this case,
* kernelspace) processing.
*/
count = max(2, q->min_buffers_needed + 1);
count = max(2, q->min_queued_buffers + 1);

dprintk(q, 3, "setting up file io: mode %s, count %d, read_once %d, write_immediately %d\n",
(read) ? "read" : "write", count, q->fileio_read_once,
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb-core/dvb_vb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ int dvb_vb2_init(struct dvb_vb2_ctx *ctx, const char *name, int nonblocking)
q->io_modes = VB2_MMAP;
q->drv_priv = ctx;
q->buf_struct_size = sizeof(struct dvb_buffer);
q->min_buffers_needed = 1;
q->min_queued_buffers = 1;
q->ops = &dvb_vb2_qops;
q->mem_ops = &vb2_vmalloc_memops;
q->buf_ops = &dvb_vb2_buf_ops;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/i2c/video-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ static int video_i2c_probe(struct i2c_client *client)
queue->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
queue->drv_priv = data;
queue->buf_struct_size = sizeof(struct video_i2c_buffer);
queue->min_buffers_needed = 1;
queue->min_queued_buffers = 1;
queue->ops = &video_i2c_video_qops;
queue->mem_ops = &vb2_vmalloc_memops;

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/bt8xx/bttv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3113,7 +3113,7 @@ static int vdev_init(struct bttv *btv, struct video_device *vfd,
q->gfp_flags = __GFP_DMA32;
q->buf_struct_size = sizeof(struct bttv_buffer);
q->lock = &btv->lock;
q->min_buffers_needed = 2;
q->min_queued_buffers = 2;
q->dev = &btv->c.pci->dev;
err = vb2_queue_init(q);
if (err)
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cobalt/cobalt-v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ static int cobalt_node_register(struct cobalt *cobalt, int node)
q->ops = &cobalt_qops;
q->mem_ops = &vb2_dma_sg_memops;
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
q->min_buffers_needed = 2;
q->min_queued_buffers = 2;
q->lock = &s->lock;
q->dev = &cobalt->pci_dev->dev;
vdev->queue = q;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx18/cx18-streams.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ static int cx18_stream_init(struct cx18 *cx, int type)
s->vidq.ops = &cx18_vb2_qops;
s->vidq.mem_ops = &vb2_vmalloc_memops;
s->vidq.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
s->vidq.min_buffers_needed = 2;
s->vidq.min_queued_buffers = 2;
s->vidq.gfp_flags = GFP_DMA32;
s->vidq.dev = &cx->pci_dev->dev;
s->vidq.lock = &cx->serialize_lock;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx23885/cx23885-417.c
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,7 @@ int cx23885_417_register(struct cx23885_dev *dev)
q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ;
q->gfp_flags = GFP_DMA32;
q->min_buffers_needed = 2;
q->min_queued_buffers = 2;
q->drv_priv = dev;
q->buf_struct_size = sizeof(struct cx23885_buffer);
q->ops = &cx23885_qops;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx23885/cx23885-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2667,7 +2667,7 @@ int cx23885_dvb_register(struct cx23885_tsport *port)
q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ;
q->gfp_flags = GFP_DMA32;
q->min_buffers_needed = 2;
q->min_queued_buffers = 2;
q->drv_priv = port;
q->buf_struct_size = sizeof(struct cx23885_buffer);
q->ops = &dvb_qops;
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/cx23885/cx23885-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ int cx23885_video_register(struct cx23885_dev *dev)
q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ;
q->gfp_flags = GFP_DMA32;
q->min_buffers_needed = 2;
q->min_queued_buffers = 2;
q->drv_priv = dev;
q->buf_struct_size = sizeof(struct cx23885_buffer);
q->ops = &cx23885_video_qops;
Expand All @@ -1338,7 +1338,7 @@ int cx23885_video_register(struct cx23885_dev *dev)
q->type = V4L2_BUF_TYPE_VBI_CAPTURE;
q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ;
q->gfp_flags = GFP_DMA32;
q->min_buffers_needed = 2;
q->min_queued_buffers = 2;
q->drv_priv = dev;
q->buf_struct_size = sizeof(struct cx23885_buffer);
q->ops = &cx23885_vbi_qops;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx25821/cx25821-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ int cx25821_video_register(struct cx25821_dev *dev)
q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF;
q->io_modes |= is_output ? VB2_WRITE : VB2_READ;
q->gfp_flags = GFP_DMA32;
q->min_buffers_needed = 2;
q->min_queued_buffers = 2;
q->drv_priv = chan;
q->buf_struct_size = sizeof(struct cx25821_buffer);
q->ops = &cx25821_video_qops;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx88/cx88-blackbird.c
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ static int cx8802_blackbird_probe(struct cx8802_driver *drv)
q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ;
q->gfp_flags = GFP_DMA32;
q->min_buffers_needed = 2;
q->min_queued_buffers = 2;
q->drv_priv = dev;
q->buf_struct_size = sizeof(struct cx88_buffer);
q->ops = &blackbird_qops;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx88/cx88-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1776,7 +1776,7 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv)
q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ;
q->gfp_flags = GFP_DMA32;
q->min_buffers_needed = 2;
q->min_queued_buffers = 2;
q->drv_priv = dev;
q->buf_struct_size = sizeof(struct cx88_buffer);
q->ops = &dvb_qops;
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/cx88/cx88-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ;
q->gfp_flags = GFP_DMA32;
q->min_buffers_needed = 2;
q->min_queued_buffers = 2;
q->drv_priv = dev;
q->buf_struct_size = sizeof(struct cx88_buffer);
q->ops = &cx8800_video_qops;
Expand All @@ -1428,7 +1428,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
q->type = V4L2_BUF_TYPE_VBI_CAPTURE;
q->io_modes = VB2_MMAP | VB2_USERPTR | VB2_DMABUF | VB2_READ;
q->gfp_flags = GFP_DMA32;
q->min_buffers_needed = 2;
q->min_queued_buffers = 2;
q->drv_priv = dev;
q->buf_struct_size = sizeof(struct cx88_buffer);
q->ops = &cx8800_vbi_qops;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/dt3155/dt3155.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ static int dt3155_probe(struct pci_dev *pdev, const struct pci_device_id *id)
pd->vidq.ops = &q_ops;
pd->vidq.mem_ops = &vb2_dma_contig_memops;
pd->vidq.drv_priv = pd;
pd->vidq.min_buffers_needed = 2;
pd->vidq.min_queued_buffers = 2;
pd->vidq.gfp_flags = GFP_DMA32;
pd->vidq.lock = &pd->mux; /* for locking v4l2_file_operations */
pd->vidq.dev = &pdev->dev;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/intel/ipu3/ipu3-cio2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,7 @@ static int cio2_queue_init(struct cio2_device *cio2, struct cio2_queue *q)
vbq->mem_ops = &vb2_dma_sg_memops;
vbq->buf_struct_size = sizeof(struct cio2_buffer);
vbq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
vbq->min_buffers_needed = 1;
vbq->min_queued_buffers = 1;
vbq->drv_priv = cio2;
vbq->lock = &q->lock;
r = vb2_queue_init(vbq);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/mgb4/mgb4_vin.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ struct mgb4_vin_dev *mgb4_vin_create(struct mgb4_dev *mgbdev, int id)
vindev->queue.mem_ops = &vb2_dma_sg_memops;
vindev->queue.gfp_flags = GFP_DMA32;
vindev->queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
vindev->queue.min_buffers_needed = 2;
vindev->queue.min_queued_buffers = 2;
vindev->queue.drv_priv = vindev;
vindev->queue.lock = &vindev->lock;
vindev->queue.dev = dev;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/mgb4/mgb4_vout.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ struct mgb4_vout_dev *mgb4_vout_create(struct mgb4_dev *mgbdev, int id)
voutdev->queue.mem_ops = &vb2_dma_sg_memops;
voutdev->queue.gfp_flags = GFP_DMA32;
voutdev->queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
voutdev->queue.min_buffers_needed = 2;
voutdev->queue.min_queued_buffers = 2;
voutdev->queue.drv_priv = voutdev;
voutdev->queue.lock = &voutdev->lock;
voutdev->queue.dev = dev;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/tw5864/tw5864-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ static int tw5864_video_input_init(struct tw5864_input *input, int video_nr)
input->vidq.gfp_flags = 0;
input->vidq.buf_struct_size = sizeof(struct tw5864_buf);
input->vidq.lock = &input->lock;
input->vidq.min_buffers_needed = 2;
input->vidq.min_queued_buffers = 2;
input->vidq.dev = &input->root->pci->dev;
ret = vb2_queue_init(&input->vidq);
if (ret)
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/tw68/tw68-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@ int tw68_video_init2(struct tw68_dev *dev, int video_nr)
dev->vidq.gfp_flags = __GFP_DMA32 | __GFP_KSWAPD_RECLAIM;
dev->vidq.buf_struct_size = sizeof(struct tw68_buf);
dev->vidq.lock = &dev->lock;
dev->vidq.min_buffers_needed = 2;
dev->vidq.min_queued_buffers = 2;
dev->vidq.dev = &dev->pci->dev;
ret = vb2_queue_init(&dev->vidq);
if (ret)
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/tw686x/tw686x-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ int tw686x_video_init(struct tw686x_dev *dev)
vc->vidq.ops = &tw686x_video_qops;
vc->vidq.mem_ops = dev->dma_ops->mem_ops;
vc->vidq.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
vc->vidq.min_buffers_needed = 2;
vc->vidq.min_queued_buffers = 2;
vc->vidq.lock = &vc->vb_mutex;
vc->vidq.gfp_flags = dev->dma_mode != TW686X_DMA_MODE_MEMCPY ?
GFP_DMA32 : 0;
Expand Down
6 changes: 3 additions & 3 deletions drivers/media/pci/zoran/zoran_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,8 @@ static int zr_vb2_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, unsi

zr->buf_in_reserve = 0;

if (*nbuffers < vq->min_buffers_needed)
*nbuffers = vq->min_buffers_needed;
if (*nbuffers < vq->min_queued_buffers)
*nbuffers = vq->min_queued_buffers;

if (*nplanes) {
if (sizes[0] < size)
Expand Down Expand Up @@ -971,7 +971,7 @@ int zoran_queue_init(struct zoran *zr, struct vb2_queue *vq, int dir)
vq->mem_ops = &vb2_dma_contig_memops;
vq->gfp_flags = GFP_DMA32;
vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
vq->min_buffers_needed = 9;
vq->min_queued_buffers = 9;
vq->lock = &zr->lock;
err = vb2_queue_init(vq);
if (err)
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/platform/amphion/vpu_v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ static int vpu_m2m_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_q
src_vq->mem_ops = &vb2_vmalloc_memops;
src_vq->drv_priv = inst;
src_vq->buf_struct_size = sizeof(struct vpu_vb2_buffer);
src_vq->min_buffers_needed = 1;
src_vq->min_queued_buffers = 1;
src_vq->dev = inst->vpu->dev;
src_vq->lock = &inst->lock;
ret = vb2_queue_init(src_vq);
Expand All @@ -666,7 +666,7 @@ static int vpu_m2m_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_q
dst_vq->mem_ops = &vb2_vmalloc_memops;
dst_vq->drv_priv = inst;
dst_vq->buf_struct_size = sizeof(struct vpu_vb2_buffer);
dst_vq->min_buffers_needed = 1;
dst_vq->min_queued_buffers = 1;
dst_vq->dev = inst->vpu->dev;
dst_vq->lock = &inst->lock;
ret = vb2_queue_init(dst_vq);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/aspeed/aspeed-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -2034,7 +2034,7 @@ static int aspeed_video_setup_video(struct aspeed_video *video)
vbq->drv_priv = video;
vbq->buf_struct_size = sizeof(struct aspeed_video_buffer);
vbq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
vbq->min_buffers_needed = ASPEED_VIDEO_V4L2_MIN_BUF_REQ;
vbq->min_queued_buffers = ASPEED_VIDEO_V4L2_MIN_BUF_REQ;

rc = vb2_queue_init(vbq);
if (rc) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/atmel/atmel-isi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ static int atmel_isi_probe(struct platform_device *pdev)
q->ops = &isi_video_qops;
q->mem_ops = &vb2_dma_contig_memops;
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
q->min_buffers_needed = 2;
q->min_queued_buffers = 2;
q->dev = &pdev->dev;

ret = vb2_queue_init(q);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/chips-media/coda/coda-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2546,7 +2546,7 @@ static int coda_queue_init(struct coda_ctx *ctx, struct vb2_queue *vq)
* would need to be reflected in job_ready(). Currently we expect all
* queues to have at least one buffer queued.
*/
vq->min_buffers_needed = 1;
vq->min_queued_buffers = 1;
vq->dev = ctx->dev->dev;

return vb2_queue_init(vq);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/microchip/microchip-isc-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1780,7 +1780,7 @@ static int isc_async_complete(struct v4l2_async_notifier *notifier)
q->mem_ops = &vb2_dma_contig_memops;
q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
q->lock = &isc->lock;
q->min_buffers_needed = 1;
q->min_queued_buffers = 1;
q->dev = isc->dev;

ret = vb2_queue_init(q);
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/nuvoton/npcm-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,7 @@ static int npcm_video_setup_video(struct npcm_video *video)
vbq->drv_priv = video;
vbq->buf_struct_size = sizeof(struct npcm_video_buffer);
vbq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
vbq->min_buffers_needed = 3;
vbq->min_queued_buffers = 3;

rc = vb2_queue_init(vbq);
if (rc) {
Expand Down
Loading

0 comments on commit 80c2b40

Please sign in to comment.