Skip to contentSkip to conversation

media: blackfin: bfin_capture enhancements

PATCH Superseded Lad, Prabhakar 3 participants 23 messages Jan 22, 2015 – Feb 18, 2015 Media (V4L/DVB)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover media: blackfin: bfin_capture enhancements

This patch series, enhances blackfin capture driver with vb2 helpers.

Changes for v2:
--------------
Only patches 5/15 and 8/15 as per Scott's suggestions.

Lad, Prabhakar (15):
media: blackfin: bfin_capture: drop buf_init() callback
media: blackfin: bfin_capture: release buffers in case
start_streaming() call back fails
media: blackfin: bfin_capture: set min_buffers_needed
media: blackfin: bfin_capture: improve buf_prepare() callback
media: blackfin: bfin_capture: improve queue_setup() callback
media: blackfin: bfin_capture: use vb2_fop_mmap/poll
media: blackfin: bfin_capture: use v4l2_fh_open and vb2_fop_release
media: blackfin: bfin_capture: use vb2_ioctl_* helpers
media: blackfin: bfin_capture: make sure all buffers are returned on
stop_streaming() callback
media: blackfin: bfin_capture: return -ENODATA for *std calls
media: blackfin: bfin_capture: return -ENODATA for *dv_timings calls
media: blackfin: bfin_capture: add support for vidioc_create_bufs
media: blackfin: bfin_capture: add support for VB2_DMABUF
media: blackfin: bfin_capture: add support for VIDIOC_EXPBUF
media: blackfin: bfin_capture: set v4l2 buffer sequence

 drivers/media/platform/blackfin/bfin_capture.c | 311 ++++++++-----------------
 1 file changed, 99 insertions(+), 212 deletions(-)
Signature · 1 line
2.1.0
#1 lore raw

PATCH v2 1/15 media: blackfin: bfin_capture: drop buf_init() callback

this patch drops the buf_init() callback as init
of buf list is not required.

---
 drivers/media/platform/blackfin/bfin_capture.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/media/platform/blackfin/bfin_capture.c +0 -9
index 3112844..d4eeae9 100644
@@ -302,14 +302,6 @@ static int bcap_queue_setup(struct vb2_queue *vq,
 	return 0;
 }
 
-static int bcap_buffer_init(struct vb2_buffer *vb)
-{
-	struct bcap_buffer *buf = to_bcap_vb(vb);
-
-	INIT_LIST_HEAD(&buf->list);
-	return 0;
-}
-
 static int bcap_buffer_prepare(struct vb2_buffer *vb)
 {
 	struct bcap_device *bcap_dev = vb2_get_drv_priv(vb->vb2_queue);
@@ -441,7 +433,6 @@ static void bcap_stop_streaming(struct vb2_queue *vq)
 
 static struct vb2_ops bcap_video_qops = {
 	.queue_setup            = bcap_queue_setup,
-	.buf_init               = bcap_buffer_init,
 	.buf_prepare            = bcap_buffer_prepare,
 	.buf_cleanup            = bcap_buffer_cleanup,
 	.buf_queue              = bcap_buffer_queue,
Signature · 1 line
2.1.0
#2 lore raw

PATCH v2 2/15 media: blackfin: bfin_capture: release buffers in case start_streaming() call back fails

In reply to Lad, Prabhakar

this patch adds support to release the buffer by calling vb2_buffer_done(), with state marked as VB2_BUF_STATE_QUEUED if start_streaming() call back fails.

---
 drivers/media/platform/blackfin/bfin_capture.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/media/platform/blackfin/bfin_capture.c +13 -3
index d4eeae9..80463fa 100644
@@ -345,6 +345,7 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
 {
 	struct bcap_device *bcap_dev = vb2_get_drv_priv(vq);
 	struct ppi_if *ppi = bcap_dev->ppi;
+	struct bcap_buffer *buf, *tmp;
 	struct ppi_params params;
 	int ret;
 
@@ -352,7 +353,7 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
 	ret = v4l2_subdev_call(bcap_dev->sd, video, s_stream, 1);
 	if (ret && (ret != -ENOIOCTLCMD)) {
 		v4l2_err(&bcap_dev->v4l2_dev, "stream on failed in subdev\n");
-		return ret;
+		goto err;
 	}
 
 	/* set ppi params */
@@ -391,7 +392,7 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
 	if (ret < 0) {
 		v4l2_err(&bcap_dev->v4l2_dev,
 				"Error in setting ppi params\n");
-		return ret;
+		goto err;
 	}
 
 	/* attach ppi DMA irq handler */
@@ -399,12 +400,21 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
 	if (ret < 0) {
 		v4l2_err(&bcap_dev->v4l2_dev,
 				"Error in attaching interrupt handler\n");
-		return ret;
+		goto err;
 	}
 
 	reinit_completion(&bcap_dev->comp);
 	bcap_dev->stop = false;
+
 	return 0;
+
+err:
+	list_for_each_entry_safe(buf, tmp, &bcap_dev->dma_queue, list) {
+		list_del(&buf->list);
+		vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
+	}
+
+	return ret;
 }
 
 static void bcap_stop_streaming(struct vb2_queue *vq)
Signature · 1 line
2.1.0
#3 lore raw

PATCH v2 3/15 media: blackfin: bfin_capture: set min_buffers_needed

In reply to Lad, Prabhakar

this patch sets the min_buffers_needed field of the vb2 queue so that the vb2 core will make sure start_streaming() callback is called only when we have minimum buffers queued.

---
 drivers/media/platform/blackfin/bfin_capture.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/blackfin/bfin_capture.c +1 -0
index 80463fa..a997eac 100644
@@ -986,6 +986,7 @@ static int bcap_probe(struct platform_device *pdev)
 	q->mem_ops = &vb2_dma_contig_memops;
 	q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
 	q->lock = &bcap_dev->mutex;
+	q->min_buffers_needed = 1;
 
 	ret = vb2_queue_init(q);
 	if (ret)
Signature · 1 line
2.1.0
#4 lore raw

PATCH v2 4/15 media: blackfin: bfin_capture: improve buf_prepare() callback

In reply to Lad, Prabhakar

this patch improves the buf_prepare() callback.

---
 drivers/media/platform/blackfin/bfin_capture.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/media/platform/blackfin/bfin_capture.c +4 -8
index a997eac..8bd94a1 100644
@@ -305,16 +305,12 @@ static int bcap_queue_setup(struct vb2_queue *vq,
 static int bcap_buffer_prepare(struct vb2_buffer *vb)
 {
 	struct bcap_device *bcap_dev = vb2_get_drv_priv(vb->vb2_queue);
-	struct bcap_buffer *buf = to_bcap_vb(vb);
-	unsigned long size;
 
-	size = bcap_dev->fmt.sizeimage;
-	if (vb2_plane_size(vb, 0) < size) {
-		v4l2_err(&bcap_dev->v4l2_dev, "buffer too small (%lu < %lu)\n",
-				vb2_plane_size(vb, 0), size);
+	vb2_set_plane_payload(vb, 0, bcap_dev->fmt.sizeimage);
+	if (vb2_get_plane_payload(vb, 0) > vb2_plane_size(vb, 0))
 		return -EINVAL;
-	}
-	vb2_set_plane_payload(&buf->vb, 0, size);
+
+	vb->v4l2_buf.field = bcap_dev->fmt.field;
 
 	return 0;
 }
Signature · 1 line
2.1.0
#5 lore raw

PATCH v2 5/15 media: blackfin: bfin_capture: improve queue_setup() callback

In reply to Lad, Prabhakar

this patch improves the queue_setup() callback.

---
 drivers/media/platform/blackfin/bfin_capture.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/media/platform/blackfin/bfin_capture.c +6 -4
index 8bd94a1..0d8593b 100644
@@ -44,7 +44,6 @@
 #include <media/blackfin/ppi.h>
 
 #define CAPTURE_DRV_NAME        "bfin_capture"
-#define BCAP_MIN_NUM_BUF        2
 
 struct bcap_format {
 	char *desc;
@@ -292,11 +291,14 @@ static int bcap_queue_setup(struct vb2_queue *vq,
 {
 	struct bcap_device *bcap_dev = vb2_get_drv_priv(vq);
 
-	if (*nbuffers < BCAP_MIN_NUM_BUF)
-		*nbuffers = BCAP_MIN_NUM_BUF;
+	if (fmt && fmt->fmt.pix.sizeimage < bcap_dev->fmt.sizeimage)
+		return -EINVAL;
+
+	if (vq->num_buffers + *nbuffers < 2)
+		*nbuffers = 2;
 
 	*nplanes = 1;
-	sizes[0] = bcap_dev->fmt.sizeimage;
+	sizes[0] = fmt ? fmt->fmt.pix.sizeimage : bcap_dev->fmt.sizeimage;
 	alloc_ctxs[0] = bcap_dev->alloc_ctx;
 
 	return 0;
Signature · 1 line
2.1.0
#6 lore raw

PATCH v2 6/15 media: blackfin: bfin_capture: use vb2_fop_mmap/poll

In reply to Lad, Prabhakar

No need to reinvent the wheel. Just use the already existing functions provided by vb2.

---
 drivers/media/platform/blackfin/bfin_capture.c | 28 +++-----------------------
 1 file changed, 3 insertions(+), 25 deletions(-)
drivers/media/platform/blackfin/bfin_capture.c +3 -25
index 0d8593b..8ddff32 100644
@@ -244,18 +244,6 @@ static int bcap_release(struct file *file)
 	return 0;
 }
 
-static int bcap_mmap(struct file *file, struct vm_area_struct *vma)
-{
-	struct bcap_device *bcap_dev = video_drvdata(file);
-	int ret;
-
-	if (mutex_lock_interruptible(&bcap_dev->mutex))
-		return -ERESTARTSYS;
-	ret = vb2_mmap(&bcap_dev->buffer_queue, vma);
-	mutex_unlock(&bcap_dev->mutex);
-	return ret;
-}
-
 #ifndef CONFIG_MMU
 static unsigned long bcap_get_unmapped_area(struct file *file,
 					    unsigned long addr,
@@ -273,17 +261,6 @@ static unsigned long bcap_get_unmapped_area(struct file *file,
 }
 #endif
 
-static unsigned int bcap_poll(struct file *file, poll_table *wait)
-{
-	struct bcap_device *bcap_dev = video_drvdata(file);
-	unsigned int res;
-
-	mutex_lock(&bcap_dev->mutex);
-	res = vb2_poll(&bcap_dev->buffer_queue, file, wait);
-	mutex_unlock(&bcap_dev->mutex);
-	return res;
-}
-
 static int bcap_queue_setup(struct vb2_queue *vq,
 				const struct v4l2_format *fmt,
 				unsigned int *nbuffers, unsigned int *nplanes,
@@ -896,11 +873,11 @@ static struct v4l2_file_operations bcap_fops = {
 	.open = bcap_open,
 	.release = bcap_release,
 	.unlocked_ioctl = video_ioctl2,
-	.mmap = bcap_mmap,
+	.mmap = vb2_fop_mmap,
 #ifndef CONFIG_MMU
 	.get_unmapped_area = bcap_get_unmapped_area,
 #endif
-	.poll = bcap_poll
+	.poll = vb2_fop_poll
 };
 
 static int bcap_probe(struct platform_device *pdev)
@@ -997,6 +974,7 @@ static int bcap_probe(struct platform_device *pdev)
 	INIT_LIST_HEAD(&bcap_dev->dma_queue);
 
 	vfd->lock = &bcap_dev->mutex;
+	vfd->queue = q;
 
 	/* register video device */
 	ret = video_register_device(bcap_dev->video_dev, VFL_TYPE_GRABBER, -1);
Signature · 1 line
2.1.0
#7 lore raw

PATCH v2 7/15 media: blackfin: bfin_capture: use v4l2_fh_open and vb2_fop_release

In reply to Lad, Prabhakar

this patch adds support to use v4l2_fh_open() and vb2_fop_release, which allows to drop driver specific struct bcap_fh, as this is handled by core.

---
 drivers/media/platform/blackfin/bfin_capture.c | 79 +-------------------------
 1 file changed, 2 insertions(+), 77 deletions(-)
drivers/media/platform/blackfin/bfin_capture.c +2 -77
index 8ddff32..b2eeace 100644
@@ -105,12 +105,6 @@ struct bcap_device {
 	bool stop;
 };
 
-struct bcap_fh {
-	struct v4l2_fh fh;
-	/* indicates whether this file handle is doing IO */
-	bool io_allowed;
-};
-
 static const struct bcap_format bcap_formats[] = {
 	{
 		.desc        = "YCbCr 4:2:2 Interleaved UYVY",
@@ -200,50 +194,6 @@ static void bcap_free_sensor_formats(struct bcap_device *bcap_dev)
 	bcap_dev->sensor_formats = NULL;
 }
 
-static int bcap_open(struct file *file)
-{
-	struct bcap_device *bcap_dev = video_drvdata(file);
-	struct video_device *vfd = bcap_dev->video_dev;
-	struct bcap_fh *bcap_fh;
-
-	if (!bcap_dev->sd) {
-		v4l2_err(&bcap_dev->v4l2_dev, "No sub device registered\n");
-		return -ENODEV;
-	}
-
-	bcap_fh = kzalloc(sizeof(*bcap_fh), GFP_KERNEL);
-	if (!bcap_fh) {
-		v4l2_err(&bcap_dev->v4l2_dev,
-			 "unable to allocate memory for file handle object\n");
-		return -ENOMEM;
-	}
-
-	v4l2_fh_init(&bcap_fh->fh, vfd);
-
-	/* store pointer to v4l2_fh in private_data member of file */
-	file->private_data = &bcap_fh->fh;
-	v4l2_fh_add(&bcap_fh->fh);
-	bcap_fh->io_allowed = false;
-	return 0;
-}
-
-static int bcap_release(struct file *file)
-{
-	struct bcap_device *bcap_dev = video_drvdata(file);
-	struct v4l2_fh *fh = file->private_data;
-	struct bcap_fh *bcap_fh = container_of(fh, struct bcap_fh, fh);
-
-	/* if this instance is doing IO */
-	if (bcap_fh->io_allowed)
-		vb2_queue_release(&bcap_dev->buffer_queue);
-
-	file->private_data = NULL;
-	v4l2_fh_del(&bcap_fh->fh);
-	v4l2_fh_exit(&bcap_fh->fh);
-	kfree(bcap_fh);
-	return 0;
-}
-
 #ifndef CONFIG_MMU
 static unsigned long bcap_get_unmapped_area(struct file *file,
 					    unsigned long addr,
@@ -432,13 +382,6 @@ static int bcap_reqbufs(struct file *file, void *priv,
 {
 	struct bcap_device *bcap_dev = video_drvdata(file);
 	struct vb2_queue *vq = &bcap_dev->buffer_queue;
-	struct v4l2_fh *fh = file->private_data;
-	struct bcap_fh *bcap_fh = container_of(fh, struct bcap_fh, fh);
-
-	if (vb2_is_busy(vq))
-		return -EBUSY;
-
-	bcap_fh->io_allowed = true;
 
 	return vb2_reqbufs(vq, req_buf);
 }
@@ -455,11 +398,6 @@ static int bcap_qbuf(struct file *file, void *priv,
 			struct v4l2_buffer *buf)
 {
 	struct bcap_device *bcap_dev = video_drvdata(file);
-	struct v4l2_fh *fh = file->private_data;
-	struct bcap_fh *bcap_fh = container_of(fh, struct bcap_fh, fh);
-
-	if (!bcap_fh->io_allowed)
-		return -EBUSY;
 
 	return vb2_qbuf(&bcap_dev->buffer_queue, buf);
 }
@@ -468,11 +406,6 @@ static int bcap_dqbuf(struct file *file, void *priv,
 			struct v4l2_buffer *buf)
 {
 	struct bcap_device *bcap_dev = video_drvdata(file);
-	struct v4l2_fh *fh = file->private_data;
-	struct bcap_fh *bcap_fh = container_of(fh, struct bcap_fh, fh);
-
-	if (!bcap_fh->io_allowed)
-		return -EBUSY;
 
 	return vb2_dqbuf(&bcap_dev->buffer_queue,
 				buf, file->f_flags & O_NONBLOCK);
@@ -523,14 +456,10 @@ static int bcap_streamon(struct file *file, void *priv,
 				enum v4l2_buf_type buf_type)
 {
 	struct bcap_device *bcap_dev = video_drvdata(file);
-	struct bcap_fh *fh = file->private_data;
 	struct ppi_if *ppi = bcap_dev->ppi;
 	dma_addr_t addr;
 	int ret;
 
-	if (!fh->io_allowed)
-		return -EBUSY;
-
 	/* call streamon to start streaming in videobuf */
 	ret = vb2_streamon(&bcap_dev->buffer_queue, buf_type);
 	if (ret)
@@ -564,10 +493,6 @@ static int bcap_streamoff(struct file *file, void *priv,
 				enum v4l2_buf_type buf_type)
 {
 	struct bcap_device *bcap_dev = video_drvdata(file);
-	struct bcap_fh *fh = file->private_data;
-
-	if (!fh->io_allowed)
-		return -EBUSY;
 
 	return vb2_streamoff(&bcap_dev->buffer_queue, buf_type);
 }
@@ -870,8 +795,8 @@ static const struct v4l2_ioctl_ops bcap_ioctl_ops = {
 
 static struct v4l2_file_operations bcap_fops = {
 	.owner = THIS_MODULE,
-	.open = bcap_open,
-	.release = bcap_release,
+	.open = v4l2_fh_open,
+	.release = vb2_fop_release,
 	.unlocked_ioctl = video_ioctl2,
 	.mmap = vb2_fop_mmap,
 #ifndef CONFIG_MMU
Signature · 1 line
2.1.0
#8 lore raw

PATCH v2 8/15 media: blackfin: bfin_capture: use vb2_ioctl_* helpers

In reply to Lad, Prabhakar

this patch adds support to vb2_ioctl_* helpers.

---
 drivers/media/platform/blackfin/bfin_capture.c | 108 ++++++-------------------
 1 file changed, 23 insertions(+), 85 deletions(-)
drivers/media/platform/blackfin/bfin_capture.c +23 -85
index b2eeace..04b85e3 100644
@@ -272,15 +272,26 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
 	struct ppi_if *ppi = bcap_dev->ppi;
 	struct bcap_buffer *buf, *tmp;
 	struct ppi_params params;
+	dma_addr_t addr;
 	int ret;
 
 	/* enable streamon on the sub device */
 	ret = v4l2_subdev_call(bcap_dev->sd, video, s_stream, 1);
 	if (ret && (ret != -ENOIOCTLCMD)) {
 		v4l2_err(&bcap_dev->v4l2_dev, "stream on failed in subdev\n");
+		bcap_dev->cur_frm = NULL;
 		goto err;
 	}
 
+	/* get the next frame from the dma queue */
+	bcap_dev->cur_frm = list_entry(bcap_dev->dma_queue.next,
+					struct bcap_buffer, list);
+	/* remove buffer from the dma queue */
+	list_del_init(&bcap_dev->cur_frm->list);
+	addr = vb2_dma_contig_plane_dma_addr(&bcap_dev->cur_frm->vb, 0);
+	/* update DMA address */
+	ppi->ops->update_addr(ppi, (unsigned long)addr);
+
 	/* set ppi params */
 	params.width = bcap_dev->fmt.width;
 	params.height = bcap_dev->fmt.height;
@@ -320,6 +331,9 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
 		goto err;
 	}
 
+	/* enable ppi */
+	ppi->ops->start(ppi);
+
 	/* attach ppi DMA irq handler */
 	ret = ppi->ops->attach_irq(ppi, bcap_isr);
 	if (ret < 0) {
@@ -334,6 +348,9 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
 	return 0;
 
 err:
+	if (bcap_dev->cur_frm)
+		vb2_buffer_done(&bcap_dev->cur_frm->vb, VB2_BUF_STATE_QUEUED);
+
 	list_for_each_entry_safe(buf, tmp, &bcap_dev->dma_queue, list) {
 		list_del(&buf->list);
 		vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED);
@@ -377,40 +394,6 @@ static struct vb2_ops bcap_video_qops = {
 	.stop_streaming         = bcap_stop_streaming,
 };
 
-static int bcap_reqbufs(struct file *file, void *priv,
-			struct v4l2_requestbuffers *req_buf)
-{
-	struct bcap_device *bcap_dev = video_drvdata(file);
-	struct vb2_queue *vq = &bcap_dev->buffer_queue;
-
-	return vb2_reqbufs(vq, req_buf);
-}
-
-static int bcap_querybuf(struct file *file, void *priv,
-				struct v4l2_buffer *buf)
-{
-	struct bcap_device *bcap_dev = video_drvdata(file);
-
-	return vb2_querybuf(&bcap_dev->buffer_queue, buf);
-}
-
-static int bcap_qbuf(struct file *file, void *priv,
-			struct v4l2_buffer *buf)
-{
-	struct bcap_device *bcap_dev = video_drvdata(file);
-
-	return vb2_qbuf(&bcap_dev->buffer_queue, buf);
-}
-
-static int bcap_dqbuf(struct file *file, void *priv,
-			struct v4l2_buffer *buf)
-{
-	struct bcap_device *bcap_dev = video_drvdata(file);
-
-	return vb2_dqbuf(&bcap_dev->buffer_queue,
-				buf, file->f_flags & O_NONBLOCK);
-}
-
 static irqreturn_t bcap_isr(int irq, void *dev_id)
 {
 	struct ppi_if *ppi = dev_id;
@@ -452,51 +435,6 @@ static irqreturn_t bcap_isr(int irq, void *dev_id)
 	return IRQ_HANDLED;
 }
 
-static int bcap_streamon(struct file *file, void *priv,
-				enum v4l2_buf_type buf_type)
-{
-	struct bcap_device *bcap_dev = video_drvdata(file);
-	struct ppi_if *ppi = bcap_dev->ppi;
-	dma_addr_t addr;
-	int ret;
-
-	/* call streamon to start streaming in videobuf */
-	ret = vb2_streamon(&bcap_dev->buffer_queue, buf_type);
-	if (ret)
-		return ret;
-
-	/* if dma queue is empty, return error */
-	if (list_empty(&bcap_dev->dma_queue)) {
-		v4l2_err(&bcap_dev->v4l2_dev, "dma queue is empty\n");
-		ret = -EINVAL;
-		goto err;
-	}
-
-	/* get the next frame from the dma queue */
-	bcap_dev->cur_frm = list_entry(bcap_dev->dma_queue.next,
-					struct bcap_buffer, list);
-	/* remove buffer from the dma queue */
-	list_del_init(&bcap_dev->cur_frm->list);
-	addr = vb2_dma_contig_plane_dma_addr(&bcap_dev->cur_frm->vb, 0);
-	/* update DMA address */
-	ppi->ops->update_addr(ppi, (unsigned long)addr);
-	/* enable ppi */
-	ppi->ops->start(ppi);
-
-	return 0;
-err:
-	vb2_streamoff(&bcap_dev->buffer_queue, buf_type);
-	return ret;
-}
-
-static int bcap_streamoff(struct file *file, void *priv,
-				enum v4l2_buf_type buf_type)
-{
-	struct bcap_device *bcap_dev = video_drvdata(file);
-
-	return vb2_streamoff(&bcap_dev->buffer_queue, buf_type);
-}
-
 static int bcap_querystd(struct file *file, void *priv, v4l2_std_id *std)
 {
 	struct bcap_device *bcap_dev = video_drvdata(file);
@@ -782,12 +720,12 @@ static const struct v4l2_ioctl_ops bcap_ioctl_ops = {
 	.vidioc_g_dv_timings     = bcap_g_dv_timings,
 	.vidioc_query_dv_timings = bcap_query_dv_timings,
 	.vidioc_enum_dv_timings  = bcap_enum_dv_timings,
-	.vidioc_reqbufs          = bcap_reqbufs,
-	.vidioc_querybuf         = bcap_querybuf,
-	.vidioc_qbuf             = bcap_qbuf,
-	.vidioc_dqbuf            = bcap_dqbuf,
-	.vidioc_streamon         = bcap_streamon,
-	.vidioc_streamoff        = bcap_streamoff,
+	.vidioc_reqbufs          = vb2_ioctl_reqbufs,
+	.vidioc_querybuf         = vb2_ioctl_querybuf,
+	.vidioc_qbuf             = vb2_ioctl_qbuf,
+	.vidioc_dqbuf            = vb2_ioctl_dqbuf,
+	.vidioc_streamon         = vb2_ioctl_streamon,
+	.vidioc_streamoff        = vb2_ioctl_streamoff,
 	.vidioc_g_parm           = bcap_g_parm,
 	.vidioc_s_parm           = bcap_s_parm,
 	.vidioc_log_status       = bcap_log_status,
Signature · 1 line
2.1.0
#9 lore raw

Re: [PATCH v2 08/15] media: blackfin: bfin_capture: use vb2_ioctl_* helpers

Hi Lad,

2015-01-23 6:18 GMT+08:00 Lad, Prabhakar <[email protected]>:

Quoted 39 lines

this patch adds support to vb2_ioctl_* helpers.

---
 drivers/media/platform/blackfin/bfin_capture.c | 108 ++++++-------------------
 1 file changed, 23 insertions(+), 85 deletions(-)
drivers/media/platform/blackfin/bfin_capture.c +11 -0
index b2eeace..04b85e3 100644
@@ -272,15 +272,26 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
        struct ppi_if *ppi = bcap_dev->ppi;
        struct bcap_buffer *buf, *tmp;
        struct ppi_params params;
+       dma_addr_t addr;
        int ret;
 
        /* enable streamon on the sub device */
        ret = v4l2_subdev_call(bcap_dev->sd, video, s_stream, 1);
        if (ret && (ret != -ENOIOCTLCMD)) {
                v4l2_err(&bcap_dev->v4l2_dev, "stream on failed in subdev\n");
+               bcap_dev->cur_frm = NULL;
                goto err;
        }
 
+       /* get the next frame from the dma queue */
+       bcap_dev->cur_frm = list_entry(bcap_dev->dma_queue.next,
+                                       struct bcap_buffer, list);
+       /* remove buffer from the dma queue */
+       list_del_init(&bcap_dev->cur_frm->list);
+       addr = vb2_dma_contig_plane_dma_addr(&bcap_dev->cur_frm->vb, 0);
+       /* update DMA address */
+       ppi->ops->update_addr(ppi, (unsigned long)addr);
+
        /* set ppi params */
        params.width = bcap_dev->fmt.width;
        params.height = bcap_dev->fmt.height;

drivers/media/platform/blackfin/bfin_capture.c static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count) · line 336

Quoted 6 lines
drivers/media/platform/blackfin/bfin_capture.c +3 -0
@@ -320,6 +331,9 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
                goto err;
        }
 
+       /* enable ppi */
+       ppi->ops->start(ppi);
+

Still wrong here. You can't start ppi before request dma and irq. Also it's not good to update dma address before request dma. Please strictly follow the initial sequence in bcap_streamon() because the order is important. That means you should put all functions in bcap_start_streaming() before those in bcap_streamon().
And it seems you removed dma buffer check in bcap_streamon(). Yes, in vb2_internal_streamon() it will check q->queued_count >= q->min_buffers_needed to start streaming. But if the user doesn't queue enough buffer, it will return success and set q->streaming = 1. Is it really right here?

Quoted 7 lines
drivers/media/platform/blackfin/bfin_capture.c +0 -0
        /* attach ppi DMA irq handler */
        ret = ppi->ops->attach_irq(ppi, bcap_isr);
        if (ret < 0) {
@@ -334,6 +348,9 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
        return 0;
 
 
#10 lore raw

Re: [PATCH v2 08/15] media: blackfin: bfin_capture: use vb2_ioctl_* helpers

Quoted 45 lines · Scott Jiang

Hi Lad,

2015-01-23 6:18 GMT+08:00 Lad, Prabhakar <[email protected]>:

Quoted 42 lines

this patch adds support to vb2_ioctl_* helpers.

---
 drivers/media/platform/blackfin/bfin_capture.c | 108 ++++++-------------------
 1 file changed, 23 insertions(+), 85 deletions(-)
drivers/media/platform/blackfin/bfin_capture.c +11 -0
index b2eeace..04b85e3 100644
@@ -272,15 +272,26 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
        struct ppi_if *ppi = bcap_dev->ppi;
        struct bcap_buffer *buf, *tmp;
        struct ppi_params params;
+       dma_addr_t addr;
        int ret;
 
        /* enable streamon on the sub device */
        ret = v4l2_subdev_call(bcap_dev->sd, video, s_stream, 1);
        if (ret && (ret != -ENOIOCTLCMD)) {
                v4l2_err(&bcap_dev->v4l2_dev, "stream on failed in subdev\n");
+               bcap_dev->cur_frm = NULL;
                goto err;
        }
 
+       /* get the next frame from the dma queue */
+       bcap_dev->cur_frm = list_entry(bcap_dev->dma_queue.next,
+                                       struct bcap_buffer, list);
+       /* remove buffer from the dma queue */
+       list_del_init(&bcap_dev->cur_frm->list);
+       addr = vb2_dma_contig_plane_dma_addr(&bcap_dev->cur_frm->vb, 0);
+       /* update DMA address */
+       ppi->ops->update_addr(ppi, (unsigned long)addr);
+
        /* set ppi params */
        params.width = bcap_dev->fmt.width;
        params.height = bcap_dev->fmt.height;
@@ -320,6 +331,9 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
                goto err;
        }
 
Quoted 13 lines

drivers/media/platform/blackfin/bfin_capture.c static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count) · line 336

Quoted 3 lines
drivers/media/platform/blackfin/bfin_capture.c +3 -0
+       /* enable ppi */
+       ppi->ops->start(ppi);
+

Still wrong here. You can't start ppi before request dma and irq. Also it's not good to update dma address before request dma. Please strictly follow the initial sequence in bcap_streamon() because the order is important. That means you should put all functions in bcap_start_streaming() before those in bcap_streamon().
And it seems you removed dma buffer check in bcap_streamon(). Yes, in vb2_internal_streamon() it will check q->queued_count >= q->min_buffers_needed to start streaming. But if the user doesn't queue enough buffer, it will return success and set q->streaming = 1. Is it really right here?

Yes, that's really right. The V4L2 state is set to streaming after calling VIDIOC_STREAMON, even if the DMA engine hasn't started yet. That's set with the start_streaming_called bitfield.

Regards,

Hans

Quoted 13 lines

drivers/media/platform/blackfin/bfin_capture.c static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count) · line 350

Quoted 8 lines
drivers/media/platform/blackfin/bfin_capture.c +0 -0
        /* attach ppi DMA irq handler */
        ret = ppi->ops->attach_irq(ppi, bcap_isr);
        if (ret < 0) {
@@ -334,6 +348,9 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
        return 0;
 
 

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw

PATCH v2 9/15 media: blackfin: bfin_capture: make sure all buffers are returned on stop_streaming() callback

In reply to Lad, Prabhakar

In start_streaming() callback the buffer is removed from the dma_queue list and assigned to cur_frm, this patch makes sure that is returned to vb2 core with VB2_BUF_STATE_ERROR flag.

---
 drivers/media/platform/blackfin/bfin_capture.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/media/platform/blackfin/bfin_capture.c +3 -0
index 04b85e3..57f3b8c 100644
@@ -375,6 +375,9 @@ static void bcap_stop_streaming(struct vb2_queue *vq)
 				"stream off failed in subdev\n");
 
 	/* release all active buffers */
+	if (bcap_dev->cur_frm)
+		vb2_buffer_done(&bcap_dev->cur_frm->vb, VB2_BUF_STATE_ERROR);
+
 	while (!list_empty(&bcap_dev->dma_queue)) {
 		bcap_dev->cur_frm = list_entry(bcap_dev->dma_queue.next,
 						struct bcap_buffer, list);
Signature · 1 line
2.1.0
#12 lore raw

PATCH v2 10/15 media: blackfin: bfin_capture: return -ENODATA for *std calls

In reply to Lad, Prabhakar

this patch adds supports to return -ENODATA to *_std calls if the selected output does not support it.

---
 drivers/media/platform/blackfin/bfin_capture.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/media/platform/blackfin/bfin_capture.c +15 -0
index 57f3b8c..6b38e63 100644
@@ -441,6 +441,11 @@ static irqreturn_t bcap_isr(int irq, void *dev_id)
 static int bcap_querystd(struct file *file, void *priv, v4l2_std_id *std)
 {
 	struct bcap_device *bcap_dev = video_drvdata(file);
+	struct v4l2_input input;
+
+	input = bcap_dev->cfg->inputs[bcap_dev->cur_input];
+	if (!(input.capabilities & V4L2_IN_CAP_STD))
+		return -ENODATA;
 
 	return v4l2_subdev_call(bcap_dev->sd, video, querystd, std);
 }
@@ -448,6 +453,11 @@ static int bcap_querystd(struct file *file, void *priv, v4l2_std_id *std)
 static int bcap_g_std(struct file *file, void *priv, v4l2_std_id *std)
 {
 	struct bcap_device *bcap_dev = video_drvdata(file);
+	struct v4l2_input input;
+
+	input = bcap_dev->cfg->inputs[bcap_dev->cur_input];
+	if (!(input.capabilities & V4L2_IN_CAP_STD))
+		return -ENODATA;
 
 	*std = bcap_dev->std;
 	return 0;
@@ -456,8 +466,13 @@ static int bcap_g_std(struct file *file, void *priv, v4l2_std_id *std)
 static int bcap_s_std(struct file *file, void *priv, v4l2_std_id std)
 {
 	struct bcap_device *bcap_dev = video_drvdata(file);
+	struct v4l2_input input;
 	int ret;
 
+	input = bcap_dev->cfg->inputs[bcap_dev->cur_input];
+	if (!(input.capabilities & V4L2_IN_CAP_STD))
+		return -ENODATA;
+
 	if (vb2_is_busy(&bcap_dev->buffer_queue))
 		return -EBUSY;
 
Signature · 1 line
2.1.0
#13 lore raw

PATCH v2 11/15 media: blackfin: bfin_capture: return -ENODATA for *dv_timings calls

In reply to Lad, Prabhakar

this patch adds support to return -ENODATA for *dv_timings calls if the current output does not support it.

---
 drivers/media/platform/blackfin/bfin_capture.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
drivers/media/platform/blackfin/bfin_capture.c +21 -0
index 6b38e63..31b5697 100644
@@ -488,6 +488,11 @@ static int bcap_enum_dv_timings(struct file *file, void *priv,
 				struct v4l2_enum_dv_timings *timings)
 {
 	struct bcap_device *bcap_dev = video_drvdata(file);
+	struct v4l2_input input;
+
+	input = bcap_dev->cfg->inputs[bcap_dev->cur_input];
+	if (!(input.capabilities & V4L2_IN_CAP_DV_TIMINGS))
+		return -ENODATA;
 
 	timings->pad = 0;
 
@@ -499,6 +504,11 @@ static int bcap_query_dv_timings(struct file *file, void *priv,
 				struct v4l2_dv_timings *timings)
 {
 	struct bcap_device *bcap_dev = video_drvdata(file);
+	struct v4l2_input input;
+
+	input = bcap_dev->cfg->inputs[bcap_dev->cur_input];
+	if (!(input.capabilities & V4L2_IN_CAP_DV_TIMINGS))
+		return -ENODATA;
 
 	return v4l2_subdev_call(bcap_dev->sd, video,
 				query_dv_timings, timings);
@@ -508,6 +518,11 @@ static int bcap_g_dv_timings(struct file *file, void *priv,
 				struct v4l2_dv_timings *timings)
 {
 	struct bcap_device *bcap_dev = video_drvdata(file);
+	struct v4l2_input input;
+
+	input = bcap_dev->cfg->inputs[bcap_dev->cur_input];
+	if (!(input.capabilities & V4L2_IN_CAP_DV_TIMINGS))
+		return -ENODATA;
 
 	*timings = bcap_dev->dv_timings;
 	return 0;
@@ -517,7 +532,13 @@ static int bcap_s_dv_timings(struct file *file, void *priv,
 				struct v4l2_dv_timings *timings)
 {
 	struct bcap_device *bcap_dev = video_drvdata(file);
+	struct v4l2_input input;
 	int ret;
+
+	input = bcap_dev->cfg->inputs[bcap_dev->cur_input];
+	if (!(input.capabilities & V4L2_IN_CAP_DV_TIMINGS))
+		return -ENODATA;
+
 	if (vb2_is_busy(&bcap_dev->buffer_queue))
 		return -EBUSY;
 
Signature · 1 line
2.1.0
#14 lore raw

PATCH v2 12/15 media: blackfin: bfin_capture: add support for vidioc_create_bufs

In reply to Lad, Prabhakar

this patch adds support for vidioc_create_bufs.

---
 drivers/media/platform/blackfin/bfin_capture.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/blackfin/bfin_capture.c +1 -0
index 31b5697..b5b45e5 100644
@@ -760,6 +760,7 @@ static const struct v4l2_ioctl_ops bcap_ioctl_ops = {
 	.vidioc_query_dv_timings = bcap_query_dv_timings,
 	.vidioc_enum_dv_timings  = bcap_enum_dv_timings,
 	.vidioc_reqbufs          = vb2_ioctl_reqbufs,
+	.vidioc_create_bufs      = vb2_ioctl_create_bufs,
 	.vidioc_querybuf         = vb2_ioctl_querybuf,
 	.vidioc_qbuf             = vb2_ioctl_qbuf,
 	.vidioc_dqbuf            = vb2_ioctl_dqbuf,
Signature · 1 line
2.1.0
#15 lore raw

PATCH v2 13/15 media: blackfin: bfin_capture: add support for VB2_DMABUF

In reply to Lad, Prabhakar

this patch adds support for VB2_DMABUF.

---
 drivers/media/platform/blackfin/bfin_capture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/blackfin/bfin_capture.c +1 -1
index b5b45e5..876db4b 100644
@@ -857,7 +857,7 @@ static int bcap_probe(struct platform_device *pdev)
 	/* initialize queue */
 	q = &bcap_dev->buffer_queue;
 	q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
-	q->io_modes = VB2_MMAP;
+	q->io_modes = VB2_MMAP | VB2_DMABUF;
 	q->drv_priv = bcap_dev;
 	q->buf_struct_size = sizeof(struct bcap_buffer);
 	q->ops = &bcap_video_qops;
Signature · 1 line
2.1.0
#16 lore raw

PATCH v2 14/15 media: blackfin: bfin_capture: add support for VIDIOC_EXPBUF

In reply to Lad, Prabhakar

this patch adds support for VIDIOC_EXPBUF.

---
 drivers/media/platform/blackfin/bfin_capture.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/platform/blackfin/bfin_capture.c +1 -0
index 876db4b..f154f25 100644
@@ -764,6 +764,7 @@ static const struct v4l2_ioctl_ops bcap_ioctl_ops = {
 	.vidioc_querybuf         = vb2_ioctl_querybuf,
 	.vidioc_qbuf             = vb2_ioctl_qbuf,
 	.vidioc_dqbuf            = vb2_ioctl_dqbuf,
+	.vidioc_expbuf           = vb2_ioctl_expbuf,
 	.vidioc_streamon         = vb2_ioctl_streamon,
 	.vidioc_streamoff        = vb2_ioctl_streamoff,
 	.vidioc_g_parm           = bcap_g_parm,
Signature · 1 line
2.1.0
#17 lore raw

PATCH v2 15/15 media: blackfin: bfin_capture: set v4l2 buffer sequence

In reply to Lad, Prabhakar

this patch adds support to set the v4l2 buffer sequence.

---
 drivers/media/platform/blackfin/bfin_capture.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/media/platform/blackfin/bfin_capture.c +5 -0
index f154f25..65c1301 100644
@@ -103,6 +103,8 @@ struct bcap_device {
 	struct completion comp;
 	/* prepare to stop */
 	bool stop;
+	/* vb2 buffer sequence counter */
+	unsigned sequence;
 };
 
 static const struct bcap_format bcap_formats[] = {
@@ -342,6 +344,8 @@ static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count)
 		goto err;
 	}
 
+	bcap_dev->sequence = 0;
+
 	reinit_completion(&bcap_dev->comp);
 	bcap_dev->stop = false;
 
@@ -412,6 +416,7 @@ static irqreturn_t bcap_isr(int irq, void *dev_id)
 			vb2_buffer_done(vb, VB2_BUF_STATE_ERROR);
 			ppi->err = false;
 		} else {
+			vb->v4l2_buf.sequence = bcap_dev->sequence++;
 			vb2_buffer_done(vb, VB2_BUF_STATE_DONE);
 		}
 		bcap_dev->cur_frm = list_entry(bcap_dev->dma_queue.next,
Signature · 1 line
2.1.0
#18 lore raw
In reply to Lad, Prabhakar

Hello Scott,

Quoted 26 lines · Prabhakar

This patch series, enhances blackfin capture driver with vb2 helpers.

Changes for v2:
--------------
Only patches 5/15 and 8/15 as per Scott's suggestions.

Lad, Prabhakar (15):
media: blackfin: bfin_capture: drop buf_init() callback
media: blackfin: bfin_capture: release buffers in case
start_streaming() call back fails
media: blackfin: bfin_capture: set min_buffers_needed
media: blackfin: bfin_capture: improve buf_prepare() callback
media: blackfin: bfin_capture: improve queue_setup() callback
media: blackfin: bfin_capture: use vb2_fop_mmap/poll
media: blackfin: bfin_capture: use v4l2_fh_open and vb2_fop_release
media: blackfin: bfin_capture: use vb2_ioctl_* helpers
media: blackfin: bfin_capture: make sure all buffers are returned on
stop_streaming() callback
media: blackfin: bfin_capture: return -ENODATA for *std calls
media: blackfin: bfin_capture: return -ENODATA for *dv_timings calls
media: blackfin: bfin_capture: add support for vidioc_create_bufs
media: blackfin: bfin_capture: add support for VB2_DMABUF
media: blackfin: bfin_capture: add support for VIDIOC_EXPBUF
media: blackfin: bfin_capture: set v4l2 buffer sequence

Quoted 3 lines
 drivers/media/platform/blackfin/bfin_capture.c | 311 ++++++++-----------------
 1 file changed, 99 insertions(+), 212 deletions(-)

Can you ACK the series ? so that its easier for Hans to pick it up.

Cheers,
--Prabhakar Lad

#19 lore raw
Quoted 30 lines · Prabhakar

Hello Scott,

Quoted 26 lines · Prabhakar

This patch series, enhances blackfin capture driver with vb2 helpers.

Changes for v2:
--------------
Only patches 5/15 and 8/15 as per Scott's suggestions.

Lad, Prabhakar (15):
media: blackfin: bfin_capture: drop buf_init() callback
media: blackfin: bfin_capture: release buffers in case
start_streaming() call back fails
media: blackfin: bfin_capture: set min_buffers_needed
media: blackfin: bfin_capture: improve buf_prepare() callback
media: blackfin: bfin_capture: improve queue_setup() callback
media: blackfin: bfin_capture: use vb2_fop_mmap/poll
media: blackfin: bfin_capture: use v4l2_fh_open and vb2_fop_release
media: blackfin: bfin_capture: use vb2_ioctl_* helpers
media: blackfin: bfin_capture: make sure all buffers are returned on
stop_streaming() callback
media: blackfin: bfin_capture: return -ENODATA for *std calls
media: blackfin: bfin_capture: return -ENODATA for *dv_timings calls
media: blackfin: bfin_capture: add support for vidioc_create_bufs
media: blackfin: bfin_capture: add support for VB2_DMABUF
media: blackfin: bfin_capture: add support for VIDIOC_EXPBUF
media: blackfin: bfin_capture: set v4l2 buffer sequence

Quoted 4 lines
Quoted 3 lines
 drivers/media/platform/blackfin/bfin_capture.c | 311 ++++++++-----------------
 1 file changed, 99 insertions(+), 212 deletions(-)

Can you ACK the series ? so that its easier for Hans to pick it up.

ping!

Scott, I can't take it unless you Ack it. Actually, I'd like to see a 'Tested-by' tag.

And if you are testing anyway, then I would really like to see the output of 'v4l2-compliance -s', using the v4l2-compliance from the latest v4l-utils.git.

I'm curious to see the results of that.

Regards,

Hans

Quoted 8 lines

Cheers,
--Prabhakar Lad
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#20 lore raw

Hi Hans,

Quoted 31 lines
Quoted 31 lines
Quoted 29 lines · Prabhakar

This patch series, enhances blackfin capture driver with vb2 helpers.

Changes for v2:
--------------
Only patches 5/15 and 8/15 as per Scott's suggestions.

Lad, Prabhakar (15):
media: blackfin: bfin_capture: drop buf_init() callback
media: blackfin: bfin_capture: release buffers in case
start_streaming() call back fails
media: blackfin: bfin_capture: set min_buffers_needed
media: blackfin: bfin_capture: improve buf_prepare() callback
media: blackfin: bfin_capture: improve queue_setup() callback
media: blackfin: bfin_capture: use vb2_fop_mmap/poll
media: blackfin: bfin_capture: use v4l2_fh_open and vb2_fop_release
media: blackfin: bfin_capture: use vb2_ioctl_* helpers
media: blackfin: bfin_capture: make sure all buffers are returned on
stop_streaming() callback
media: blackfin: bfin_capture: return -ENODATA for *std calls
media: blackfin: bfin_capture: return -ENODATA for *dv_timings calls
media: blackfin: bfin_capture: add support for vidioc_create_bufs
media: blackfin: bfin_capture: add support for VB2_DMABUF
media: blackfin: bfin_capture: add support for VIDIOC_EXPBUF
media: blackfin: bfin_capture: set v4l2 buffer sequence

 drivers/media/platform/blackfin/bfin_capture.c | 311 ++++++++-----------------
 1 file changed, 99 insertions(+), 212 deletions(-)
Quoted 7 lines
Quoted 1 line

Can you ACK the series ? so that its easier for Hans to pick it up.

ping!

Scott, I can't take it unless you Ack it. Actually, I'd like to see a 'Tested-by' tag.

One patch has problem, I have modified this patch and tested it.

Quoted 5 lines

And if you are testing anyway, then I would really like to see the output of 'v4l2-compliance -s', using the v4l2-compliance from the latest v4l-utils.git.

I'm curious to see the results of that.

v4l2-utils can't be compiled under uClibc.

#21 lore raw
In reply to Hans Verkuil
Quoted 38 lines · Hans Verkuil
Quoted 30 lines · Prabhakar

Hello Scott,

Quoted 26 lines · Prabhakar

This patch series, enhances blackfin capture driver with vb2 helpers.

Changes for v2:
--------------
Only patches 5/15 and 8/15 as per Scott's suggestions.

Lad, Prabhakar (15):
media: blackfin: bfin_capture: drop buf_init() callback
media: blackfin: bfin_capture: release buffers in case
start_streaming() call back fails
media: blackfin: bfin_capture: set min_buffers_needed
media: blackfin: bfin_capture: improve buf_prepare() callback
media: blackfin: bfin_capture: improve queue_setup() callback
media: blackfin: bfin_capture: use vb2_fop_mmap/poll
media: blackfin: bfin_capture: use v4l2_fh_open and vb2_fop_release
media: blackfin: bfin_capture: use vb2_ioctl_* helpers
media: blackfin: bfin_capture: make sure all buffers are returned on
stop_streaming() callback
media: blackfin: bfin_capture: return -ENODATA for *std calls
media: blackfin: bfin_capture: return -ENODATA for *dv_timings calls
media: blackfin: bfin_capture: add support for vidioc_create_bufs
media: blackfin: bfin_capture: add support for VB2_DMABUF
media: blackfin: bfin_capture: add support for VIDIOC_EXPBUF
media: blackfin: bfin_capture: set v4l2 buffer sequence

Quoted 4 lines
Quoted 3 lines
 drivers/media/platform/blackfin/bfin_capture.c | 311 ++++++++-----------------
 1 file changed, 99 insertions(+), 212 deletions(-)

Can you ACK the series ? so that its easier for Hans to pick it up.

ping!

Quoted 7 lines

Scott, I can't take it unless you Ack it. Actually, I'd like to see a 'Tested-by' tag.

And if you are testing anyway, then I would really like to see the output of 'v4l2-compliance -s', using the v4l2-compliance from the latest v4l-utils.git.

I'm curious to see the results of that.

Ping! Again, I need an Ack.

Regards,

Hans

#22 lore raw

Hi Hans

Quoted 42 lines · Hans Verkuil
Quoted 41 lines · Hans Verkuil
Quoted 30 lines · Prabhakar

Hello Scott,

Quoted 26 lines · Prabhakar

This patch series, enhances blackfin capture driver with vb2 helpers.

Changes for v2:
--------------
Only patches 5/15 and 8/15 as per Scott's suggestions.

Lad, Prabhakar (15):
media: blackfin: bfin_capture: drop buf_init() callback
media: blackfin: bfin_capture: release buffers in case
start_streaming() call back fails
media: blackfin: bfin_capture: set min_buffers_needed
media: blackfin: bfin_capture: improve buf_prepare() callback
media: blackfin: bfin_capture: improve queue_setup() callback
media: blackfin: bfin_capture: use vb2_fop_mmap/poll
media: blackfin: bfin_capture: use v4l2_fh_open and vb2_fop_release
media: blackfin: bfin_capture: use vb2_ioctl_* helpers
media: blackfin: bfin_capture: make sure all buffers are returned on
stop_streaming() callback
media: blackfin: bfin_capture: return -ENODATA for *std calls
media: blackfin: bfin_capture: return -ENODATA for *dv_timings calls
media: blackfin: bfin_capture: add support for vidioc_create_bufs
media: blackfin: bfin_capture: add support for VB2_DMABUF
media: blackfin: bfin_capture: add support for VIDIOC_EXPBUF
media: blackfin: bfin_capture: set v4l2 buffer sequence

Quoted 4 lines
Quoted 3 lines
 drivers/media/platform/blackfin/bfin_capture.c | 311 ++++++++-----------------
 1 file changed, 99 insertions(+), 212 deletions(-)

Can you ACK the series ? so that its easier for Hans to pick it up.

ping!

Scott, I can't take it unless you Ack it. Actually, I'd like to see a 'Tested-by' tag.

Quoted 7 lines
Quoted 4 lines

And if you are testing anyway, then I would really like to see the output of 'v4l2-compliance -s', using the v4l2-compliance from the latest v4l-utils.git.

I'm curious to see the results of that.

Ping! Again, I need an Ack.

Oops I need to respin fixing one of the patch.

Cheers,
--Prabhakar Lad