All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [media] stk1160: Check *nplanes in queue_setup
@ 2016-05-10  3:06 Helen Koike
  2016-05-10  6:29 ` Hans Verkuil
  0 siblings, 1 reply; 2+ messages in thread
From: Helen Koike @ 2016-05-10  3:06 UTC (permalink / raw)
  To: linux-media, ezequiel, hans.verkuil, mchehab; +Cc: Helen Koike

If *nplanes is not zero, it should use the requested size if valid

Signed-off-by: Helen Koike <helen.koike@collabora.co.uk>
---
 drivers/media/usb/stk1160/stk1160-v4l.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c
index 77131fd..7ddbc02 100644
--- a/drivers/media/usb/stk1160/stk1160-v4l.c
+++ b/drivers/media/usb/stk1160/stk1160-v4l.c
@@ -680,6 +680,9 @@ static int queue_setup(struct vb2_queue *vq,
 	*nbuffers = clamp_t(unsigned int, *nbuffers,
 			STK1160_MIN_VIDEO_BUFFERS, STK1160_MAX_VIDEO_BUFFERS);
 
+	if (*nplanes)
+		return sizes[0] < size ? -EINVAL : 0;
+
 	/* This means a packed colorformat */
 	*nplanes = 1;
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [media] stk1160: Check *nplanes in queue_setup
  2016-05-10  3:06 [PATCH] [media] stk1160: Check *nplanes in queue_setup Helen Koike
@ 2016-05-10  6:29 ` Hans Verkuil
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Verkuil @ 2016-05-10  6:29 UTC (permalink / raw)
  To: Helen Koike, linux-media, ezequiel, hans.verkuil, mchehab

On 05/10/2016 05:06 AM, Helen Koike wrote:
> If *nplanes is not zero, it should use the requested size if valid

*nplanes is never 0 since the create_buffers ioctl isn't implemented in
this driver.

Adding support for it (simply use vb2_create_buffers) would make sense.

Regards,

	Hans

> 
> Signed-off-by: Helen Koike <helen.koike@collabora.co.uk>
> ---
>  drivers/media/usb/stk1160/stk1160-v4l.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c
> index 77131fd..7ddbc02 100644
> --- a/drivers/media/usb/stk1160/stk1160-v4l.c
> +++ b/drivers/media/usb/stk1160/stk1160-v4l.c
> @@ -680,6 +680,9 @@ static int queue_setup(struct vb2_queue *vq,
>  	*nbuffers = clamp_t(unsigned int, *nbuffers,
>  			STK1160_MIN_VIDEO_BUFFERS, STK1160_MAX_VIDEO_BUFFERS);
>  
> +	if (*nplanes)
> +		return sizes[0] < size ? -EINVAL : 0;
> +
>  	/* This means a packed colorformat */
>  	*nplanes = 1;
>  
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-10  6:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-10  3:06 [PATCH] [media] stk1160: Check *nplanes in queue_setup Helen Koike
2016-05-10  6:29 ` Hans Verkuil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.