This engine is built around a irq driven design.

Assumption: the IRQ arrives at the start of each frame.
The driver can be in any of the four modes.
1. OVERLAYing - requested by VIDIOCAPTURE
2. READing - requested by read operation. After data has been
   gathered, the read operation is unblocked by a wakeup call.
3. GRABing - requested by a MCAPTURE or CSYNC release. After the
   data has been gathered, the waiters shall be unblocked.
4. IDLEING - nothing to be done, turn video and irqs off, so
  we won't get bothered again by this Zoran chip.

So there are 2 wait queues, one for readers, and one for grab'ers

Overlaying takes place only once during interrupt time; once the
chip has been setup, the irqs will be turned off to prevent unneeded
work. Overlaying is the least important of all capturing modes and
as such will be interrupted by both reading and grabbing data.

Reading takes place in a specially prepaired mode, which only contains
the first 21 scanlines in maximum horizontal resolution in the YUV422
format, and ofcourse no decimation of either X or Y. This will result
in 21*768*3=48384 bytes maximal available per read.

Grabbing is different. It uses a multi-phase setup on behave of the user:
o  Setup some window size
o  do a GMBUF to determine the number of available frames, the size of
   the memory to mmap and the offsets of the frames inside this memory.
o  mmap the region
o  MCAPTURE each frame. MCAPTURE will fail if there are no more frames
   available.
o  do an SYNC call for each frame you ant to work on. If the frame is not
   yet done, the SYNC call will wait for it...
o  During interrupt time, the driver looks which frame it has grabbed
   and releases any waiters on it.

Pauline
