CVSROOT:        /cvs
Module name:    src
Changes by:     mgloc...@cvs.openbsd.org        2021/02/16 06:50:46

Modified files:
        sys/dev        : video.c 

Log message:
Enable multiple opens of a video(4) device as described in the V4L2
specification:

https://www.kernel.org/doc/html/v5.10/userspace-api/media/v4l/open.html#f1

The discussion has been started by jca@, who has implemented this
behavior recently, but limited to the same process.  This diff extends
this behavior to any process.  The first process which opens a stream
will become the device owner.  Other processes are still allowed to call
certain ioctls, but none which are related to the start/stop of a
stream, or manipulation of the streaming buffers.  At the moment only
VIDIOC_G_CTRL and VIDIOC_S_CTRL are supported to be called by non-
device owner processes, which should be extended further in the future.

There is no additional kernel locking implemented at the moment, since
video(4) already runs under the KERNEL_LOCK(), which we expect to be
sufficient for now (as discussed with claudio@).

A lot of improvement input received from anton@.

ok anton@

Reply via email to