Rewrite buffering system
commitc6b035b2c763845f15bf5b1ec3c8db9bf10d26d0
authorBrian Johnson <brijohn@gmail.com>
Sun, 4 May 2008 20:40:16 +0000 (4 16:40 -0400)
committerBrian Johnson <brijohn@gmail.com>
Wed, 9 Jul 2008 17:28:20 +0000 (9 13:28 -0400)
treeb02399cc29cc589b1a861056df1012a8c6cc3021
parentc14c8c8f2ec9df3f48509063b7ed0a2c7e7d1ab7
Rewrite buffering system

Rewrote REQBUFS, QUERYBUF, QBUF, and DQBUF ioctls.
These now properly set and clear buffer flags. sequence
counter is also incremented now. REQBUFS will return -EBUSY
when IO is in progress and will free buffer memory when 0 buffers
are requested otherwise it will allocate memory.

Two new module params have been added min_buffers and max_buffers
which tell the driver what the minimum and maximum number of buffers
it can grant are. When they are set equal the driver will always grant
that number of buffers.

The new buffering system utilizes a single array of buffers that can be
in one of two different queues(incoming, outgoing). A buffer is placed
in the incoming queue by calling QBUF on that buffer. When a frame is
ready the next buffer from the incoming queue is removed its buffer filled
and added to the outgoing queue. Then DQBUF is used get retrieve the
next buffer from the outgoing queue.

Signed-off-by: Brian Johnson <brijohn@gmail.com>
microdia-buf.c
microdia-decoder.c
microdia-usb.c
microdia-v4l.c
microdia.h