[d28b5ef] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
[7c472863] | 8 | <sect1 id="xorg-config">
|
---|
| 9 | <?dbhtml filename="xorg-config.html"?>
|
---|
[d28b5ef] | 10 |
|
---|
| 11 | <sect1info>
|
---|
[8020e8b] | 12 | <othername>$LastChangedBy$</othername>
|
---|
| 13 | <date>$Date$</date>
|
---|
[d28b5ef] | 14 | </sect1info>
|
---|
| 15 |
|
---|
[5287b7c] | 16 | <title>Xorg-&xorg-version; Testing and Configuration</title>
|
---|
[d28b5ef] | 17 |
|
---|
[b960e3ec] | 18 | <indexterm zone="xorg-config">
|
---|
| 19 | <primary sortas="g-configuring-xorg">Configuring Xorg</primary>
|
---|
| 20 | </indexterm>
|
---|
| 21 |
|
---|
[5930509] | 22 | <sect2 id='X11-testing' xreflabel="Testing Xorg">
|
---|
| 23 | <title>Testing Xorg</title>
|
---|
[0d7900a] | 24 |
|
---|
[8471938] | 25 | <note><para>Before starting Xorg for the first time, is is useful to
|
---|
| 26 | rebuild the library cache by running <userinput>ldconfig</userinput>
|
---|
| 27 | as the <systemitem class="username">root</systemitem> user.</para></note>
|
---|
| 28 |
|
---|
[5930509] | 29 | <para>To test the <application>Xorg</application> installation, issue
|
---|
[0a30c92e] | 30 | <userinput>startx</userinput>. This command brings up a rudimentary window
|
---|
| 31 | manager called <emphasis>twm</emphasis> with three xterm windows and one
|
---|
| 32 | xclock window. The xterm window in the upper left is a login terminal and
|
---|
| 33 | running <emphasis>exit</emphasis> from this terminal will exit the
|
---|
| 34 | <application>X Window</application> session. The third xterm window may be
|
---|
| 35 | obscured on your system by the other two xterms.</para>
|
---|
[0d7900a] | 36 |
|
---|
[00af31d] | 37 | <note><para>When testing <application>Xorg</application> with the
|
---|
| 38 | <application>twm</application> window manager, there will be several
|
---|
| 39 | warnings in the Xorg log file, <filename>/var/log/Xorg.0.log</filename>,
|
---|
| 40 | about missing font files. In addition, there will be several warnings on
|
---|
| 41 | the text mode terminal (usually tty1) about missing fonts. These warnings
|
---|
| 42 | do not affect functionality, but can be removed if desired by installing
|
---|
| 43 | the <xref linkend="xorg7-legacy"/>.</para></note>
|
---|
| 44 |
|
---|
[5930509] | 45 | <para>Generally, there is no specific configuration required for
|
---|
[0d7900a] | 46 | <application>Xorg</application>, but customization is possible. For details
|
---|
[5930509] | 47 | see <xref linkend='xconfig'/> below.</para>
|
---|
| 48 |
|
---|
| 49 | </sect2>
|
---|
| 50 |
|
---|
[f38727d] | 51 | <sect2 role="configuration" id="checking-dri" xreflabel="Checking the DRI installation">
|
---|
[2001b3e] | 52 | <title>Checking the Direct Rendering Infrastructure (DRI) Installation</title>
|
---|
| 53 |
|
---|
[f38727d] | 54 | <para>
|
---|
| 55 | DRI is a framework for allowing software to access graphics hardware in a safe and
|
---|
| 56 | efficient manner. It is installed in <application>X</application> by default
|
---|
[7a395d1] | 57 | (using <application>Mesa</application>) if you have a supported video card.
|
---|
[f38727d] | 58 | </para>
|
---|
| 59 |
|
---|
| 60 | <para>
|
---|
| 61 | To check if DRI drivers are installed properly, check the log file
|
---|
[c96921c] | 62 | <filename>/var/log/Xorg.0.log</filename> for statements such as:
|
---|
[f38727d] | 63 | </para>
|
---|
| 64 |
|
---|
| 65 | <screen><literal>(II) intel(0): direct rendering: DRI2 Enabled</literal></screen>
|
---|
| 66 |
|
---|
[c96921c] | 67 | <para>or</para>
|
---|
| 68 |
|
---|
| 69 | <screen><literal>(II) NOUVEAU(0): Loaded DRI module</literal></screen>
|
---|
| 70 |
|
---|
[f38727d] | 71 | <note>
|
---|
| 72 | <para>
|
---|
| 73 | DRI configuration may differ if you are using alternate drivers, such
|
---|
| 74 | as those from
|
---|
| 75 | <ulink url="http://www.nvidia.com/page/home.html">NVIDIA</ulink> or
|
---|
[fce3067] | 76 | <ulink url="http://www.amd.com/">AMD</ulink>.
|
---|
[f38727d] | 77 | </para>
|
---|
[2001b3e] | 78 | </note>
|
---|
| 79 |
|
---|
[f38727d] | 80 | <para>
|
---|
| 81 | Although all users can use software acceleration, any hardware acceleration (DRI2)
|
---|
| 82 | is only available to <systemitem class="username">root</systemitem> and members
|
---|
| 83 | of the <systemitem class="groupname">video</systemitem> group.
|
---|
| 84 | </para>
|
---|
[c96921c] | 85 | <!--
|
---|
[f38727d] | 86 | <para>
|
---|
| 87 | To see if hardware acceleration is available for your driver, look in
|
---|
| 88 | <filename>/var/log/Xorg.0.log</filename> for statements like:
|
---|
| 89 | </para>
|
---|
[2001b3e] | 90 |
|
---|
[f38727d] | 91 | <screen><literal>(II) intel(0): direct rendering: DRI2 Enabled</literal></screen>
|
---|
[c96921c] | 92 | -->
|
---|
[f38727d] | 93 | <para>
|
---|
| 94 | If your driver is supported, add any users that might use X to that group:
|
---|
| 95 | </para>
|
---|
[2001b3e] | 96 |
|
---|
| 97 | <screen role="root"><userinput>usermod -a -G video <replaceable><username></replaceable></userinput></screen>
|
---|
| 98 |
|
---|
[f38727d] | 99 | <para>
|
---|
[c96921c] | 100 | Another way to determine if DRI is working properly is to use one of the
|
---|
| 101 | two optionally installed OpenGL demo programs in <xref
|
---|
[7a395d1] | 102 | linkend="mesa"/>. From an X terminal, run <command>glxinfo</command>
|
---|
[f38727d] | 103 | and look for the phrase:
|
---|
| 104 | </para>
|
---|
| 105 |
|
---|
| 106 | <screen><computeroutput>name of display: :0
|
---|
| 107 | display: :0 screen: 0
|
---|
| 108 | direct rendering: Yes</computeroutput></screen>
|
---|
| 109 |
|
---|
| 110 | <para>
|
---|
| 111 | If direct rendering is enabled, you can add verbosity by running
|
---|
| 112 | <command>LIBGL_DEBUG=verbose glxinfo</command>. This will show the drivers,
|
---|
| 113 | device nodes and files used by the DRI system.
|
---|
| 114 | </para>
|
---|
| 115 |
|
---|
| 116 | <para>
|
---|
[c96921c] | 117 | To confirm that DRI2 hardware acceleration is working, you can (still in
|
---|
| 118 | the X terminal) run the command <command>glxinfo | egrep "(OpenGL
|
---|
| 119 | vendor|OpenGL renderer|OpenGL version)"</command>.
|
---|
| 120 | If that reports something <emphasis>other than</emphasis>
|
---|
| 121 | <literal>Software Rasterizer</literal> then you have working
|
---|
| 122 | acceleration for the user who ran the command.
|
---|
[f38727d] | 123 | </para>
|
---|
| 124 |
|
---|
| 125 | <para>
|
---|
[c96921c] | 126 | If your hardware does not have any DRI2 driver available, it will use a
|
---|
| 127 | Software Rasterizer for Direct Rendering. In such cases, you can use a new,
|
---|
| 128 | LLVM-accelerated, Software Rasterizer called LLVMPipe. In order to build
|
---|
[7a395d1] | 129 | LLVMPipe just make sure that <xref linkend="llvm"/> is present at Mesa
|
---|
[c96921c] | 130 | build time. Note that all decoding is done on the CPU instead of the GPU,
|
---|
[f3429309] | 131 | so the display will run slower than with hardware acceleration.
|
---|
[c96921c] | 132 | To check if you are using LLVMpipe,
|
---|
| 133 | review the output ot the glxinfo command above. An example of the
|
---|
| 134 | output using the Software Rasterizer is shown below:
|
---|
[f38727d] | 135 | </para>
|
---|
| 136 |
|
---|
[c8a70a5] | 137 | <screen><computeroutput>OpenGL vendor string: VMware, Inc.
|
---|
| 138 | OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.5, 256 bits)
|
---|
[9b175e27] | 139 | OpenGL version string: 3.0 Mesa 10.4.5</computeroutput></screen>
|
---|
[f38727d] | 140 |
|
---|
| 141 | <para>
|
---|
[c96921c] | 142 | You can also force LLVMPipe by exporting the <envar>LIBGL_ALWAYS_SOFTWARE=1</envar>
|
---|
| 143 | environment variable when starting Xorg.
|
---|
[f38727d] | 144 | </para>
|
---|
| 145 |
|
---|
| 146 | <para>
|
---|
[c96921c] | 147 | Again, if you have built the Mesa OpenGL demos, you can also run the test
|
---|
| 148 | program <command>glxgears</command>. This program brings up a window with
|
---|
| 149 | three gears turning. The X terminal will display how many frames were
|
---|
| 150 | drawn every five seconds, so this will give a rough benchmark. The window
|
---|
| 151 | is scalable, and the frames drawn per second is highly dependent on the
|
---|
| 152 | size of the window. On some hardware, <command>glxgears</command> will
|
---|
| 153 | run synchronized with the vertical refresh signal and the frame rate will
|
---|
| 154 | be approximately the same as the monitor refresh rate.
|
---|
[f38727d] | 155 | </para>
|
---|
[2001b3e] | 156 |
|
---|
[f38727d] | 157 | </sect2>
|
---|
[2001b3e] | 158 |
|
---|
[f38727d] | 159 | <sect2 role="configuration" id="hybrid-graphics" xreflabel="Hybrid Graphics">
|
---|
| 160 | <title>Hybrid Graphics</title>
|
---|
| 161 |
|
---|
| 162 | <para>
|
---|
| 163 | Hybrid Graphics is still in experimental state for Linux. Xorg Developers have
|
---|
| 164 | developed a technology called PRIME that can be used for switching between
|
---|
| 165 | integrated and muxless discrete GPU at will. Automatic switching is not
|
---|
| 166 | possible at the moment.
|
---|
| 167 | </para>
|
---|
| 168 |
|
---|
| 169 | <para>
|
---|
| 170 | In order to use PRIME for GPU switching, make sure that you are using Linux
|
---|
| 171 | Kernel 3.4 or later (recommended). You will need latest DRI and DDX drivers
|
---|
[c96921c] | 172 | for your hardware and <application>Xorg Server</application> 1.13 or later
|
---|
| 173 | with an optional patch applied.
|
---|
[f38727d] | 174 | </para>
|
---|
| 175 |
|
---|
| 176 | <para>
|
---|
| 177 | <application>Xorg Server</application> should load both GPU drivers automaticaly.
|
---|
| 178 | In order to run a GLX application on a discrete GPU, you will need to export
|
---|
[c96921c] | 179 | the <envar>DRI_PRIME=1</envar> environment variable. For example,
|
---|
[0d7900a] | 180 |
|
---|
[f38727d] | 181 | <screen><userinput>DRI_PRIME=1 glxinfo | egrep "(OpenGL vendor|OpenGL renderer|OpenGL version)"</userinput></screen>
|
---|
| 182 |
|
---|
| 183 | will show OpenGL vendor, renderer and version for the discrete GPU.
|
---|
| 184 | </para>
|
---|
| 185 |
|
---|
| 186 | <para>
|
---|
[c96921c] | 187 | If the last command reports same OpenGL renderer with and without
|
---|
| 188 | <envar>DRI_PRIME=1</envar>, you will need to check your installation.
|
---|
[f38727d] | 189 | </para>
|
---|
[2001b3e] | 190 |
|
---|
| 191 | </sect2>
|
---|
| 192 |
|
---|
[d28b5ef] | 193 | <sect2 role="configuration" id='xconfig'>
|
---|
| 194 | <title>Setting up Xorg Devices</title>
|
---|
[c96921c] | 195 |
|
---|
[d28b5ef] | 196 | <para>For most hardware configurations, modern Xorg will automatically
|
---|
| 197 | get the server configuration correct without any user intervention. There
|
---|
| 198 | are, however, some cases where auto-configuration will be incorrect.
|
---|
| 199 | Following are some example manual configuration items that may be of use in
|
---|
| 200 | these instances.</para>
|
---|
| 201 |
|
---|
| 202 | <sect3 id="xinput">
|
---|
| 203 | <title>Setting up X Input Devices</title>
|
---|
| 204 | <para>For most input devices, no additional configuration will be
|
---|
| 205 | necessary. This section is provided for informational purposes only.</para>
|
---|
[0d7900a] | 206 |
|
---|
[d28b5ef] | 207 | <para>A sample default XKB setup could look like the following (executed as
|
---|
| 208 | the <systemitem class="username">root</systemitem> user):</para>
|
---|
[c96921c] | 209 |
|
---|
[d28b5ef] | 210 | <screen><userinput role="username">cat > /etc/X11/xorg.conf.d/xkb-defaults.conf << "EOF"
|
---|
| 211 | Section "InputClass"
|
---|
| 212 | Identifier "XKB Defaults"
|
---|
| 213 | MatchIsKeyboard "yes"
|
---|
| 214 | Option "XkbOptions" "terminate:ctrl_alt_bksp"
|
---|
[b194f2b] | 215 | EndSection
|
---|
[d28b5ef] | 216 | EOF</userinput></screen>
|
---|
| 217 |
|
---|
| 218 | </sect3>
|
---|
| 219 |
|
---|
| 220 | <sect3 id="xdisplay">
|
---|
| 221 | <title>Fine Tuning Display Settings</title>
|
---|
[f3429309] | 222 |
|
---|
[d28b5ef] | 223 | <para>Again, with modern Xorg, little or no additional configuration is
|
---|
| 224 | necessary. If you should need extra options passed to your video driver,
|
---|
| 225 | for instance, you could use something like the following (again, executed as
|
---|
| 226 | the <systemitem class="username">root</systemitem> user):</para>
|
---|
| 227 |
|
---|
| 228 | <screen><userinput role="root">cat > /etc/X11/xorg.conf.d/videocard-0.conf << "EOF"
|
---|
| 229 | Section "Device"
|
---|
| 230 | Identifier "Videocard0"
|
---|
| 231 | Driver "radeon"
|
---|
| 232 | VendorName "Videocard vendor"
|
---|
| 233 | BoardName "ATI Radeon 7500"
|
---|
| 234 | Option "NoAccel" "true"
|
---|
| 235 | EndSection
|
---|
| 236 | EOF</userinput></screen>
|
---|
| 237 |
|
---|
| 238 | <para>Another common setup is having multiple server layouts for use in
|
---|
| 239 | different environments. Though the server will automatically detect the
|
---|
| 240 | presence of another monitor, it may get the order incorrect:</para>
|
---|
| 241 |
|
---|
| 242 | <screen><userinput role="root">cat > /etc/X11/xorg.conf.d/server-layout.conf << "EOF"
|
---|
| 243 | Section "ServerLayout"
|
---|
| 244 | Identifier "DefaultLayout"
|
---|
| 245 | Screen 0 "Screen0" 0 0
|
---|
| 246 | Screen 1 "Screen1" LeftOf "Screen0"
|
---|
| 247 | Option "Xinerama"
|
---|
| 248 | EndSection
|
---|
| 249 | EOF</userinput></screen>
|
---|
| 250 |
|
---|
| 251 | </sect3>
|
---|
| 252 | </sect2>
|
---|
| 253 | </sect1>
|
---|