All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/4] [media] em28xx: Fix vidioc fmt vid cap v4l2 compliance
@ 2013-07-16 23:06 Alban Browaeys
  2013-07-18  2:07 ` Devin Heitmueller
  2013-07-26 13:25 ` Hans Verkuil
  0 siblings, 2 replies; 4+ messages in thread
From: Alban Browaeys @ 2013-07-16 23:06 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: linux-kernel, Alban Browaeys

Set fmt.pix.priv to zero in vidioc_g_fmt_vid_cap
 and vidioc_try_fmt_vid_cap.

Catched by v4l2-compliance.

Signed-off-by: Alban Browaeys <prahal@yahoo.com>
---
 drivers/media/usb/em28xx/em28xx-video.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 1a577ed..42930a4 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -943,6 +943,8 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
 	else
 		f->fmt.pix.field = dev->interlaced ?
 			   V4L2_FIELD_INTERLACED : V4L2_FIELD_TOP;
+	f->fmt.pix.priv = 0;
+
 	return 0;
 }
 
@@ -1008,6 +1010,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
 	else
 		f->fmt.pix.field = dev->interlaced ?
 			   V4L2_FIELD_INTERLACED : V4L2_FIELD_TOP;
+	f->fmt.pix.priv = 0;
 
 	return 0;
 }
-- 
1.8.3.2


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

* Re: [PATCH 4/4] [media] em28xx: Fix vidioc fmt vid cap v4l2 compliance
  2013-07-16 23:06 [PATCH 4/4] [media] em28xx: Fix vidioc fmt vid cap v4l2 compliance Alban Browaeys
@ 2013-07-18  2:07 ` Devin Heitmueller
  2013-07-18  8:05   ` Hans Verkuil
  2013-07-26 13:25 ` Hans Verkuil
  1 sibling, 1 reply; 4+ messages in thread
From: Devin Heitmueller @ 2013-07-18  2:07 UTC (permalink / raw)
  To: Alban Browaeys, Hans Verkuil
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, Alban Browaeys

On Tue, Jul 16, 2013 at 7:06 PM, Alban Browaeys
<alban.browaeys@gmail.com> wrote:
> Set fmt.pix.priv to zero in vidioc_g_fmt_vid_cap
>  and vidioc_try_fmt_vid_cap.

Any reason not to have the v4l2 core do this before dispatching to the
driver?  Set it to zero before the core calls g_fmt.  This avoids all
the drivers (most of which don't use the field) from having to set the
value themselves.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com

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

* Re: [PATCH 4/4] [media] em28xx: Fix vidioc fmt vid cap v4l2 compliance
  2013-07-18  2:07 ` Devin Heitmueller
@ 2013-07-18  8:05   ` Hans Verkuil
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Verkuil @ 2013-07-18  8:05 UTC (permalink / raw)
  To: Devin Heitmueller
  Cc: Alban Browaeys, Mauro Carvalho Chehab, linux-media, linux-kernel,
	Alban Browaeys

On Thu 18 July 2013 04:07:51 Devin Heitmueller wrote:
> On Tue, Jul 16, 2013 at 7:06 PM, Alban Browaeys
> <alban.browaeys@gmail.com> wrote:
> > Set fmt.pix.priv to zero in vidioc_g_fmt_vid_cap
> >  and vidioc_try_fmt_vid_cap.
> 
> Any reason not to have the v4l2 core do this before dispatching to the
> driver?  Set it to zero before the core calls g_fmt.  This avoids all
> the drivers (most of which don't use the field) from having to set the
> value themselves.

There is still one driver (sn9c102) that's (ab)using it. Although perhaps I
should take a look at it and fix it.

Note that priv only needs to be cleared for try/s_fmt. g_fmt does clear it
already in the core before handing it over to the driver.

That said, I am undecided whether to put this in the core. We might actually
start to use this field for something useful in the future. By having drivers
clear it explicitly it will be easier to do that.

Regards,

	Hans

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

* Re: [PATCH 4/4] [media] em28xx: Fix vidioc fmt vid cap v4l2 compliance
  2013-07-16 23:06 [PATCH 4/4] [media] em28xx: Fix vidioc fmt vid cap v4l2 compliance Alban Browaeys
  2013-07-18  2:07 ` Devin Heitmueller
@ 2013-07-26 13:25 ` Hans Verkuil
  1 sibling, 0 replies; 4+ messages in thread
From: Hans Verkuil @ 2013-07-26 13:25 UTC (permalink / raw)
  To: Alban Browaeys
  Cc: Mauro Carvalho Chehab, linux-media, linux-kernel, Alban Browaeys

The change to g_fmt_vid_cap isn't necessary as that's automatically cleared.
Only the s_fmt_vid_cap change is needed. I'll drop the first chunk and accept the
second.

Thanks,

	Hans

On 07/17/2013 01:06 AM, Alban Browaeys wrote:
> Set fmt.pix.priv to zero in vidioc_g_fmt_vid_cap
>  and vidioc_try_fmt_vid_cap.
> 
> Catched by v4l2-compliance.
> 
> Signed-off-by: Alban Browaeys <prahal@yahoo.com>
> ---
>  drivers/media/usb/em28xx/em28xx-video.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
> index 1a577ed..42930a4 100644
> --- a/drivers/media/usb/em28xx/em28xx-video.c
> +++ b/drivers/media/usb/em28xx/em28xx-video.c
> @@ -943,6 +943,8 @@ static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
>  	else
>  		f->fmt.pix.field = dev->interlaced ?
>  			   V4L2_FIELD_INTERLACED : V4L2_FIELD_TOP;
> +	f->fmt.pix.priv = 0;
> +
>  	return 0;
>  }
>  
> @@ -1008,6 +1010,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
>  	else
>  		f->fmt.pix.field = dev->interlaced ?
>  			   V4L2_FIELD_INTERLACED : V4L2_FIELD_TOP;
> +	f->fmt.pix.priv = 0;
>  
>  	return 0;
>  }
> 

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

end of thread, other threads:[~2013-07-26 13:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-16 23:06 [PATCH 4/4] [media] em28xx: Fix vidioc fmt vid cap v4l2 compliance Alban Browaeys
2013-07-18  2:07 ` Devin Heitmueller
2013-07-18  8:05   ` Hans Verkuil
2013-07-26 13:25 ` 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.