Skip to contentSkip to conversation

media: fsl-viu: fix support for streaming with mmap method

PATCH New Anatolij Gustschin 1 participant 1 message Dec 17, 2010 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: fsl-viu: fix support for streaming with mmap method

Streaming using mmap didn't work in the VIU driver. We need to start/stop DMA in streamon/streamoff and free the buffers on release. Add appropriate driver extension now.

---
 drivers/media/video/fsl-viu.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/media/video/fsl-viu.c +5 -0
index c9eb161..483a5ed 100644
@@ -917,6 +917,8 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
 	if (fh->type != i)
 		return -EINVAL;
 
+	viu_start_dma(fh->dev);
+
 	return videobuf_streamon(&fh->vb_vidq);
 }
 
@@ -929,6 +931,8 @@ static int vidioc_streamoff(struct file *file, void *priv, enum v4l2_buf_type i)
 	if (fh->type != i)
 		return -EINVAL;
 
+	viu_stop_dma(fh->dev);
+
 	return videobuf_streamoff(&fh->vb_vidq);
 }
 
@@ -1350,6 +1354,7 @@ static int viu_release(struct file *file)
 
 	viu_stop_dma(dev);
 	videobuf_stop(&fh->vb_vidq);
+	videobuf_mmap_free(&fh->vb_vidq);
 
 	kfree(fh);
 
Signature · 1 line
1.7.1