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 revision="sysv">
|
---|
40 | /var/log/Xorg.0.log</filename><filename revision="systemd">
|
---|
41 | $HOME/.local/share/xorg/Xorg.0.log</filename>,
|
---|
42 | about missing font files. In addition, there will be several warnings on
|
---|
43 | the text mode terminal (usually tty1) about missing fonts. These warnings
|
---|
44 | do not affect functionality, but can be removed if desired by installing
|
---|
45 | the <xref linkend="xorg7-legacy"/>.</para></note>
|
---|
46 |
|
---|
47 | <para>Generally, there is no specific configuration required for
|
---|
48 | <application>Xorg</application>, but customization is possible. For details
|
---|
49 | see <xref linkend='xconfig'/> below.</para>
|
---|
50 |
|
---|
51 | </sect2>
|
---|
52 |
|
---|
53 | <sect2 role="configuration" id="checking-dri" xreflabel="Checking the DRI installation">
|
---|
54 | <title>Checking the Direct Rendering Infrastructure (DRI)
|
---|
55 | Installation</title>
|
---|
56 |
|
---|
57 | <para>
|
---|
58 | DRI is a framework for allowing software to access graphics hardware in
|
---|
59 | a safe and efficient manner. It is installed in
|
---|
60 | <application>X</application> by default (using
|
---|
61 | <application>Mesa</application>) if you have a supported video card.
|
---|
62 | </para>
|
---|
63 |
|
---|
64 | <para>
|
---|
65 | To check if DRI drivers are installed properly, check the log file
|
---|
66 | <filename revision="sysv">/var/log/Xorg.0.log</filename><filename
|
---|
67 | revision="systemd">$HOME/.local/share/xorg/Xorg.0.log</filename> for
|
---|
68 | statements such as:
|
---|
69 | </para>
|
---|
70 |
|
---|
71 | <screen><literal>(II) intel(0): direct rendering: DRI2 Enabled</literal></screen>
|
---|
72 |
|
---|
73 | <para>or</para>
|
---|
74 |
|
---|
75 | <screen><literal>(II) NOUVEAU(0): Loaded DRI module</literal></screen>
|
---|
76 |
|
---|
77 | <note>
|
---|
78 | <para>
|
---|
79 | DRI configuration may differ if you are using alternate drivers, such
|
---|
80 | as those from
|
---|
81 | <ulink url="http://www.nvidia.com/page/home.html">NVIDIA</ulink> or
|
---|
82 | <ulink url="http://www.amd.com/">AMD</ulink>.
|
---|
83 | </para>
|
---|
84 | </note>
|
---|
85 |
|
---|
86 | <para>
|
---|
87 | Although all users can use software acceleration, any hardware
|
---|
88 | acceleration (DRI2) is only available to <systemitem
|
---|
89 | class="username">root</systemitem> and members of the <systemitem
|
---|
90 | class="groupname">video</systemitem> group, but
|
---|
91 | <phrase revision="sysv"><emphasis>ConsoleKit2</emphasis></phrase>
|
---|
92 | <phrase revision="systemd"><emphasis>systemd-logind</emphasis></phrase>
|
---|
93 | takes care of adding any logged in user to the user ACL's of
|
---|
94 | <filename>/dev/dri/card*</filename>, the special file(s) allowing access
|
---|
95 | to hardware acceleration.<phrase revision="systemd"> So, no further
|
---|
96 | configuration is needed.</phrase>
|
---|
97 | </para>
|
---|
98 |
|
---|
99 | <para revision="sysv">
|
---|
100 | If your driver is supported and <emphasis>ConsoleKit2</emphasis> is not
|
---|
101 | installed, add any users that might use X to the <systemitem
|
---|
102 | class="groupname">video</systemitem> group:
|
---|
103 | </para>
|
---|
104 |
|
---|
105 | <screen role="root" revision="sysv"><userinput>usermod -a -G video <replaceable><username></replaceable></userinput></screen>
|
---|
106 |
|
---|
107 | <para>
|
---|
108 | Another way to determine if DRI is working properly is to use one of the
|
---|
109 | two optionally installed OpenGL demo programs in <xref
|
---|
110 | linkend="mesa"/>. From an X terminal, run <command>glxinfo</command>
|
---|
111 | and look for the phrase:
|
---|
112 | </para>
|
---|
113 |
|
---|
114 | <screen><computeroutput>name of display: :0
|
---|
115 | display: :0 screen: 0
|
---|
116 | direct rendering: Yes</computeroutput></screen>
|
---|
117 |
|
---|
118 | <para>
|
---|
119 | If direct rendering is enabled, you can add verbosity by running
|
---|
120 | <command>LIBGL_DEBUG=verbose glxinfo</command>. This will show the
|
---|
121 | drivers, device nodes and files used by the DRI system.
|
---|
122 | </para>
|
---|
123 |
|
---|
124 | <para>
|
---|
125 | To confirm that DRI2 hardware acceleration is working, you can (still in
|
---|
126 | the X terminal) run the command <command>glxinfo | egrep "(OpenGL
|
---|
127 | vendor|OpenGL renderer|OpenGL version)"</command>.
|
---|
128 | If that reports something <emphasis>other than</emphasis>
|
---|
129 | <literal>Software Rasterizer</literal> then you have working
|
---|
130 | acceleration for the user who ran the command.
|
---|
131 | </para>
|
---|
132 |
|
---|
133 | <para>
|
---|
134 | If your hardware does not have any DRI2 driver available, it will use a
|
---|
135 | Software Rasterizer for Direct Rendering. In such cases, you can use a
|
---|
136 | new, LLVM-accelerated, Software Rasterizer called LLVMPipe. In order to
|
---|
137 | build LLVMPipe just make sure that <xref linkend="llvm"/> is present at
|
---|
138 | Mesa build time. Note that all decoding is done on the CPU instead of
|
---|
139 | the GPU, so the display will run slower than with hardware acceleration.
|
---|
140 | To check if you are using LLVMpipe, review the output of the glxinfo
|
---|
141 | command above. An example of the output using the Software Rasterizer
|
---|
142 | is shown below:
|
---|
143 | </para>
|
---|
144 |
|
---|
145 | <screen><computeroutput>OpenGL vendor string: VMware, Inc.
|
---|
146 | OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.5, 256 bits)
|
---|
147 | OpenGL version string: 3.0 Mesa 10.4.5</computeroutput></screen>
|
---|
148 |
|
---|
149 | <para>
|
---|
150 | You can also force LLVMPipe by exporting the
|
---|
151 | <envar>LIBGL_ALWAYS_SOFTWARE=1</envar> environment variable when
|
---|
152 | starting Xorg.
|
---|
153 | </para>
|
---|
154 |
|
---|
155 | <para>
|
---|
156 | Again, if you have built the Mesa OpenGL demos, you can also run the test
|
---|
157 | program <command>glxgears</command>. This program brings up a window with
|
---|
158 | three gears turning. The X terminal will display how many frames were
|
---|
159 | drawn every five seconds, so this will give a rough benchmark. The window
|
---|
160 | is scalable, and the frames drawn per second is highly dependent on the
|
---|
161 | size of the window. On some hardware, <command>glxgears</command> will
|
---|
162 | run synchronized with the vertical refresh signal and the frame rate will
|
---|
163 | be approximately the same as the monitor refresh rate.
|
---|
164 | </para>
|
---|
165 |
|
---|
166 | </sect2>
|
---|
167 |
|
---|
168 | <sect2 role="configuration" id="hybrid-graphics" xreflabel="Hybrid
|
---|
169 | Graphics">
|
---|
170 | <title>Hybrid Graphics</title>
|
---|
171 |
|
---|
172 | <para>
|
---|
173 | Hybrid Graphics is still in experimental state for Linux. Xorg Developers
|
---|
174 | have developed a technology called PRIME that can be used for switching
|
---|
175 | between integrated and muxless discrete GPU at will. Automatic switching
|
---|
176 | is not possible at the moment.
|
---|
177 | </para>
|
---|
178 |
|
---|
179 | <para>
|
---|
180 | In order to use PRIME for GPU switching, make sure that you are using
|
---|
181 | Linux Kernel 3.4 or later (recommended). You will need latest DRI and
|
---|
182 | DDX drivers for your hardware and <application>Xorg Server</application>
|
---|
183 | 1.13 or later with an optional patch applied.
|
---|
184 | </para>
|
---|
185 |
|
---|
186 | <para>
|
---|
187 | <application>Xorg Server</application> should load both GPU drivers
|
---|
188 | automaticaly. In order to run a GLX application on a discrete GPU, you
|
---|
189 | will need to export the <envar>DRI_PRIME=1</envar> environment variable.
|
---|
190 | For example,
|
---|
191 |
|
---|
192 | <screen><userinput>DRI_PRIME=1 glxinfo | egrep "(OpenGL vendor|OpenGL renderer|OpenGL version)"</userinput></screen>
|
---|
193 |
|
---|
194 | will show OpenGL vendor, renderer and version for the discrete GPU.
|
---|
195 | </para>
|
---|
196 |
|
---|
197 | <para>
|
---|
198 | If the last command reports same OpenGL renderer with and without
|
---|
199 | <envar>DRI_PRIME=1</envar>, you will need to check your installation.
|
---|
200 | </para>
|
---|
201 |
|
---|
202 | </sect2>
|
---|
203 |
|
---|
204 | <sect2 role="configuration" id='xconfig'>
|
---|
205 | <title>Setting up Xorg Devices</title>
|
---|
206 |
|
---|
207 | <para>For most hardware configurations, modern Xorg will automatically
|
---|
208 | get the server configuration correct without any user intervention. There
|
---|
209 | are, however, some cases where auto-configuration will be incorrect.
|
---|
210 | Following are some example manual configuration items that may be of use in
|
---|
211 | these instances.</para>
|
---|
212 |
|
---|
213 | <sect3 id="xinput">
|
---|
214 | <title>Setting up X Input Devices</title>
|
---|
215 | <para>For most input devices, no additional configuration will be
|
---|
216 | necessary. This section is provided for informational purposes only.</para>
|
---|
217 |
|
---|
218 | <para>A sample default XKB setup could look like the following (executed as
|
---|
219 | the <systemitem class="username">root</systemitem> user):</para>
|
---|
220 |
|
---|
221 | <screen role="root"><userinput>cat > /etc/X11/xorg.conf.d/xkb-defaults.conf << "EOF"
|
---|
222 | Section "InputClass"
|
---|
223 | Identifier "XKB Defaults"
|
---|
224 | MatchIsKeyboard "yes"
|
---|
225 | Option "XkbLayout" "fr"
|
---|
226 | Option "XkbOptions" "terminate:ctrl_alt_bksp"
|
---|
227 | EndSection
|
---|
228 | EOF</userinput></screen>
|
---|
229 |
|
---|
230 | <para>
|
---|
231 | The <quote>XkbLayout</quote> line is an example for a French (AZERTY)
|
---|
232 | keyboard. Change it to your keyboard model. That line is not needed for
|
---|
233 | a QWERTY (US/GB) keyboard.
|
---|
234 | </para>
|
---|
235 | </sect3>
|
---|
236 |
|
---|
237 | <sect3 id="xdisplay">
|
---|
238 | <title>Fine Tuning Display Settings</title>
|
---|
239 |
|
---|
240 | <para>Again, with modern Xorg, little or no additional configuration is
|
---|
241 | necessary. If you should need extra options passed to your video driver,
|
---|
242 | for instance, you could use something like the following (again, executed as
|
---|
243 | the <systemitem class="username">root</systemitem> user):</para>
|
---|
244 |
|
---|
245 | <screen><userinput role="root">cat > /etc/X11/xorg.conf.d/videocard-0.conf << "EOF"
|
---|
246 | Section "Device"
|
---|
247 | Identifier "Videocard0"
|
---|
248 | Driver "radeon"
|
---|
249 | VendorName "Videocard vendor"
|
---|
250 | BoardName "ATI Radeon 7500"
|
---|
251 | Option "NoAccel" "true"
|
---|
252 | EndSection
|
---|
253 | EOF</userinput></screen>
|
---|
254 |
|
---|
255 | <para>Another common setup is having multiple server layouts for use in
|
---|
256 | different environments. Though the server will automatically detect the
|
---|
257 | presence of another monitor, it may get the order incorrect:</para>
|
---|
258 |
|
---|
259 | <screen><userinput role="root">cat > /etc/X11/xorg.conf.d/server-layout.conf << "EOF"
|
---|
260 | Section "ServerLayout"
|
---|
261 | Identifier "DefaultLayout"
|
---|
262 | Screen 0 "Screen0" 0 0
|
---|
263 | Screen 1 "Screen1" LeftOf "Screen0"
|
---|
264 | Option "Xinerama"
|
---|
265 | EndSection
|
---|
266 | EOF</userinput></screen>
|
---|
267 |
|
---|
268 | </sect3>
|
---|
269 | </sect2>
|
---|
270 | </sect1>
|
---|