Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > a42e22ddf1d70fb02e9f62289d71cafa > files > 857

mplayer-doc-1.0-1.rc4.0.r31086.3.1mdv2010.2.i586.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>6.1. Setting up MTRR</title><link rel="stylesheet" href="default.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="MPlayer - 电影播放器"><link rel="up" href="video.html" title="第 6 章 Video output devices"><link rel="prev" href="video.html" title="第 6 章 Video output devices"><link rel="next" href="xv.html" title="6.2. Xv"><link rel="preface" href="howtoread.html" title="如何阅读此文档"><link rel="chapter" href="intro.html" title="第 1 章 介绍"><link rel="chapter" href="install.html" title="第 2 章 Installation"><link rel="chapter" href="usage.html" title="第 3 章 Usage"><link rel="chapter" href="advaudio.html" title="第 4 章 Advanced audio usage"><link rel="chapter" href="cd-dvd.html" title="第 5 章 CD/DVD用法"><link rel="chapter" href="video.html" title="第 6 章 Video output devices"><link rel="chapter" href="tv.html" title="第 7 章 TV"><link rel="chapter" href="radio.html" title="第 8 章 广播电台"><link rel="chapter" href="ports.html" title="第 9 章 Ports"><link rel="chapter" href="mencoder.html" title="第 10 章 MEncoder的基础用法"><link rel="chapter" href="encoding-guide.html" title="第 11 章 Encoding with MEncoder"><link rel="chapter" href="faq.html" title="第 12 章 Frequently Asked Questions"><link rel="appendix" href="bugreports.html" title="附录 A. 如何报告错误"><link rel="appendix" href="skin.html" title="附录 B. MPlayer skin format"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">6.1. Setting up MTRR</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="video.html">上一页</a> </td><th width="60%" align="center">第 6 章 Video output devices</th><td width="20%" align="right"> <a accesskey="n" href="xv.html">下一页</a></td></tr></table><hr></div><div class="sect1" title="6.1. Setting up MTRR"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="mtrr"></a>6.1. Setting up MTRR</h2></div></div></div><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 <span class="command"><strong>cat /proc/mtrr</strong></span>:
</p><pre class="screen">
<code class="prompt">--($:~)--</code> cat /proc/mtrr
reg00: base=0xe4000000 (3648MB), size=  16MB: write-combining, count=9
reg01: base=0xd8000000 (3456MB), size= 128MB: write-combining, count=1</pre><p>
</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><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
  from X11 startup messages, for example:
  </p><pre class="screen">
(--) SVGA: PCI: Matrox MGA G400 AGP rev 4, Memory @ 0xd8000000, 0xd4000000
(--) SVGA: Linear framebuffer at 0xD8000000</pre><p>
</p></li><li class="listitem"><p>
  from <tt class="filename">/proc/pci</tt> (use <span class="command"><strong>lspci -v</strong></span>
  command):
  </p><pre class="screen">
01:00.0 VGA compatible controller: Matrox Graphics, Inc.: Unknown device 0525
Memory at d8000000 (32-bit, prefetchable)</pre><p>
</p></li><li class="listitem"><p>
  from mga_vid kernel driver messages (use <span class="command"><strong>dmesg</strong></span>):
  </p><pre class="screen">mga_mem_base = d8000000</pre><p>
</p></li></ol></div><p>
</p><p>
Then let's find the memory size. This is very easy, just convert video RAM
size to hexadecimal, or use this table:
</p><div class="informaltable"><table border="0"><colgroup><col><col></colgroup><tbody><tr><td>1 MB</td><td>0x100000</td></tr><tr><td>2 MB</td><td>0x200000</td></tr><tr><td>4 MB</td><td>0x400000</td></tr><tr><td>8 MB</td><td>0x800000</td></tr><tr><td>16 MB</td><td>0x1000000</td></tr><tr><td>32 MB</td><td>0x2000000</td></tr></tbody></table></div><p>
</p><p>
You know base address and memory size, let's setup MTRR registers!
For example, for the Matrox card above (<code class="literal">base=0xd8000000</code>)
with 32MB ram (<code class="literal">size=0x2000000</code>) just execute:
</p><pre class="screen">
echo "base=0xd8000000 size=0x2000000 type=write-combining" &gt; /proc/mtrr
</pre><p>
</p><p>
Not all CPUs have MTRRs. For example older K6-2 (around 266MHz,
stepping 0) CPUs don't have MTRRs, but stepping 12 does
(execute <span class="command"><strong>cat /proc/cpuinfo</strong></span> to check it).
</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="video.html">上一页</a> </td><td width="20%" align="center"><a accesskey="u" href="video.html">上一级</a></td><td width="40%" align="right"> <a accesskey="n" href="xv.html">下一页</a></td></tr><tr><td width="40%" align="left" valign="top">第 6 章 Video output devices </td><td width="20%" align="center"><a accesskey="h" href="index.html">起始页</a></td><td width="40%" align="right" valign="top"> 6.2. Xv</td></tr></table></div></body></html>