<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Video - MPlayer - The Movie Player for Linux</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="../default.css">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<BODY>
<H3><A NAME="video">2.3.1 Video output devices</A></H3>
<H4><A NAME="mtrr">2.3.1.1 Setting up MTRR</A></H4>
<P>It is VERY recommended to check if the MTRR registers are set up properly,
because they can give a big performance boost.</P>
<P>Do a '<CODE>cat /proc/mtrr</CODE>':</P>
<P><CODE>
--($:~)-- cat /proc/mtrr<BR>
reg00: base=0xe4000000 (3648MB), size= 16MB: write-combining, count=9<BR>
reg01: base=0xd8000000 (3456MB), size= 128MB: write-combining, count=1</CODE></P>
<P>It's right, shows my Matrox G400 with 16MB memory. I did this from
XFree 4.x.x , which sets up MTRR registers automatically.</P>
<P>If nothing worked, you have to do it manually. First, you have to find the
base address. You have 3 ways to find it:</P>
<UL>
<LI>from X11 startup messages, for example:
<P><CODE>(--) SVGA: PCI: Matrox MGA G400 AGP rev 4, Memory @ 0xd8000000, 0xd4000000<BR>
(--) SVGA: Linear framebuffer at 0xD8000000</CODE></P></LI>
<LI>from /proc/pci (use lspci -v command):
<P>
<CODE>01:00.0 VGA compatible controller: Matrox Graphics, Inc.: Unknown device 0525</CODE>
<CODE>Memory at d8000000 (32-bit, prefetchable)</CODE>
</P></LI>
<LI>from mga_vid kernel driver messages (use <CODE>dmesg</CODE>):
<P><CODE>mga_mem_base = d8000000</CODE></P></LI>
</UL>
<P>Then let's find the memory size. This is very easy, just convert video ram
size to hexadecimal, or use this table:</P>
<TABLE BORDER=0>
<TR><TD> </TD><TD>1 MB</TD><TD WIDTH="10%"></TD><TD>0x100000</TD></TR>
<TR><TD></TD><TD>2 MB</TD><TD></TD><TD>0x200000</TD></TR>
<TR><TD></TD><TD>4 MB</TD><TD></TD><TD>0x400000</TD></TR>
<TR><TD></TD><TD>8 MB</TD><TD></TD><TD>0x800000</TD></TR>
<TR><TD></TD><TD>16 MB</TD><TD></TD><TD>0x1000000</TD></TR>
<TR><TD></TD><TD>32 MB</TD><TD></TD><TD>0x2000000</TD></TR>
</TABLE>
<P>You know base address and memory size, let's setup MTRR registers!
For example, for the Matrox card above (base=0xd8000000) with 32MB
ram (size=0x2000000) just execute:</P>
<P><CODE> echo "base=0xd8000000 size=0x2000000 type=write-combining" >| /proc/mtrr</CODE></P>
<P>Not all CPUs support MTRRs. For example older K6-2's [around 266MHz,
stepping 0] doesn't support MTRR, but stepping 12's do ('<CODE>cat
/proc/cpuinfo</CODE>' to check it').</P>
<H4><A NAME="normal">2.3.1.2 Video outputs for traditional video cards</A></H4>
<H4><A NAME="xv">2.3.1.2.1 Xv</A></H4>
<P>Under XFree86 4.0.2 or newer, you can use your card's hardware YUV routines
using the XVideo extension. This is what the option '-vo xv' uses. Also,
this is driver supports adjusting brightness/contrast/hue/etc (unless you use
the old, slow DirectShow DivX codec, which supports it everywhere), see the
man page.</P>
<P>In order to make this work, be sure to check the following:</P>
<UL>
<LI>You have to use XFree86 4.0.2 or newer (former versions don't have
XVideo)</LI>
<LI>Your card actually supports hardware acceleration (modern cards do)</LI>
<LI>X loads the XVideo extension, it's something like this:
<P><CODE> (II) Loading extension XVideo</CODE></P>
<P>in /var/log/XFree86.0.log</P>
<P>NOTE: this loads only the XFree86's extension. In a good install, this
is always loaded, and doesn't mean that the <B>card's</B> XVideo support is
loaded!</P>
</LI>
<LI>Your card has Xv support under Linux. To check, try 'xvinfo', it is the
part of the XFree86 distribution. It should display a long text, similar
to this:
<PRE>
X-Video Extension version 2.2
screen #0
Adaptor #0: "Savage Streams Engine"
number of ports: 1
port base: 43
operations supported: PutImage
supported visuals:
depth 16, visualID 0x22
depth 16, visualID 0x23
number of attributes: 5
(...)
Number of image formats: 7
id: 0x32595559 (YUY2)
guid: 59555932-0000-0010-8000-00aa00389b71
bits per pixel: 16
number of planes: 1
type: YUV (packed)
id:
|