diff mbox

[10/15] media: davinci: vpbe: add support for VIDIOC_CREATE_BUFS

Message ID 1413146445-7304-11-git-send-email-prabhakar.csengg@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Prabhakar Oct. 12, 2014, 8:40 p.m. UTC
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
---
 drivers/media/platform/davinci/vpbe_display.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Hans Verkuil Oct. 22, 2014, 11:26 a.m. UTC | #1
Hi Prabhakar,

This patch series looks good, except for this one.

If you add create_bufs support, then you should also update queue_setup.

If the fmt argument to queue_setup is non-NULL, then check that the
fmt.pix.sizeimage field is >= the current format's sizeimage. If not,
return -EINVAL.

This prevents userspace from creating additional buffers that are smaller than
the minimum required size.

I'm just skipping this patch and queuing all the others for 3.19. Just post an
updated version for this one and I'll pick it up later.

Regards,

	Hans

On 10/12/2014 10:40 PM, Lad, Prabhakar wrote:
> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
> ---
>   drivers/media/platform/davinci/vpbe_display.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c
> index c33b77e..fd8d4f0 100644
> --- a/drivers/media/platform/davinci/vpbe_display.c
> +++ b/drivers/media/platform/davinci/vpbe_display.c
> @@ -1260,6 +1260,7 @@ static const struct v4l2_ioctl_ops vpbe_ioctl_ops = {
>   	.vidioc_dqbuf		 = vb2_ioctl_dqbuf,
>   	.vidioc_streamon	 = vb2_ioctl_streamon,
>   	.vidioc_streamoff	 = vb2_ioctl_streamoff,
> +	.vidioc_create_bufs	 = vb2_ioctl_create_bufs,
>
>   	.vidioc_cropcap		 = vpbe_display_cropcap,
>   	.vidioc_g_crop		 = vpbe_display_g_crop,
>
Prabhakar Oct. 22, 2014, 9:48 p.m. UTC | #2
Hi Hans,

On Wed, Oct 22, 2014 at 12:26 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
> Hi Prabhakar,
>
> This patch series looks good, except for this one.
>
> If you add create_bufs support, then you should also update queue_setup.
>
> If the fmt argument to queue_setup is non-NULL, then check that the
> fmt.pix.sizeimage field is >= the current format's sizeimage. If not,
> return -EINVAL.
>
> This prevents userspace from creating additional buffers that are smaller
> than
> the minimum required size.
>
> I'm just skipping this patch and queuing all the others for 3.19. Just post
> an
> updated version for this one and I'll pick it up later.
>
I fixed it and posted the patch. To avoid conflicts I have rebased the patch on
for-v3.19a branch of your tree.

Thanks,
--Prabhakar Lad
diff mbox

Patch

diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c
index c33b77e..fd8d4f0 100644
--- a/drivers/media/platform/davinci/vpbe_display.c
+++ b/drivers/media/platform/davinci/vpbe_display.c
@@ -1260,6 +1260,7 @@  static const struct v4l2_ioctl_ops vpbe_ioctl_ops = {
 	.vidioc_dqbuf		 = vb2_ioctl_dqbuf,
 	.vidioc_streamon	 = vb2_ioctl_streamon,
 	.vidioc_streamoff	 = vb2_ioctl_streamoff,
+	.vidioc_create_bufs	 = vb2_ioctl_create_bufs,
 
 	.vidioc_cropcap		 = vpbe_display_cropcap,
 	.vidioc_g_crop		 = vpbe_display_g_crop,