aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-06-22 04:53:31 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-07-06 16:33:33 -0400
commit2e90c6c38a3a5775cccd728eea74fdacbb29e029 (patch)
treefee4d16808c26a237fa930fdc615201e60e8ff38
parentf2ba5a0b469952328b03e239acacd77858f19fb3 (diff)
[media] vivi: add create_bufs/preparebuf support
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/vivi.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index f6d7c6e3390e..1e8c4f3ab602 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -767,7 +767,13 @@ static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *fmt,
767 struct vivi_dev *dev = vb2_get_drv_priv(vq); 767 struct vivi_dev *dev = vb2_get_drv_priv(vq);
768 unsigned long size; 768 unsigned long size;
769 769
770 size = dev->width * dev->height * dev->pixelsize; 770 if (fmt)
771 size = fmt->fmt.pix.sizeimage;
772 else
773 size = dev->width * dev->height * dev->pixelsize;
774
775 if (size == 0)
776 return -EINVAL;
771 777
772 if (0 == *nbuffers) 778 if (0 == *nbuffers)
773 *nbuffers = 32; 779 *nbuffers = 32;
@@ -1180,6 +1186,8 @@ static const struct v4l2_ioctl_ops vivi_ioctl_ops = {
1180 .vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap, 1186 .vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap,
1181 .vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap, 1187 .vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap,
1182 .vidioc_reqbufs = vb2_ioctl_reqbufs, 1188 .vidioc_reqbufs = vb2_ioctl_reqbufs,
1189 .vidioc_create_bufs = vb2_ioctl_create_bufs,
1190 .vidioc_prepare_buf = vb2_ioctl_prepare_buf,
1183 .vidioc_querybuf = vb2_ioctl_querybuf, 1191 .vidioc_querybuf = vb2_ioctl_querybuf,
1184 .vidioc_qbuf = vb2_ioctl_qbuf, 1192 .vidioc_qbuf = vb2_ioctl_qbuf,
1185 .vidioc_dqbuf = vb2_ioctl_dqbuf, 1193 .vidioc_dqbuf = vb2_ioctl_dqbuf,