<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/media/v4l2-dev.h, branch v3.16.1</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.16.1</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.16.1'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2014-03-05T17:14:59Z</updated>
<entry>
<title>[media] v4l: add device type for Software Defined Radio</title>
<updated>2014-03-05T17:14:59Z</updated>
<author>
<name>Antti Palosaari</name>
<email>crope@iki.fi</email>
</author>
<published>2013-12-11T23:03:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d42626bda4629ed9ad2ebcf44a7fece0777caa58'/>
<id>urn:sha1:d42626bda4629ed9ad2ebcf44a7fece0777caa58</id>
<content type='text'>
Add new V4L device type VFL_TYPE_SDR for Software Defined Radio.
It is registered as /dev/swradio0 (/dev/sdr0 was already reserved).

Signed-off-by: Antti Palosaari &lt;crope@iki.fi&gt;
Acked-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;m.chehab@samsung.com&gt;
</content>
</entry>
<entry>
<title>[media] v4l2: always require v4l2_dev, rename parent to dev_parent</title>
<updated>2013-06-21T14:07:12Z</updated>
<author>
<name>Hans Verkuil</name>
<email>hans.verkuil@cisco.com</email>
</author>
<published>2013-06-12T14:15:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1c1d86a1ea07506c070cfb217a009d53990bdeb0'/>
<id>urn:sha1:1c1d86a1ea07506c070cfb217a009d53990bdeb0</id>
<content type='text'>
The last set of drivers still using the parent field of video_device instead
of the v4l2_dev field have been converted, so v4l2_dev is now always set.
A proper pointer to v4l2_dev is necessary these days otherwise the advanced
debugging ioctls will not work when addressing sub-devices. It also ensures
that the core can always go from a video_device struct to the top-level
v4l2_device struct.
There is still one single use case for the parent pointer: if there are
multiple busses, each being the parent of one or more video nodes, and if
they all share the same v4l2_device struct. In that case one still needs a
parent pointer since the v4l2_device struct can only refer to a single
parent device. The cx88 driver is one such case. Unfortunately, the cx88
failed to set the parent pointer since 3.6. The next patch will correct this.
In order to support this use-case the parent pointer is only renamed to
dev_parent, not removed altogether. It has been renamed to ensure that the
compiler will catch any (possibly out-of-tree) drivers that were missed during
the conversion.

Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Acked-by: Sakari Ailus &lt;sakari.ailus@iki.fi&gt;
Acked-by: Laurent Pinchart &lt;laurent.pinchart@ideasonboard.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
</entry>
<entry>
<title>[media] v4l2: remove deprecated current_norm support completely</title>
<updated>2013-06-17T12:39:53Z</updated>
<author>
<name>Hans Verkuil</name>
<email>hans.verkuil@cisco.com</email>
</author>
<published>2013-06-03T08:36:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ca37157506ef53dcf41132aaedab70659509ccee'/>
<id>urn:sha1:ca37157506ef53dcf41132aaedab70659509ccee</id>
<content type='text'>
The use of current_norm to keep track of the current standard has been
deprecated for quite some time. Now that all drivers that were using it
have been converted to use g_std we can drop it from the core.
It was a bad idea to introduce this at the time: since it is a per-device
node field it didn't work for drivers that create multiple nodes, all sharing
the same tuner (e.g. video and vbi nodes, or a raw video node and a compressed
video node). In addition it was very surprising behavior that g_std was
implemented in the core. Often drivers implemented both g_std and current_norm,
because they didn't understand how it should be used.
Since the benefits were very limited (if they were there at all), it is better
to just drop it and require that drivers just implement g_std.

Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
</entry>
<entry>
<title>[media] v4l2-dev: add new VFL_DIR_ defines</title>
<updated>2012-09-26T14:03:53Z</updated>
<author>
<name>Hans Verkuil</name>
<email>hans.verkuil@cisco.com</email>
</author>
<published>2012-09-05T08:33:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5c77879ff9ab9e7dd5b4a78666a09af1a8854be9'/>
<id>urn:sha1:5c77879ff9ab9e7dd5b4a78666a09af1a8854be9</id>
<content type='text'>
These will be used by v4l2-dev.c to improve ioctl checking.
I.e. ioctls for capture should return -ENOTTY when called for
an output device.

Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
</entry>
<entry>
<title>[media] v4l2-dev: remove V4L2_FL_LOCK_ALL_FOPS</title>
<updated>2012-08-09T23:18:16Z</updated>
<author>
<name>Hans Verkuil</name>
<email>hans.verkuil@cisco.com</email>
</author>
<published>2012-07-31T07:02:25Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=cf5337358548b813479b58478539fc20ee86556c'/>
<id>urn:sha1:cf5337358548b813479b58478539fc20ee86556c</id>
<content type='text'>
All drivers that needed V4L2_FL_LOCK_ALL_FOPS have been converted,
so remove this flag altogether.

Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
</entry>
<entry>
<title>[media] v4l2-dev/ioctl.c: add vb2_queue support to video_device</title>
<updated>2012-07-06T20:30:54Z</updated>
<author>
<name>Hans Verkuil</name>
<email>hans.verkuil@cisco.com</email>
</author>
<published>2012-06-22T10:29:35Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5a5adf6b669cf1a3dd2af419cd68a4c491f384a3'/>
<id>urn:sha1:5a5adf6b669cf1a3dd2af419cd68a4c491f384a3</id>
<content type='text'>
This prepares struct video_device for easier integration with vb2.

It also introduces a new lock that protects the vb2_queue. It is up
to the driver to use it or not. And the driver can associate an owner
filehandle with the queue to check whether queuing requests are
permitted for the calling filehandle.

Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
</entry>
<entry>
<title>[media] v4l2-dev: rename two functions</title>
<updated>2012-05-14T18:06:50Z</updated>
<author>
<name>Hans Verkuil</name>
<email>hans.verkuil@cisco.com</email>
</author>
<published>2012-05-14T14:32:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=152a3a7320d1582009db85d8be365ce430d079af'/>
<id>urn:sha1:152a3a7320d1582009db85d8be365ce430d079af</id>
<content type='text'>
Rename the function v4l2_dont_use_lock to v4l2_disable_ioctl_locking,
and rename v4l2_dont_use_cmd to v4l2_disable_ioctl.

Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
</entry>
<entry>
<title>[media] v4l2-dev.h: add comment not to use V4L2_FL_LOCK_ALL_FOPS in new drivers</title>
<updated>2012-05-14T18:06:25Z</updated>
<author>
<name>Hans Verkuil</name>
<email>hans.verkuil@cisco.com</email>
</author>
<published>2012-05-14T14:28:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=47bd4bc1a2624939c9f4ba154a2c18abe9d6c614'/>
<id>urn:sha1:47bd4bc1a2624939c9f4ba154a2c18abe9d6c614</id>
<content type='text'>
This flag is for legacy drivers only and will go away in the future.

A note regarding commit 5126f2590bee412e3053de851cb07f531e4be36a
(v4l2-dev: add flag to have the core lock all file operations):

That commit message suggests that by not taking the core lock for fops
other than unlocked_ioctl all problems relating to AB-BA locking and
mm-&gt;mmap_sem are solved. This is not the case.

More work needs to be done by moving the core lock further down into
video_ioctl2. It should only be taken after the copy_from/to_user calls
are done.

Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
</entry>
<entry>
<title>[media] v4l2-dev: add flag to have the core lock all file operations</title>
<updated>2012-05-14T12:19:38Z</updated>
<author>
<name>Hans Verkuil</name>
<email>hans.verkuil@cisco.com</email>
</author>
<published>2012-05-10T07:57:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5126f2590bee412e3053de851cb07f531e4be36a'/>
<id>urn:sha1:5126f2590bee412e3053de851cb07f531e4be36a</id>
<content type='text'>
This used to be the default if the lock pointer was set, but now that lock is by
default only used for ioctl serialization. Those drivers that already used
core locking have this flag set explicitly, except for some drivers where
it was obvious that there was no need to serialize any file operations other
than ioctl.

The drivers that didn't need this flag were:

drivers/media/radio/dsbr100.c
drivers/media/radio/radio-isa.c
drivers/media/radio/radio-keene.c
drivers/media/radio/radio-miropcm20.c
drivers/media/radio/radio-mr800.c
drivers/media/radio/radio-tea5764.c
drivers/media/radio/radio-timb.c
drivers/media/video/vivi.c
sound/i2c/other/tea575x-tuner.c

The other drivers that use core locking and where it was not immediately
obvious that this flag wasn't needed were changed so that the flag is set
together with a comment that that driver needs work to avoid having to
set that flag. This will often involve taking the core lock in the fops
themselves.

Eventually this flag should go and it should not be used in new drivers.

There are a few reasons why we want to avoid core locking of non-ioctl
fops: in the case of mmap this can lead to a deadlock in rare situations
since when mmap is called the mmap_sem is held and it is possible for
other parts of the code to take that lock as well (copy_from_user()/copy_to_user()
perform a down_read(&amp;mm-&gt;mmap_sem) when a page fault occurs).

It is very unlikely that that happens since the core lock serializes all
fops, but the kernel warns about it if lock validation is turned on.

For poll it is also undesirable to take the core lock as that can introduce
increased latency. The same is true for read/write.

While it was possible to make flags or something to turn on/off taking the
core lock for each file operation, in practice it is much simpler to just
not take it at all except for ioctl and leave it to the driver to take the
lock. There are only a handful fops compared to the zillion ioctls we have.

I also wanted to make it obvious which drivers still take the lock for all
fops, so that's why I chose to have drivers set it explicitly.

Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Acked-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
</entry>
<entry>
<title>[media] v4l2-dev/ioctl: determine the valid ioctls upfront</title>
<updated>2012-05-14T12:17:28Z</updated>
<author>
<name>Hans Verkuil</name>
<email>hans.verkuil@cisco.com</email>
</author>
<published>2012-05-10T08:36:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=48ea0be06028d97b57602372f032afbec02e7e97'/>
<id>urn:sha1:48ea0be06028d97b57602372f032afbec02e7e97</id>
<content type='text'>
Rather than testing whether an ioctl is implemented in the driver or not
every time the ioctl is called, do it upfront when the device is registered.

This also allows a driver to disable certain ioctls based on the capabilities
of the detected board, something you can't do today without creating separate
v4l2_ioctl_ops structs for each new variation.

For the most part it is pretty straightforward, but for control ioctls a flag
is needed since it is possible that you have per-filehandle controls, and that
can't be determined upfront of course.

Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Acked-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Mauro Carvalho Chehab &lt;mchehab@redhat.com&gt;
</content>
</entry>
</feed>
