source: x/installing/xorg-config.xml@ 01ce9b4f

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 01ce9b4f was 01ce9b4f, checked in by Ken Moffat <ken@…>, 8 years ago

Change the link to my font-analysis website. Unfortunately, producing updated data is taking longer than I anticipated, so for the moment the contents are still the old stuff from three years ago.

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

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