source: x/installing/xorg-config.xml@ 9b175e27

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.7 7.8 7.9 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 9b175e27 was 9b175e27, checked in by Bruce Dubbs <bdubbs@…>, 9 years ago

Finish tagging!
Minor edits and corrections.
Add kernel config to cheese

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

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