History log of /drivers/media/video/v4l2-fh.c
Revision Date Author Comments
35a246363ec41e7b19f7887a97ef3d01ab41356a 01-Aug-2011 Paul Gortmaker <paul.gortmaker@windriver.com> drivers/media: Add export.h for EXPORT_SYMBOL/THIS_MODULE as required

These two macros were in module.h but now module.h is no longer
sprayed across every source file imaginable, so the users need
to expicitly call out their use of them.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
f1e393de382af9b9bd2462a42bfa16b8c501d81b 14-Jun-2011 Hans Verkuil <hans.verkuil@cisco.com> [media] v4l2-event/ctrls/fh: allocate events per fh and per type instead of just per-fh

The driver had to decide how many events to allocate when the v4l2_fh struct
was created. It was possible to add more events afterwards, but there was no
way to ensure that you wouldn't miss important events if the event queue
would fill up for that filehandle.

In addition, once there were no more free events, any new events were simply
dropped on the floor.

For the control event in particular this made life very difficult since
control status/value changes could just be missed if the number of allocated
events and the speed at which the application read events was too low to keep
up with the number of generated events. The application would have no idea
what the latest state was for a control since it could have missed the latest
control change.

So this patch makes some major changes in how events are allocated. Instead
of allocating events per-filehandle they are now allocated when subscribing an
event. So for that particular event type N events (determined by the driver)
are allocated. Those events are reserved for that particular event type.
This ensures that you will not miss events for a particular type altogether.

In addition, if there are N events in use and a new event is raised, then
the oldest event is dropped and the new one is added. So the latest event
is always available.

This can be further improved by adding the ability to merge the state of
two events together, ensuring that no data is lost at all. This will be
added in the next patch.

This also makes it possible to allow the user to determine the number of
events that will be allocated. This is not implemented at the moment, but
would be trivial.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
523f46d6aba9dcb0a2d0fc474ca884e93a7cf198 13-Jun-2011 Hans Verkuil <hans.verkuil@cisco.com> [media] v4l2-events/fh: merge v4l2_events into v4l2_fh

Drivers that supported events used to be rare, but now that controls can also
raise events this will become much more common since almost all drivers have
controls.

This means that keeping struct v4l2_events as a separate struct make no more
sense. Merging it into struct v4l2_fh simplifies things substantially as it
is now an integral part of the filehandle struct.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
6e239399e5807132f86f64af6c659411c6a3d1a5 07-Jun-2011 Hans Verkuil <hans.verkuil@cisco.com> [media] v4l2-ctrls: add control events

Whenever a control changes value or state an event is sent to anyone
that subscribed to it.

This functionality is useful for control panels but also for applications
that need to wait for (usually status) controls to change value.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2d28b686adc18567b388362e1f7b86658cfd81fc 12-Mar-2011 Hans Verkuil <hverkuil@xs4all.nl> [media] v4l2-ioctl: add ctrl_handler to v4l2_fh

This is required to implement control events and is also needed to allow
for per-filehandle control handlers.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
b1a873a37b6551a214ad37d1eee7654a9d65fd6e 22-Mar-2011 Hans Verkuil <hverkuil@xs4all.nl> [media] v4l2: use new flag to enable core priority handling

Rather than guess which driver supports core priority handling, require drivers
that do to explicitly set the V4L2_FL_USE_FH_PRIO flag in video_device.

Updated the core prio handling accordingly and set the flag in the three
drivers that do.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
dfddb2441f39e8c0254504516be35b854addf6fa 08-Jan-2011 Hans Verkuil <hverkuil@xs4all.nl> [media] v4l2-fh: add v4l2_fh_is_singular

Several drivers need to do something when the first filehandle is opened
or the last filehandle is closed. Most implement some use count mechanism,
but if they use v4l2_fh, then you can also just check if this is the only
filehandle for the device node. A simple helper function can do this.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
73cb42068cff419e72456940c713ceb5efa68c2a 08-Jan-2011 Hans Verkuil <hverkuil@xs4all.nl> [media] v4l2-fh: add v4l2_fh_open and v4l2_fh_release helper functions

Add two new functions: v4l2_fh_open allocates and initializes a struct v4l2_fh
based on a struct file pointer and v4l2_fh_release releases and frees a struct
v4l2_fh.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
fc5602be7ca5b55174c5d6595089718779b28dfa 29-Dec-2010 Hans Verkuil <hverkuil@xs4all.nl> [media] v4l2-fh: implement v4l2_priority support

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
d3d7c963562adad92e968df23c425ae964fe9ce2 27-Mar-2010 Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> V4L/DVB: V4L: Events: Support event handling in do_ioctl

Add support for event handling to do_ioctl.

Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
c3b5b0241f620a356c97d8f43343e721c718806d 01-Mar-2010 Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> V4L/DVB: V4L: Events: Add backend

Add event handling backend to V4L2. The backend handles event subscription
and delivery to file handles. Event subscriptions are based on file handle.
Events may be delivered to all subscribed file handles on a device
independent of where they originate from.

Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
1babcb460f2b87c20eb6860b9685a0dab636cc4b 23-Mar-2010 Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> V4L/DVB: V4L: File handles

This patch adds a list of v4l2_fh structures to every video_device.
It allows using file handle related information in V4L2. The event interface
is one example of such use.

The use of v4l2_fh is not mandatory for drivers.

Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>