source: x/installing/xorg-config.xml@ 2001b3e

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 2001b3e was 2001b3e, checked in by Ken Moffat <ken@…>, 12 years ago

Reinstate some of the DRI explanation, expanded to mention DRI2 hardware video acceleration.

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

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