Considerations for the future Marvel/Linux driver design

(this text was written by Benoit, editing done by Gernot)

I'm looking at the memory grabbing and BES. Therefore, I'm interested in writing a code which can easily be merged with the dvd and mga_vid code. I would like to receive your comments about the design of a common driver for all mga extensions. First, let's check if I know all the possibilities :

Now, what could a user want to do ?
Here I assume that the g200 grabs the video to the frame buffer, and always provides preview and/or uncompressed grabbing.
Tvout is optional, but should be available for free if we know how to activate the video pass-through.

  1. dvd -> g200 -> tvout
  2. tuner -> ks0127 --> g200 -> tvout --> mjpeg compression
  3. mjpeg decompression -> ks0127 -> g200 -> tvout
  4. software video source -> g200
    (old mga_vid driver, I suppose that tvout will not be available, unless we output the whole desktop to TV).

Let us define channels :

Here are the available services : (once the channel has been chosen, one can activate any number of services simultaneously) Available channels depend on the board type.
channel: tuner composite Y/C mjpeg dvd software
service:
preview******
tvout*****n/a
mjpeg/memgrab*/**/**/*na/*na/*n/a//n/a (?)

We define the available ioctls, and the behavior of read/write as a function of the current status.

Board status is defined by :

  1. active channel,
  2. preview settings, preview active
  3. tvout settings, tvout active
  4. mjpeg compress settings, mjpeg compress active
  5. uncompressed grab settings, grab active
  6. mjpeg play settings, mjpeg play active
  7. dvd play settings, dvd active
  8. software play settings, software active
  9. tuner settings
  10. decoder settings
  11. who is sleeping

How do we decide when a flag is set "active" ?
Memory grabbing can be done in a "one shot" mode (when "read" is called). Therefore, I propose to set the flag "active" only between the "buffer request" and the "buffer release" commands. (does this exist ?). There should be some ioctls to release services, but I think they do not exist in V4L...

Then operations are allowed or forbidden :

How to decide when we put a chip to sleep ?

If you have ideas about this, please send me your comments.

Open questions: