| From: |
| Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> |
| To: |
| "linux-media@vger.kernel.org" <linux-media@vger.kernel.org> |
| Subject: |
| [RFC v2 0/7] V4L2 file handles and event interface |
| Date: |
| Tue, 22 Dec 2009 18:42:59 +0200 |
| Cc: |
| Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Hans Verkuil <hverkuil@xs4all.nl>,
"Ivan T. Ivanov" <iivanov@mm-sol.com>,
Guru Raj <gururaj.nagendra@intel.com> |
| Archive-link: |
| Article, Thread
|
Hi,
Here's the second version of the V4L2 file handle and event interface
patchset. Still RFC since I'd like to get more feedback on it.
The first patch adds the V4L2 file handle support and the rest are for V4L2
events.
The patchset works with the OMAP 3 ISP driver. Patches for OMAP 3 ISP are
not part of this patchset but are available in Gitorious (branch is called
events):
git://gitorious.org/omap3camera/mainline.git event
The major change since the last one v4l2_fh structure is now part of
driver's own file handle. It's used as file->private_data as well. I did
this based on Hans Verkuil's suggestion. Sequence numbers and event queue
length limitation is there as well. There are countless of smaller changes,
too.
A few notes on the patches:
- I don't like the locking too much. Perhaps the file handle specific lock
(events->lock) could be dropped in favour of the lock for v4l2_file_handle
in video_device?
- Poll. The V4L2 specifiction says:
"When the application did not call VIDIOC_QBUF or
VIDIOC_STREAMON yet the poll() function succeeds, but sets the
POLLERR flag in the revents field."
The current events for OMAP 3 ISP are related to streaming but not all
might be in future. For example there might be some radio or DVB related
events.
- Sequence numbers are local to file handles.
- Subscribing V4L2_EVENT_ALL causes any other events to be unsubscribed.
- If V4L2_EVENT_ALL has been subscribed, unsubscribing any one of the
events leads to V4L2_EVENT_ALL to be unsubscribed. This problem would be
difficult to work around since this would require the event system to be
aware of the driver private events as well.
- If events are missed, the sequence number is incremented in any
case. This way the user space knows events have been missed.
Comments would be very, very welcome.
Cheers,
--
Sakari Ailus
sakari.ailus@maxwell.research.nokia.com