source: x/installing/xorg-config.xml@ f38727d

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since f38727d was f38727d, checked in by Krejzi <krejzi@…>, 11 years ago

Rework Xorg configuration a bit.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@10909 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 18.0 KB
Line 
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 <para>To test the <application>Xorg</application> installation, issue
26 <userinput>startx</userinput>. This command brings up a rudimentary window
27 manager called <emphasis>twm</emphasis> with three xterm windows and one
28 xclock window. The xterm window in the upper left is a login terminal and
29 running <emphasis>exit</emphasis> from this terminal will exit the
30 <application>X Window</application> session. The third xterm window may be
31 obscured on your system by the other two xterms.</para>
32
33 <para>Generally, there is no specific configuration required for
34 <application>Xorg</application>, but customization is possible. For details
35 see <xref linkend='xconfig'/> below.</para>
36
37 </sect2>
38
39 <sect2 role="configuration" id="checking-dri" xreflabel="Checking the DRI installation">
40 <title>Checking the Direct Rendering Infrastructure (DRI) Installation</title>
41
42 <para>
43 DRI is a framework for allowing software to access graphics hardware in a safe and
44 efficient manner. It is installed in <application>X</application> by default
45 (using <application>MesaLib</application>) if you have a supported video card.
46 </para>
47
48 <para>
49 To check if DRI drivers are installed properly, check the log file
50 <filename>/var/log/Xorg.0.log</filename> for statements like:
51 </para>
52
53<screen><literal>(II) intel(0): direct rendering: DRI2 Enabled</literal></screen>
54
55 <note>
56 <para>
57 DRI configuration may differ if you are using alternate drivers, such
58 as those from
59 <ulink url="http://www.nvidia.com/page/home.html">NVIDIA</ulink> or
60 <ulink url="http://www.ati.com/">ATI</ulink>.
61 </para>
62 </note>
63
64 <para>
65 Although all users can use software acceleration, any hardware acceleration (DRI2)
66 is only available to <systemitem class="username">root</systemitem> and members
67 of the <systemitem class="groupname">video</systemitem> group.
68 </para>
69
70 <para>
71 To see if hardware acceleration is available for your driver, look in
72 <filename>/var/log/Xorg.0.log</filename> for statements like:
73 </para>
74
75<screen><literal>(II) intel(0): direct rendering: DRI2 Enabled</literal></screen>
76
77 <para>
78 If your driver is supported, add any users that might use X to that group:
79 </para>
80
81<screen role="root"><userinput>usermod -a -G video <replaceable>&lt;username&gt;</replaceable></userinput></screen>
82
83 <para>
84 If you have installed two OpenGL demo programs when you installed
85 <xref linkend="mesalib"/>, from an X terminal, run <command>glxinfo</command>
86 and look for the phrase:
87 </para>
88
89<screen><computeroutput>name of display: :0
90display: :0 screen: 0
91direct rendering: Yes</computeroutput></screen>
92
93 <para>
94 If direct rendering is enabled, you can add verbosity by running
95 <command>LIBGL_DEBUG=verbose glxinfo</command>. This will show the drivers,
96 device nodes and files used by the DRI system.
97 </para>
98
99 <para>
100 If DRI2 is enabled, to confirm that DRI2 hardware acceleration is working you can
101 (still in the X terminal) run the command
102 <command>glxinfo | egrep "(OpenGL vendor|OpenGL renderer|OpenGL version)"</command>
103 - if that reports something <emphasis>other than</emphasis>
104 <literal>Software Rasterizer</literal> then you have working acceleration for the
105 user who ran the command.
106 </para>
107
108 <para>
109 If your hardware does not have any DRI2 driver available, it will use Software Rasterizer
110 for Direct Rendering. In such cases, it is recommended that you use new, LLVM-accelerated,
111 Software Rasterizer called LLVMPipe. In order to build LLVMPipe just make sure that
112 <xref linkend="llvm"/> is present at MesaLib build time. Please note that all decoding is
113 done on CPU instead of GPU, so expect that things run slower. To check if you are using
114 LLVMpipe, run
115 <command>glxinfo | egrep "(OpenGL vendor|OpenGL renderer|OpenGL version)"</command>.
116 An example output is shown below:
117 </para>
118
119<screen><computeroutput>OpenGL vendor string: VMware, Inc.
120OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.2, 256 bits)
121OpenGL version string: 2.1 Mesa 9.1-devel (git-cb3b172)</computeroutput></screen>
122
123 <para>
124 You can always force LLVMPipe by exporting <envar>LIBGL_ALWAYS_SOFTWARE=1</envar>
125 environment variable.
126 </para>
127
128 <para>
129 Again, if you have built Mesa OpenGL demos, you can also run the test program
130 <command>glxgears</command>. This program brings up a window with three gears
131 turning. The X terminal will display how many frames were drawn every five
132 seconds, so this is a reasonable benchmark. The window is scalable, and the
133 frames drawn per second is highly dependent on the size of the window. On some
134 hardware, <command>glxgears</command> will run synchronized to vertical refresh
135 and framerate will be approximately the same as the monitor refresh rate.
136 </para>
137
138 </sect2>
139
140 <sect2 role="configuration" id="hybrid-graphics" xreflabel="Hybrid Graphics">
141 <title>Hybrid Graphics</title>
142
143 <para>
144 Hybrid Graphics is still in experimental state for Linux. Xorg Developers have
145 developed a technology called PRIME that can be used for switching between
146 integrated and muxless discrete GPU at will. Automatic switching is not
147 possible at the moment.
148 </para>
149
150 <para>
151 In order to use PRIME for GPU switching, make sure that you are using Linux
152 Kernel 3.4 or later (recommended). You will need latest DRI and DDX drivers
153 for your hardware and <application>Xorg Server</application> 1.13 with an
154 optional patch applied.
155 </para>
156
157 <para>
158 <application>Xorg Server</application> should load both GPU drivers automaticaly.
159 In order to run a GLX application on a discrete GPU, you will need to export
160 <envar>DRI_PRIME=1</envar> environment variable. For example,
161
162<screen><userinput>DRI_PRIME=1 glxinfo | egrep "(OpenGL vendor|OpenGL renderer|OpenGL version)"</userinput></screen>
163
164 will show OpenGL vendor, renderer and version for the discrete GPU.
165 </para>
166
167 <para>
168 If the last command reports same OpenGL renderer with and without <envar>DRI_PRIME=1</envar>,
169 you will need to check your installation.
170 </para>
171
172 </sect2>
173
174<!--
175 <sect2 role="configuration" id='X11R6-compat-symlink'
176 xreflabel="Creating an X11R6 Compatibility Symlink">
177
178 <title>Creating an X11R6 Compatibility Symlink</title>
179
180 <para>Until recently (relatively speaking) almost every
181 <application>X Window</application> installation you performed or came
182 across was installed in the
183 <filename class='directory'>/usr/X11R6</filename> directory. That was the
184 standard for years. Developers picked up on this and wrote their package
185 installation scripts looking for <application>X</application> in the
186 standard location. Things have changed and the trend is to now install
187 <application>X</application> in
188 <filename class='directory'>/usr</filename>. Some people want to install
189 it in a custom location.</para>
190
191 <para>Many package developers have not caught up to the change and their
192 packages are still trying to find <application>X</application> in
193 <filename class='directory'>/usr/X11R6</filename> and subsequently fail
194 when you try to build the package. Though for most packages it is not
195 difficult to 'hack' the installation script to fix the problem, that is not
196 the long term solution to the problem. Upstream developers need to modernize
197 their installation scripts and eliminate the problem altogether.</para>
198
199 <para>Until then, you can create a symbolic link to satisfy the
200 <filename class='directory'>/usr/X11R6</filename> requirement so that you
201 won't be inconvenienced with a package build failure due to this known
202 issue. If you wish to create the symlink, issue the following command as
203 the <systemitem class="username">root</systemitem>:</para>
204
205<screen role="root"><userinput>ln -vsf $XORG_PREFIX /usr/X11R6</userinput></screen>
206
207 </sect2>
208-->
209
210 <sect2 role="configuration" id="xft-font-protocol" xreflabel="Xft Font Protocol">
211 <title>Xft Font Protocol</title>
212
213 <indexterm zone="xft-font-protocol" id="fonts">
214 <primary sortas="g-truetype">TrueType Fonts</primary>
215 </indexterm>
216
217 <para>Xft provides antialiased font rendering through
218 <application>Freetype</application>, and fonts are controlled from the
219 client side using <application>Fontconfig</application>. The default
220 search path is <filename class="directory">/usr/share/fonts</filename>
221 and <filename class="directory">~/.fonts</filename>.
222 <application>Fontconfig</application> searches directories in its
223 path recursively and maintains a cache of the font characteristics in
224 <filename>fonts.cache-1</filename> files in each directory. If the cache
225 appears to be out of date, it is ignored, and information is (slowly)
226 fetched from the fonts themselves. This cache
227 can be regenerated using the <command>fc-cache</command> command at any
228 time. You can see the list of fonts known by
229 <application>Fontconfig</application> by running the command
230 <command>fc-list</command>.</para>
231
232 <para>If you've installed <application>Xorg</application> in any prefix
233 other than <filename class="directory">/usr</filename>, the
234 <application>X</application> fonts were not installed in a
235 location known to <application>Fontconfig</application>. This prevents
236 <application>Fontconfig</application> from using the poorly rendered
237 Type 1 fonts or the non-scalable bitmapped fonts. Symlinks were created
238 from the <filename class="directory">OTF</filename> and <filename
239 class="directory">TTF</filename> <application>X</application> font
240 directories to <filename
241 class="directory">/usr/share/fonts/X11-{OTF,TTF}</filename>. This allows
242 <application>Fontconfig</application> to use the OpenType and TrueType
243 fonts provided by <application>X</application> (which are scalable and
244 of higher quality).</para>
245
246 <para><application>Fontconfig</application> uses names such as
247 "Monospace 12" to define fonts. Applications generally use generic font
248 names such as "Monospace", "Sans" and "Serif".
249 <application>Fontconfig</application> resolves these names to a font that
250 has all characters that cover the orthography of the language indicated
251 by the locale settings. Knowledge of these font names is included in
252 <filename>/etc/fonts/fonts.conf</filename>. Fonts that are not listed
253 in this file are still usable by <application>Fontconfig</application>,
254 but they will not be accessible by the generic family names.</para>
255
256 <para>Standard scalable fonts that come with <application>X</application>
257 provide very poor Unicode coverage. You may notice in applications that
258 use <application>Xft</application> that some characters appear as a box
259 with four binary digits inside. In this case, a font set with the
260 available glyphs has not been found. Other times, applications that
261 don't use other font families by default and don't accept substitutions
262 from <application>Fontconfig</application> will display blank lines when
263 the default font doesn't cover the orthography of the user's language.
264 This happens, e.g., with <application>Fluxbox</application> in the
265 ru_RU.KOI8-R locale.</para>
266
267 <para>In order to provide greater Unicode coverage, it is recommended
268 that you install these fonts:</para>
269
270 <itemizedlist>
271 <listitem>
272 <para><ulink url="http://dejavu.sourceforge.net/">DejaVu fonts</ulink>
273 - These fonts are replacements for the Bitstream Vera fonts and
274 provide Latin-based scripts with accents and Cyrillic glyphs.</para>
275 </listitem>
276 <listitem>
277 <para><ulink
278 url="http://download.savannah.nongnu.org/releases/freefont/">FreeFont</ulink>
279 - This set of fonts covers nearly every non-CJK character, but is not
280 visually pleasing. <application>Fontconfig</application> will use it
281 as a last resort to substitute generic font family names.</para>
282 </listitem>
283 <listitem>
284 <para><ulink
285 url="http://corefonts.sourceforge.net/">Microsoft Core fonts</ulink>
286 - These fonts provide slightly worse Unicode coverage than FreeFont,
287 but are better hinted. Be sure to read the license before using
288 them. These fonts are listed in the aliases in the
289 <filename class="directory">/etc/fonts/fonts.d</filename> directory
290 by default.</para>
291 </listitem>
292 <listitem>
293 <para><ulink
294 url="http://cle.linux.org.tw/fonts/FireFly">Firefly New Sung font</ulink>
295 - This font provides Chinese coverage. This font is listed in the
296 aliases in the
297 the <filename class="directory">/etc/fonts/fonts.d</filename>
298 directory by default.</para>
299 </listitem>
300 <listitem>
301 <para><ulink
302 url="http://cle.linux.org.tw/fonts/Arphic">Arphic fonts</ulink> -
303 A similar set of Chinese fonts to the Firefly New Sung font.
304 These fonts are listed in the aliases in the
305 <filename class="directory">/etc/fonts/fonts.d</filename> directory
306 by default.</para>
307 </listitem>
308 <listitem>
309 <para><ulink
310 url="http://sourceforge.jp/projects/efont/">Kochi fonts</ulink> -
311 These provide Japanese characters, and are listed in the aliases
312 in the <filename class="directory">/etc/fonts/fonts.d</filename>
313 directory by default.</para>
314 </listitem>
315 <listitem>
316 <para><ulink
317 url="http://kldp.net/projects/baekmuk/">Baekmuk fonts</ulink>
318 - These fonts provide Korean coverage, and are listed in the
319 aliases in the
320 <filename class="directory">/etc/fonts/fonts.d</filename> directory
321 by default.</para>
322 </listitem>
323 <listitem>
324 <para><ulink
325 url="&gnome-download-http;/cantarell-fonts/0.0/">Cantarell fonts</ulink>
326 - The Cantarell typeface family provides a contemporary Humanist sans
327 serif. It is particularly optimised for legibility at small sizes and is
328 the preferred font family for the <application>GNOME-3</application> user
329 interface.</para>
330 </listitem>
331 </itemizedlist>
332
333 <para>The list above will not provide complete Unicode coverage. For
334 more information, please visit the <ulink
335 url="http://unifont.org/fontguide/">Unicode Font Guide</ulink>.</para>
336
337 <para>As an example, consider the installation of the DejaVu fonts. From
338 the unpacked source directory, run the following commands as the
339 <systemitem class="username">root</systemitem> user:</para>
340
341<screen role="root"><userinput>install -v -d -m755 /usr/share/fonts/dejavu &amp;&amp;
342install -v -m644 *.ttf /usr/share/fonts/dejavu &amp;&amp;
343fc-cache -v /usr/share/fonts/dejavu</userinput></screen>
344
345 </sect2>
346
347 <sect2 role="configuration" id='xconfig'>
348 <title>Setting up Xorg Devices</title>
349 <para>For most hardware configurations, modern Xorg will automatically
350 get the server configuration correct without any user intervention. There
351 are, however, some cases where auto-configuration will be incorrect.
352 Following are some example manual configuration items that may be of use in
353 these instances.</para>
354
355 <sect3 id="xinput">
356 <title>Setting up X Input Devices</title>
357 <para>For most input devices, no additional configuration will be
358 necessary. This section is provided for informational purposes only.</para>
359
360 <para>A sample default XKB setup could look like the following (executed as
361 the <systemitem class="username">root</systemitem> user):</para>
362<screen><userinput role="username">cat &gt; /etc/X11/xorg.conf.d/xkb-defaults.conf &lt;&lt; "EOF"
363Section "InputClass"
364 Identifier "XKB Defaults"
365 MatchIsKeyboard "yes"
366 Option "XkbOptions" "terminate:ctrl_alt_bksp"
367EOF</userinput></screen>
368
369 </sect3>
370
371 <sect3 id="xdisplay">
372 <title>Fine Tuning Display Settings</title>
373 <para>Again, with modern Xorg, little or no additional configuration is
374 necessary. If you should need extra options passed to your video driver,
375 for instance, you could use something like the following (again, executed as
376 the <systemitem class="username">root</systemitem> user):</para>
377
378<screen><userinput role="root">cat &gt; /etc/X11/xorg.conf.d/videocard-0.conf &lt;&lt; "EOF"
379Section "Device"
380 Identifier "Videocard0"
381 Driver "radeon"
382 VendorName "Videocard vendor"
383 BoardName "ATI Radeon 7500"
384 Option "NoAccel" "true"
385EndSection
386EOF</userinput></screen>
387
388 <para>Another common setup is having multiple server layouts for use in
389 different environments. Though the server will automatically detect the
390 presence of another monitor, it may get the order incorrect:</para>
391
392<screen><userinput role="root">cat &gt; /etc/X11/xorg.conf.d/server-layout.conf &lt;&lt; "EOF"
393Section "ServerLayout"
394 Identifier "DefaultLayout"
395 Screen 0 "Screen0" 0 0
396 Screen 1 "Screen1" LeftOf "Screen0"
397 Option "Xinerama"
398EndSection
399EOF</userinput></screen>
400
401 </sect3>
402 </sect2>
403</sect1>
Note: See TracBrowser for help on using the repository browser.