| 1 |
|
| 2 |
mga_vid - MGA G200/G400 YUV Overlay kernel module |
| 3 |
|
| 4 |
Author: |
| 5 |
Aaron Holtzman <[email protected]>, Oct 1999 |
| 6 |
|
| 7 |
Contributions by: |
| 8 |
Fredrik Vraalsen <[email protected]> |
| 9 |
Alan Cox <[email protected]> |
| 10 |
Zdenek Kabelac <[email protected]> |
| 11 |
|
| 12 |
(Notes for usage with aviplayer you will at the end of this file) |
| 13 |
|
| 14 |
--------- This are original README before it has been modified -------- |
| 15 |
for the usage with avifile player |
| 16 |
|
| 17 |
|
| 18 |
WARNING ----- WARNING |
| 19 |
|
| 20 |
This code messes with your video card and your xserver. It will probably |
| 21 |
lock up your box, format your hard drive, and cause your brand new g400 |
| 22 |
MAX to spout 6 inch flames. You have been warned. |
| 23 |
|
| 24 |
WARNING ----- WARNING |
| 25 |
|
| 26 |
What does this code do? |
| 27 |
|
| 28 |
mga_vid is a kernel module that utilitizes the Matrox g200/g400 video |
| 29 |
scaler/overlay unit to perform YUV->RGB colorspace conversion and |
| 30 |
arbitrary video scaling. |
| 31 |
|
| 32 |
mga_vid is also a monster hack. |
| 33 |
|
| 34 |
How does mga_vid work? |
| 35 |
|
| 36 |
This kernel module sets up the BES (backend scaler) with approriate values |
| 37 |
based on parameters supplied via ioctl. It also maps a chunk of video |
| 38 |
memory into userspace via mmap. This memory is stolen from X (which may |
| 39 |
decide to write to it later). The application can then write image data |
| 40 |
directly to the frame buffer (if it knows the right padding, etc). |
| 41 |
|
| 42 |
|
| 43 |
How do I know if mga_vid works on my system? |
| 44 |
|
| 45 |
There are test applications called mga_vid_test_g400 and mga_vid_test_g200. |
| 46 |
Use the appropriate one for your card. This test code should draw some |
| 47 |
nice 256x256 images for you if all is working well. |
| 48 |
|
| 49 |
-------------------------------------------------------------------------- |
| 50 |
|
| 51 |
And here are some notes about how to use this driver with Aviplayer |
| 52 |
|
| 53 |
First - Aviplayer doesn't use any hardware registry trashing call from this |
| 54 |
driver - it just turn of interrupt generation for Vertical Blank Interrupt |
| 55 |
when its opened for reading. (so Xv extension should be working even |
| 56 |
when you close aviplayer). |
| 57 |
|
| 58 |
So the whole usage of this driver is to wakeup process waiting in read |
| 59 |
operation when VBI event comes in. |
| 60 |
|
| 61 |
This is used also for video synchronization timing (and its the best way |
| 62 |
(and I would also say the only one) to provide smooth video. |
| 63 |
|
| 64 |
Compilation should be quite easy - you just need to use kernel 2.4 |
| 65 |
(as driver is using tasklets which are not present in 2.2 kernel - it |
| 66 |
should not be that hard to rewrite this driver to support also 2.2 kernel |
| 67 |
but I'm lazy to do this - so if you want to sent me a patch for this |
| 68 |
just go ahead) |
| 69 |
|
| 70 |
Use this command to create driver dev entry point : |
| 71 |
|
| 72 |
mknod /dev/mga_vid c 178 0 |
| 73 |
|
| 74 |
(you could also use devfs - it should be supported by aviplayer) |
| 75 |
|
| 76 |
and the rest shuold be easy - aviplayer shuold be able to detect presence |
| 77 |
of such device and use it - and you could enjoy the perfect smooth video |
| 78 |
on your computer (OK only with MGA card for now) |
| 79 |
|
| 80 |
But if you know how to wait for VBI on your card and you are able to |
| 81 |
write some line of kernel code - you should be able to easily extend |
| 82 |
current mga_vid driver - I assume it will be soon renamed to vbi_drv |
| 83 |
anyway. |