| 1 |
|
| 2 |
|
| 3 |
Theoretically, performance of video output should be only limited by |
| 4 |
bandwidth of CPU <-> Video bus ( for PCI bus it's 133 Mb/s or 5 ms for |
| 5 |
drawing of 640x480x16 picture ). Unfortunately, this value is rarely |
| 6 |
achieved. Actual performance is affected by many factors and can vary |
| 7 |
from 20 to 250 Mb/s. |
| 8 |
You can determine this value for your system by running 'benchmark' |
| 9 |
tool. Type: |
| 10 |
benchmark <your-AVI-file> (try also with options -yuv and -direct) |
| 11 |
and it'll perform quick measurement of most typical timings. In the end, |
| 12 |
it'll print video output speed in megabytes per second. If the resulting |
| 13 |
value for your system is higher than 50 Mb/s, then there's nothing for |
| 14 |
you to worry about, because your X server has some kind of output |
| 15 |
acceleration. |
| 16 |
In case of this performance being worse than 30 Mb/s, you'll probably |
| 17 |
need to turn on write-combining for video card. This should generally be |
| 18 |
done by X server, but some servers ( for example, X server for XFree86 |
| 19 |
3.3.6 with s3_savage driver ) don't do it ( shame on them ). Here I'll |
| 20 |
describe how it could be done by hands in case of Linux. |
| 21 |
1. Your processor should have MTRR registers ( Pentium Pro, Pentium II |
| 22 |
or maybe some compatible processors ). Your kernel should be compiled |
| 23 |
with MTRR support: in kernel configuration menu, select 'Processor type |
| 24 |
and features' ->'MTRR (Memory Type Range Register) support'. |
| 25 |
2. Run X and log its output somewhere: |
| 26 |
|
| 27 |
startx >./startx.log 2>&1 |
| 28 |
|
| 29 |
Look into the log and find a line similar to this: |
| 30 |
|
| 31 |
(--) SVGA: PCI: S3 Savage4 rev 2, Memory @ 0xe5000000, 0xd8000000 |
| 32 |
|
| 33 |
Here 0xe5000000 and 0xd8000000 are virtual addresses of your video |
| 34 |
memory. You'll need one of them. |
| 35 |
2a. Alternatively, you can look at /proc/pci and find section related to |
| 36 |
your video card ( "VGA compatible controller" ). Take the first address |
| 37 |
from the line saying about "prefetchable 32 bit memory". |
| 38 |
|
| 39 |
3. Type as root: |
| 40 |
|
| 41 |
echo "base=<your-base> size=0x800000 type=write-combining" >>/proc/mtrr |
| 42 |
|
| 43 |
replacing <your-base> with address received in step 2 and 0x800000 ( which |
| 44 |
is equal to 8 Mb ) with size of your video memory. |
| 45 |
|
| 46 |
That's it. If you did everything properly, you should notice significant |
| 47 |
increase in output performance. For me it increased output bandwidth from |
| 48 |
20 to 36 Mb/s ( 1.8x ), and I had reports about 3x..4x increase! |
| 49 |
|
| 50 |
In case that you chose wrong address from list in step 2, do the following: |
| 51 |
|
| 52 |
cat /proc/mtrr |
| 53 |
|
| 54 |
Find the line that was added by you. Suppose it starts with "reg02", |
| 55 |
then type: |
| 56 |
|
| 57 |
echo "disable=2" >>/proc/mtrr |
| 58 |
|
| 59 |
and repeat step 3 with another address. |
| 60 |
|
| 61 |
It is a good idea to put command from step 3 somewhere in startup scripts, |
| 62 |
because that base address does not change when you restart computer, but do |
| 63 |
not forget to remove it when changing hardware configuration. |
| 64 |
|
| 65 |
You can find details about using /proc/mtrr in Linux kernel sources, file |
| 66 |
Documentation/mtrr.txt. |