public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix bug in au0828 VBI streaming
@ 2011-01-23 22:12 Devin Heitmueller
  2011-02-02 13:58 ` [PATCH RESEND] " Devin Heitmueller
  0 siblings, 1 reply; 4+ messages in thread
From: Devin Heitmueller @ 2011-01-23 22:12 UTC (permalink / raw)
  To: Linux Media Mailing List

[-- Attachment #1: Type: text/plain, Size: 337 bytes --]

Attached is a patch for a V4L2 spec violation with regards to the
au0828 not working in streaming mode.

This was just an oversight on my part when I did the original VBI
support for this bridge, as libzvbi was silently falling back to using
the read() interface.

Devin

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

[-- Attachment #2: au0828_vbi_streaming.patch --]
[-- Type: text/x-patch, Size: 2201 bytes --]

au0828: fix VBI handling when in V4L2 streaming mode

From: Devin Heitmueller <dheitmueller@kernellabs.com>

It turns up V4L2 streaming mode (a.k.a mmap) was broken for VBI streaming.
This was causing libzvbi to fall back to V4L1 capture mode, and is a blatent
violation of the V4L2 specification.

Make the implementation work properly in this mode.

Priority: high

Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> 

--- media_build/linux/drivers/media/video/au0828/au0828-video.c	2011-01-10 10:24:45.000000000 -0500
+++ media_build_950qfixes//linux/drivers/media/video/au0828/au0828-video.c	2011-01-23 17:05:08.461107569 -0500
@@ -1758,7 +1758,12 @@
 	if (rc < 0)
 		return rc;
 
-	return videobuf_reqbufs(&fh->vb_vidq, rb);
+	if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
+		rc = videobuf_reqbufs(&fh->vb_vidq, rb);
+	else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE)
+		rc = videobuf_reqbufs(&fh->vb_vbiq, rb);
+
+	return rc;
 }
 
 static int vidioc_querybuf(struct file *file, void *priv,
@@ -1772,7 +1777,12 @@
 	if (rc < 0)
 		return rc;
 
-	return videobuf_querybuf(&fh->vb_vidq, b);
+	if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
+		rc = videobuf_querybuf(&fh->vb_vidq, b);
+	else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE)
+		rc = videobuf_querybuf(&fh->vb_vbiq, b);
+
+	return rc;
 }
 
 static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *b)
@@ -1785,7 +1795,12 @@
 	if (rc < 0)
 		return rc;
 
-	return videobuf_qbuf(&fh->vb_vidq, b);
+	if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
+		rc = videobuf_qbuf(&fh->vb_vidq, b);
+	else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE)
+		rc = videobuf_qbuf(&fh->vb_vbiq, b);
+
+	return rc;
 }
 
 static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b)
@@ -1806,7 +1821,12 @@
 		dev->greenscreen_detected = 0;
 	}
 
-	return videobuf_dqbuf(&fh->vb_vidq, b, file->f_flags & O_NONBLOCK);
+	if (fh->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
+		rc = videobuf_dqbuf(&fh->vb_vidq, b, file->f_flags & O_NONBLOCK);
+	else if (fh->type == V4L2_BUF_TYPE_VBI_CAPTURE)
+		rc = videobuf_dqbuf(&fh->vb_vbiq, b, file->f_flags & O_NONBLOCK);
+
+	return rc;
 }
 
 static struct v4l2_file_operations au0828_v4l_fops = {

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

* [PATCH RESEND] Fix bug in au0828 VBI streaming
  2011-01-23 22:12 [PATCH] Fix bug in au0828 VBI streaming Devin Heitmueller
@ 2011-02-02 13:58 ` Devin Heitmueller
  2011-02-03 23:38   ` Devin Heitmueller
  0 siblings, 1 reply; 4+ messages in thread
From: Devin Heitmueller @ 2011-02-02 13:58 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

On Sun, Jan 23, 2011 at 5:12 PM, Devin Heitmueller
<dheitmueller@kernellabs.com> wrote:
> Attached is a patch for a V4L2 spec violation with regards to the
> au0828 not working in streaming mode.
>
> This was just an oversight on my part when I did the original VBI
> support for this bridge, as libzvbi was silently falling back to using
> the read() interface.

Mauro,

Where are we at with this patch.  It's trivial and VBI is broken in
V4L2 streaming mode without it.

Devin

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

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

* Re: [PATCH RESEND] Fix bug in au0828 VBI streaming
  2011-02-02 13:58 ` [PATCH RESEND] " Devin Heitmueller
@ 2011-02-03 23:38   ` Devin Heitmueller
  2011-02-04  0:03     ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 4+ messages in thread
From: Devin Heitmueller @ 2011-02-03 23:38 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

On Wed, Feb 2, 2011 at 8:58 AM, Devin Heitmueller
<dheitmueller@kernellabs.com> wrote:
> On Sun, Jan 23, 2011 at 5:12 PM, Devin Heitmueller
> <dheitmueller@kernellabs.com> wrote:
>> Attached is a patch for a V4L2 spec violation with regards to the
>> au0828 not working in streaming mode.
>>
>> This was just an oversight on my part when I did the original VBI
>> support for this bridge, as libzvbi was silently falling back to using
>> the read() interface.
>
> Mauro,
>
> Where are we at with this patch.  It's trivial and VBI is broken in
> V4L2 streaming mode without it.

Mauro,

I see this has been committed for 2.6.39.  Given the trivial nature,
can we get it in there for 2.6.38 as well?  It's a bugfix and the
au0828 VBI support is new to 2.6.38.  If it doesn't go in, then the
VBI support will be present but broken for a full release cycle.  This
could definitely cause problems for existing applications that now
detect the presence of VBI support, but then break when they try to
use it.

Devin

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

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

* Re: [PATCH RESEND] Fix bug in au0828 VBI streaming
  2011-02-03 23:38   ` Devin Heitmueller
@ 2011-02-04  0:03     ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 4+ messages in thread
From: Mauro Carvalho Chehab @ 2011-02-04  0:03 UTC (permalink / raw)
  To: Devin Heitmueller; +Cc: Linux Media Mailing List

Em 03-02-2011 21:38, Devin Heitmueller escreveu:
> On Wed, Feb 2, 2011 at 8:58 AM, Devin Heitmueller
> <dheitmueller@kernellabs.com> wrote:
>> On Sun, Jan 23, 2011 at 5:12 PM, Devin Heitmueller
>> <dheitmueller@kernellabs.com> wrote:
>>> Attached is a patch for a V4L2 spec violation with regards to the
>>> au0828 not working in streaming mode.
>>>
>>> This was just an oversight on my part when I did the original VBI
>>> support for this bridge, as libzvbi was silently falling back to using
>>> the read() interface.
>>
>> Mauro,
>>
>> Where are we at with this patch.  It's trivial and VBI is broken in
>> V4L2 streaming mode without it.
> 
> Mauro,
> 
> I see this has been committed for 2.6.39.  Given the trivial nature,
> can we get it in there for 2.6.38 as well?  It's a bugfix and the
> au0828 VBI support is new to 2.6.38.  If it doesn't go in, then the
> VBI support will be present but broken for a full release cycle.  This
> could definitely cause problems for existing applications that now
> detect the presence of VBI support, but then break when they try to
> use it.

It is already on my local fixes tree. I'll be sending upstream together
with the next set of fixes.

Cheers,
Mauro

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

end of thread, other threads:[~2011-02-04  0:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-23 22:12 [PATCH] Fix bug in au0828 VBI streaming Devin Heitmueller
2011-02-02 13:58 ` [PATCH RESEND] " Devin Heitmueller
2011-02-03 23:38   ` Devin Heitmueller
2011-02-04  0:03     ` Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox