linux/drivers/media/video/ivtv
Hans Verkuil f1e393de38 [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>
2011-07-27 17:53:31 -03:00
..
ivtv-cards.c [media] ivtv: Add Adaptec Remote Controller 2010-12-30 12:17:08 -02:00
ivtv-cards.h [media] ivtv: Add Adaptec Remote Controller 2010-12-30 12:17:08 -02:00
ivtv-controls.c V4L/DVB: ivtv: convert to the new control framework 2010-08-08 23:43:06 -03:00
ivtv-controls.h V4L/DVB: ivtv: convert to the new control framework 2010-08-08 23:43:06 -03:00
ivtv-driver.c [media] ivtv: Internally separate encoder & decoder standard setting 2011-06-01 08:46:38 -03:00
ivtv-driver.h [media] ivtv,cx18: Use default version control for VIDIOC_QUERYCAP 2011-07-27 17:53:14 -03:00
ivtv-fileops.c [media] v4l2-event/ctrls/fh: allocate events per fh and per type instead of just per-fh 2011-07-27 17:53:31 -03:00
ivtv-fileops.h
ivtv-firmware.c [media] ivtv: Internally separate encoder & decoder standard setting 2011-06-01 08:46:38 -03:00
ivtv-firmware.h V4L/DVB: ivtv: Add firmare monitoring and debug mode to ignore firmware problems 2010-08-02 14:47:55 -03:00
ivtv-gpio.c V4L/DVB: ivtv: convert gpio subdev to new control framework 2010-08-08 23:43:05 -03:00
ivtv-gpio.h
ivtv-i2c.c [media] rc/keymaps: Remove the obsolete rc-rc5-tv keymap 2011-03-22 19:24:17 -03:00
ivtv-i2c.h V4L/DVB (13443): ivtv: Defer legacy I2C IR probing until after setup of known I2C devices 2009-12-05 18:41:56 -02:00
ivtv-ioctl.c [media] v4l2-event/ctrls/fh: allocate events per fh and per type instead of just per-fh 2011-07-27 17:53:31 -03:00
ivtv-ioctl.h [media] ivtv: Internally separate encoder & decoder standard setting 2011-06-01 08:46:38 -03:00
ivtv-irq.c [media] ivtv: Fix corrective action taken upon DMA ERR interrupt to avoid hang 2011-03-02 13:45:42 -03:00
ivtv-irq.h ivtv: use kthread_worker instead of workqueue 2010-06-29 10:07:09 +02:00
ivtv-mailbox.c V4L/DVB: ivtv: Automatic firmware reload 2010-08-02 14:48:13 -03:00
ivtv-mailbox.h V4L/DVB: ivtv: Automatic firmware reload 2010-08-02 14:48:13 -03:00
ivtv-queue.c ivtv: Fix PCI DMA direction 2009-06-05 08:05:23 -07:00
ivtv-queue.h V4L/DVB (10488): ivtv: cleanup naming conventions 2009-03-30 12:42:41 -03:00
ivtv-routing.c V4L/DVB (11380): v4l2-subdev: change s_routing prototype 2009-04-06 21:44:27 -03:00
ivtv-routing.h
ivtv-streams.c [media] ivtv: Make two ivtv_msleep_timeout calls uninterruptable 2011-06-01 08:45:03 -03:00
ivtv-streams.h
ivtv-udma.c [media] ivtv: udma: handle get_user_pages() returning fewer pages than we asked for 2011-03-21 20:32:33 -03:00
ivtv-udma.h V4L/DVB (10488): ivtv: cleanup naming conventions 2009-03-30 12:42:41 -03:00
ivtv-vbi.c [media] ivtv: Internally separate encoder & decoder standard setting 2011-06-01 08:46:38 -03:00
ivtv-vbi.h [media] ivtv: Return EFAULT when copy_from_user() fails in ivtv_write_vbi_from_user() 2010-12-29 08:17:10 -02:00
ivtv-version.h [media] ivtv,cx18: Use default version control for VIDIOC_QUERYCAP 2011-07-27 17:53:14 -03:00
ivtv-yuv.c [media] ivtv: yuv: handle get_user_pages() -errno returns 2011-03-21 20:32:35 -03:00
ivtv-yuv.h
ivtvfb.c [media] ivtv: Internally separate encoder & decoder standard setting 2011-06-01 08:46:38 -03:00
Kconfig [media] rc: rename the remaining things to rc_core 2010-12-29 08:16:50 -02:00
Makefile