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 |
|
---|
8 | <sect1 id="xorg-config">
|
---|
9 | <?dbhtml filename="xorg-config.html"?>
|
---|
10 |
|
---|
11 | <sect1info>
|
---|
12 | <othername>$LastChangedBy$</othername>
|
---|
13 | <date>$Date$</date>
|
---|
14 | </sect1info>
|
---|
15 |
|
---|
16 | <title>Xorg-&xorg-version; Testing and Configuration</title>
|
---|
17 |
|
---|
18 | <indexterm zone="xorg-config">
|
---|
19 | <primary sortas="g-configuring-xorg">Configuring Xorg</primary>
|
---|
20 | </indexterm>
|
---|
21 |
|
---|
22 | <sect2 id='X11-testing' xreflabel="Testing Xorg">
|
---|
23 | <title>Testing Xorg</title>
|
---|
24 |
|
---|
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 |
|
---|
29 | <para>To test the <application>Xorg</application> installation, issue
|
---|
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>
|
---|
36 |
|
---|
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 |
|
---|
45 | <para>Generally, there is no specific configuration required for
|
---|
46 | <application>Xorg</application>, but customization is possible. For details
|
---|
47 | see <xref linkend='xconfig'/> below.</para>
|
---|
48 |
|
---|
49 | </sect2>
|
---|
50 |
|
---|
51 | <sect2 role="configuration" id="checking-dri" xreflabel="Checking the DRI installation">
|
---|
52 | <title>Checking the Direct Rendering Infrastructure (DRI) Installation</title>
|
---|
53 |
|
---|
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
|
---|
57 | (using <application>Mesa</application>) if you have a supported video card.
|
---|
58 | </para>
|
---|
59 |
|
---|
60 | <para>
|
---|
61 | To check if DRI drivers are installed properly, check the log file
|
---|
62 | <filename>/var/log/Xorg.0.log</filename> for statements such as:
|
---|
63 | </para>
|
---|
64 |
|
---|
65 | <screen><literal>(II) intel(0): direct rendering: DRI2 Enabled</literal></screen>
|
---|
66 |
|
---|
67 | <para>or</para>
|
---|
68 |
|
---|
69 | <screen><literal>(II) NOUVEAU(0): Loaded DRI module</literal></screen>
|
---|
70 |
|
---|
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
|
---|
76 | <ulink url="http://www.amd.com/">AMD</ulink>.
|
---|
77 | </para>
|
---|
78 | </note>
|
---|
79 |
|
---|
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>
|
---|
85 | <!--
|
---|
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>
|
---|
90 |
|
---|
91 | <screen><literal>(II) intel(0): direct rendering: DRI2 Enabled</literal></screen>
|
---|
92 | -->
|
---|
93 | <para>
|
---|
94 | If your driver is supported, add any users that might use X to that group:
|
---|
95 | </para>
|
---|
96 |
|
---|
97 | <screen role="root"><userinput>usermod -a -G video <replaceable><username></replaceable></userinput></screen>
|
---|
98 |
|
---|
99 | <para>
|
---|
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
|
---|
102 | linkend="mesa"/>. From an X terminal, run <command>glxinfo</command>
|
---|
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>
|
---|
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.
|
---|
123 | </para>
|
---|
124 |
|
---|
125 | <para>
|
---|
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
|
---|
129 | LLVMPipe just make sure that <xref linkend="llvm"/> is present at Mesa
|
---|
130 | build time. Note that all decoding is done on the CPU instead of the GPU,
|
---|
131 | so the display will run slower than with hardware acceleration.
|
---|
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:
|
---|
135 | </para>
|
---|
136 |
|
---|
137 | <screen><computeroutput>OpenGL vendor string: VMware, Inc.
|
---|
138 | OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.5, 256 bits)
|
---|
139 | OpenGL version string: 3.0 Mesa 10.4.5</computeroutput></screen>
|
---|
140 |
|
---|
141 | <para>
|
---|
142 | You can also force LLVMPipe by exporting the <envar>LIBGL_ALWAYS_SOFTWARE=1</envar>
|
---|
143 | environment variable when starting Xorg.
|
---|
144 | </para>
|
---|
145 |
|
---|
146 | <para>
|
---|
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.
|
---|
155 | </para>
|
---|
156 |
|
---|
157 | </sect2>
|
---|
158 |
|
---|
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
|
---|
172 | for your hardware and <application>Xorg Server</application> 1.13 or later
|
---|
173 | with an optional patch applied.
|
---|
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
|
---|
179 | the <envar>DRI_PRIME=1</envar> environment variable. For example,
|
---|
180 |
|
---|
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>
|
---|
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.
|
---|
189 | </para>
|
---|
190 |
|
---|
191 | </sect2>
|
---|
192 |
|
---|
193 | <sect2 role="configuration" id='xconfig'>
|
---|
194 | <title>Setting up Xorg Devices</title>
|
---|
195 |
|
---|
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>
|
---|
206 |
|
---|
207 | <para>A sample default XKB setup could look like the following (executed as
|
---|
208 | the <systemitem class="username">root</systemitem> user):</para>
|
---|
209 |
|
---|
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"
|
---|
215 | EndSection
|
---|
216 | EOF</userinput></screen>
|
---|
217 |
|
---|
218 | </sect3>
|
---|
219 |
|
---|
220 | <sect3 id="xdisplay">
|
---|
221 | <title>Fine Tuning Display Settings</title>
|
---|
222 |
|
---|
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>
|
---|