RivaTV Hacking Guide


What to hack ==============================================================

  The `rivatv' project can be accessed via CVS using the following
command.

  $ cvs -d:pserver:anonymous@cvs.rivatv.sourceforge.net:/cvsroot/rivatv \
    -z3 co rivatv

  You will obtain a subset of a Linux kernel which contains the modified 
parts which are necessary to get your graphics hardware running.  Thus
you have the Video4Linux driver `rivatv' in the directory 
`linux/drivers/media/video'.
  The `Config.in' and `Makefile' are also going to be part of the Linux
kernel sources.  If you want to compile the kernel module right from
the CVS tree you show issue the following command.

  $ cd rivatv/linux/drivers/media/video/
  $ make -f Makefile.cvs clean all OR
  $ make -f Makefile.cvs clean kall

  If you are using kernel source which are not located in `/usr/src/linux'
you can specify the `KERNEL' variable in `Makefile.cvs'.


Requirements ==============================================================

  The kernel module `rivatv.o' depends on the following kernel features
which you might need to enable in your local kernel sources.

 * i2c-core
 * i2c-algo-bit
 * videodev


Loading kernel modules ====================================================

  In order to resolve the dependencies of the `rivatv.o' kernel module
you possibly need to load the following additional kernel modules which
are part of the standard Linux kernel.  Issue these command if neccessary
before loading the rivatv module.

  $ modprobe videodev
  $ modprobe i2c-core
  $ modprobe i2c-algo-bit

  Now you are ready to load the `rivatv.o' kernel module.  Run this 
command.

  $ insmod rivatv.o

  Additionally you need to load one of the video decoder drivers 
`saa7111a.o', `saa7108e.o', `vpx32xx.o', `tw98.o' or `saa7113h.o' 
depending on your hardware.

  $ insmod saa7113h.o


What to watch =============================================================

  When the rivatv refuses to load or does not work as you expect it you
should have a look at the file `/var/log/messages'.  Probably you will 
here an appropriate debug message.
  Otherwise you can issue the following commands:

  $ cat /proc/driver/rivatv
  $ cat /proc/interrupts
  $ cat /proc/iomem

  These should contain your hardware's related information which the 
rivatv module tries to control.

  The current status of the v4l driver allows the user to load the
main v4l kernel module `rivatv.o' and depending on the hardware
the video decoder i2c modules.  When using e.g. xawtv you will not
see a video picture but random data.  But the driver is definitely 
able to control the video decoder chips (saa71xx).


Current strategy ==========================================================

  We assume the nVidia chips can be told to dump the video data of its
video decoder chip (saa71xx) into its framebuffer.  The driver can 
re-read this data (which is a big UYVY block) and convert it into any
colour space it wishes to.  Also we assume there is a kind of scalar unit
for the transfer from the video decoder into nVidia's framebuffer.


Roadmap ===================================================================

  The above strategy has been proofed correct... we get pictures from the
video decoder and transfer them from the framebuffer into main memory using
memory mapped IO.  This is relatively slow.  That is why we are working
on code which transfers the video picture data by DMA.  This has been
successfully done for NV4, NV10 and NV20.

  Overlay has been implemented for NV4, NV10 and NV20 architectures.  
Thus the user gets good framerate even in fullscreen.  Overlay is now also
working for NV3 architectures.
