<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/include/media/videobuf-core.h, branch v2.6.32.58</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>V4L/DVB (10908): videobuf-core: also needs a minimal subset of V4L1 header</title>
<updated>2009-03-30T15:43:19+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@redhat.com</email>
</author>
<published>2009-03-10T21:30:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5e585ef15b3633e1b0c022aa14bc88587827acd3'/>
<id>5e585ef15b3633e1b0c022aa14bc88587827acd3</id>
<content type='text'>
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix a deadlock in the bttv driver</title>
<updated>2008-05-20T17:12:26+00:00</updated>
<author>
<name>Arjan van de Ven</name>
<email>arjan@linux.intel.com</email>
</author>
<published>2008-05-20T16:53:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=81b2dbcad86732ffc02bad87aa25c4651199fc77'/>
<id>81b2dbcad86732ffc02bad87aa25c4651199fc77</id>
<content type='text'>
vidiocgmbuf() does this:
        mutex_lock(&amp;fh-&gt;cap.vb_lock);
        retval = videobuf_mmap_setup(&amp;fh-&gt;cap, gbuffers, gbufsize,
                                     V4L2_MEMORY_MMAP);

and videobuf_mmap_setup() then just does
        mutex_lock(&amp;q-&gt;vb_lock);
        ret = __videobuf_mmap_setup(q, bcount, bsize, memory);
        mutex_unlock(&amp;q-&gt;vb_lock);

which is an obvious double-take deadlock.

This patch fixes this by having vidiocgmbuf() just call the
__videobuf_mmap_setup function instead.

Acked-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
Reported-by: Koos Vriezen &lt;koos.vriezen@gmail.com&gt;
Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
vidiocgmbuf() does this:
        mutex_lock(&amp;fh-&gt;cap.vb_lock);
        retval = videobuf_mmap_setup(&amp;fh-&gt;cap, gbuffers, gbufsize,
                                     V4L2_MEMORY_MMAP);

and videobuf_mmap_setup() then just does
        mutex_lock(&amp;q-&gt;vb_lock);
        ret = __videobuf_mmap_setup(q, bcount, bsize, memory);
        mutex_unlock(&amp;q-&gt;vb_lock);

which is an obvious double-take deadlock.

This patch fixes this by having vidiocgmbuf() just call the
__videobuf_mmap_setup function instead.

Acked-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
Reported-by: Koos Vriezen &lt;koos.vriezen@gmail.com&gt;
Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>V4L/DVB (7566): videobuf-dvb: allow its usage with videobuf-vmalloc</title>
<updated>2008-04-24T17:09:39+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@infradead.org</email>
</author>
<published>2008-04-13T18:10:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=59d3448995a4c0ca98cbe82f6dac9460323377c1'/>
<id>59d3448995a4c0ca98cbe82f6dac9460323377c1</id>
<content type='text'>
videobuf-dvb were still using a function that were videobuf-dma-sg
dependent. This patch creates a generic handler for this function. This
way, videobuf-dvb can now work with all videobuf implementations.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
videobuf-dvb were still using a function that were videobuf-dma-sg
dependent. This patch creates a generic handler for this function. This
way, videobuf-dvb can now work with all videobuf implementations.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>V4L/DVB (7493): videobuf: Avoid deadlock with QBUF and bring up to spec for empty queue</title>
<updated>2008-04-24T17:07:57+00:00</updated>
<author>
<name>Brandon Philips</name>
<email>brandon@ifup.org</email>
</author>
<published>2008-04-02T21:10:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=137d1cb19d9da163ce6cb57a6fa1e6a3468af6a4'/>
<id>137d1cb19d9da163ce6cb57a6fa1e6a3468af6a4</id>
<content type='text'>
Add a waitqueue to wait on when there are no buffers in the buffer queue.
DQBUF waits on this queue without holding vb_lock to allow a QBUF to happen.
Once a buffer has been queued we recheck that the queue is still streaming and
wait on the new buffer's waitqueue while holding the vb_lock.  The driver
should come along in a timely manner and put the buffer into its next state
finishing the DQBUF.

By implementing this waitqueue it also brings the videobuf DQBUF up to spec and
it now blocks on O_NONBLOCK even when no buffers have been queued via QBUF:

"By default VIDIOC_DQBUF blocks when no buffer is in the outgoing queue."
 - V4L2 spec

Signed-off-by: Brandon Philips &lt;bphilips@suse.de&gt;
CC: Trent Piepho &lt;xyzzy@speakeasy.org&gt;
CC: Carl Karsten &lt;carl@personnelware.com&gt;
CC: Jonathan Corbet &lt;corbet@lwn.net&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a waitqueue to wait on when there are no buffers in the buffer queue.
DQBUF waits on this queue without holding vb_lock to allow a QBUF to happen.
Once a buffer has been queued we recheck that the queue is still streaming and
wait on the new buffer's waitqueue while holding the vb_lock.  The driver
should come along in a timely manner and put the buffer into its next state
finishing the DQBUF.

By implementing this waitqueue it also brings the videobuf DQBUF up to spec and
it now blocks on O_NONBLOCK even when no buffers have been queued via QBUF:

"By default VIDIOC_DQBUF blocks when no buffer is in the outgoing queue."
 - V4L2 spec

Signed-off-by: Brandon Philips &lt;bphilips@suse.de&gt;
CC: Trent Piepho &lt;xyzzy@speakeasy.org&gt;
CC: Carl Karsten &lt;carl@personnelware.com&gt;
CC: Jonathan Corbet &lt;corbet@lwn.net&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>V4L/DVB (7376): Improve compile-time type-checking in videobuf</title>
<updated>2008-04-24T17:07:51+00:00</updated>
<author>
<name>Guennadi Liakhovetski</name>
<email>g.liakhovetski@pengutronix.de</email>
</author>
<published>2008-04-22T17:46:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e9bcf6675d6da1a1e9925b2bdfc21f8d2330a1c5'/>
<id>e9bcf6675d6da1a1e9925b2bdfc21f8d2330a1c5</id>
<content type='text'>
Make the dev member of the struct videobuf_queue of type "struct device *"
to avoid future problems. Also change the prototype of the
videobuf_queue_core_init() function.

Signed-off-by: Guennadi Liakhovetski &lt;g.liakhovetski@pengutronix.de&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make the dev member of the struct videobuf_queue of type "struct device *"
to avoid future problems. Also change the prototype of the
videobuf_queue_core_init() function.

Signed-off-by: Guennadi Liakhovetski &lt;g.liakhovetski@pengutronix.de&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>V4L/DVB (7121): Renames videobuf lock to vb_lock</title>
<updated>2008-02-18T14:15:12+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@infradead.org</email>
</author>
<published>2008-01-31T16:57:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=64f9477f95bf5d4ba49dc3988d47a15bc06bb5da'/>
<id>64f9477f95bf5d4ba49dc3988d47a15bc06bb5da</id>
<content type='text'>
This helps to identify where vb_lock is being used, and find missusages of the
locks.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This helps to identify where vb_lock is being used, and find missusages of the
locks.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>V4L/DVB (6997): Replace a very dirty hack on videobuf for a clean wait_event</title>
<updated>2008-01-25T21:04:46+00:00</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab@infradead.org</email>
</author>
<published>2008-01-10T10:33:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d05051c82e0e8ff748e9c9a06a061bda3ad656e5'/>
<id>d05051c82e0e8ff748e9c9a06a061bda3ad656e5</id>
<content type='text'>
In order to videobuf_iolock to work, mmap_mapper should be called first.
Otherwise, an OOPS is generated.

On some cases, .mmap file handler used to took some time to be called. On those
situations, mmap_mmapper() were called after iolock.

This patch properly waits for mmap_mapper to be called, otherwise generating an
error.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In order to videobuf_iolock to work, mmap_mapper should be called first.
Otherwise, an OOPS is generated.

On some cases, .mmap file handler used to took some time to be called. On those
situations, mmap_mmapper() were called after iolock.

This patch properly waits for mmap_mapper to be called, otherwise generating an
error.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>V4L/DVB (6603): V4L: videobuf: convert streaming and reading to bitfields</title>
<updated>2008-01-25T21:02:11+00:00</updated>
<author>
<name>Brandon Philips</name>
<email>brandon@ifup.org</email>
</author>
<published>2007-11-06T23:23:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d6964aa8d4a418d69da1652121940fabc6b5d591'/>
<id>d6964aa8d4a418d69da1652121940fabc6b5d591</id>
<content type='text'>
Signed-off-by: Brandon Philips &lt;bphilips@suse.de&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Brandon Philips &lt;bphilips@suse.de&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>V4L/DVB (6600): V4L: videobuf: don't chew up namespace STATE_.*, convert to VIDEOBUF_</title>
<updated>2008-01-25T21:02:11+00:00</updated>
<author>
<name>Brandon Philips</name>
<email>brandon@ifup.org</email>
</author>
<published>2007-11-06T23:02:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0fc0686e64d21a6abded96af2b1a895dfa8b2530'/>
<id>0fc0686e64d21a6abded96af2b1a895dfa8b2530</id>
<content type='text'>
s/STATE_NEEDS_INIT/VIDEOBUF_NEEDS_INIT/g
s/STATE_PREPARED/VIDEOBUF_PREPARED/g
s/STATE_QUEUED/VIDEOBUF_QUEUED/g
s/STATE_ACTIVE/VIDEOBUF_ACTIVE/g
s/STATE_DONE/VIDEOBUF_DONE/g
s/STATE_ERROR/VIDEOBUF_ERROR/g
s/STATE_IDLE/VIDEOBUF_IDLE/g

Signed-off-by: Brandon Philips &lt;bphilips@suse.de&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
s/STATE_NEEDS_INIT/VIDEOBUF_NEEDS_INIT/g
s/STATE_PREPARED/VIDEOBUF_PREPARED/g
s/STATE_QUEUED/VIDEOBUF_QUEUED/g
s/STATE_ACTIVE/VIDEOBUF_ACTIVE/g
s/STATE_DONE/VIDEOBUF_DONE/g
s/STATE_ERROR/VIDEOBUF_ERROR/g
s/STATE_IDLE/VIDEOBUF_IDLE/g

Signed-off-by: Brandon Philips &lt;bphilips@suse.de&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>V4L/DVB (6601): V4L: videobuf-core locking fixes and comments</title>
<updated>2007-12-11T20:08:08+00:00</updated>
<author>
<name>Brandon Philips</name>
<email>brandon@ifup.org</email>
</author>
<published>2007-11-13T23:05:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=19bc5133dae9562e8824ef101464061f9854c1d8'/>
<id>19bc5133dae9562e8824ef101464061f9854c1d8</id>
<content type='text'>
- Add comments to functions that require that caller hold q-&gt;lock
- Add __videobuf_mmap_free that doesn't hold q-&gt;lock for use within videobuf
- Add locking to videobuf_mmap_free
- Fix linux/drivers/media/common/saa7146_video.c which was holding lock around
  videobuf_read_stop
- Add locking to functions that operate on a queue
- Add videobuf_stop to take care of stopping in both the read and stream case

TODO: bttv still has an unsafe call to videobuf_queue_is_busy

Signed-off-by: Brandon Philips &lt;bphilips@suse.de&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Add comments to functions that require that caller hold q-&gt;lock
- Add __videobuf_mmap_free that doesn't hold q-&gt;lock for use within videobuf
- Add locking to videobuf_mmap_free
- Fix linux/drivers/media/common/saa7146_video.c which was holding lock around
  videobuf_read_stop
- Add locking to functions that operate on a queue
- Add videobuf_stop to take care of stopping in both the read and stream case

TODO: bttv still has an unsafe call to videobuf_queue_is_busy

Signed-off-by: Brandon Philips &lt;bphilips@suse.de&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@infradead.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
