[d28b5ef] | 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 |
|
---|
[7c472863] | 8 | <sect1 id="xorg-config">
|
---|
| 9 | <?dbhtml filename="xorg-config.html"?>
|
---|
[d28b5ef] | 10 |
|
---|
| 11 | <sect1info>
|
---|
[8020e8b] | 12 | <othername>$LastChangedBy$</othername>
|
---|
| 13 | <date>$Date$</date>
|
---|
[d28b5ef] | 14 | </sect1info>
|
---|
| 15 |
|
---|
[5287b7c] | 16 | <title>Xorg-&xorg-version; Testing and Configuration</title>
|
---|
[d28b5ef] | 17 |
|
---|
[b960e3ec] | 18 | <indexterm zone="xorg-config">
|
---|
| 19 | <primary sortas="g-configuring-xorg">Configuring Xorg</primary>
|
---|
| 20 | </indexterm>
|
---|
| 21 |
|
---|
[da4b5e0] | 22 | <sect2 id='X11-testing' xreflabel="Testing Xorg">
|
---|
[5930509] | 23 | <title>Testing Xorg</title>
|
---|
[0d7900a] | 24 |
|
---|
[da4b5e0] | 25 | <note>
|
---|
| 26 | <para>
|
---|
| 27 | Before starting Xorg for the first time, is is useful to
|
---|
| 28 | rebuild the library cache by running <userinput>ldconfig</userinput>
|
---|
| 29 | as the <systemitem class="username">root</systemitem> user.
|
---|
| 30 | </para>
|
---|
| 31 | </note>
|
---|
| 32 |
|
---|
| 33 | <para>
|
---|
| 34 | To test the <application>Xorg</application> installation, issue
|
---|
| 35 | <command>startx</command>. This command brings up a rudimentary window
|
---|
| 36 | manager called <emphasis>twm</emphasis> with three xterm windows and one
|
---|
| 37 | xclock window. The xterm window in the upper left is a login terminal and
|
---|
| 38 | running <emphasis>exit</emphasis> from this terminal will exit the
|
---|
| 39 | <application>X Window</application> session. The third xterm window may
|
---|
| 40 | be obscured on your system by the other two xterms.
|
---|
| 41 | </para>
|
---|
| 42 |
|
---|
| 43 | <note>
|
---|
| 44 | <para>
|
---|
| 45 | When testing <application>Xorg</application> with the
|
---|
| 46 | <application>twm</application> window manager, there will be several
|
---|
[82bdecf] | 47 | warnings in the Xorg log file, <!--<filename revision="sysv">
|
---|
| 48 | /var/log/Xorg.0.log</filename><filename revision="systemd">-->
|
---|
| 49 | $HOME/.local/share/xorg/Xorg.0.log<!--</filename>-->, about missing font
|
---|
[da4b5e0] | 50 | files. In addition, there will be several warnings on the text mode
|
---|
| 51 | terminal (usually tty1) about missing fonts. These warnings do not
|
---|
| 52 | affect functionality, but can be removed if desired by installing
|
---|
| 53 | the <xref linkend="xorg7-legacy"/>.
|
---|
| 54 | </para>
|
---|
| 55 | </note>
|
---|
| 56 |
|
---|
| 57 | <para>
|
---|
| 58 | Generally, there is no specific configuration required for
|
---|
| 59 | <application>Xorg</application>, but customization is possible. For
|
---|
| 60 | details, see <xref linkend='xconfig'/> below.
|
---|
| 61 | </para>
|
---|
| 62 |
|
---|
| 63 | </sect2>
|
---|
| 64 |
|
---|
| 65 | <sect2 role="configuration" id="checking-dri" xreflabel="Checking the DRI
|
---|
| 66 | installation">
|
---|
[7612749] | 67 | <title>Checking the Direct Rendering Infrastructure (DRI)
|
---|
| 68 | Installation</title>
|
---|
[2001b3e] | 69 |
|
---|
[f38727d] | 70 | <para>
|
---|
[7612749] | 71 | DRI is a framework for allowing software to access graphics hardware in
|
---|
| 72 | a safe and efficient manner. It is installed in
|
---|
| 73 | <application>X</application> by default (using
|
---|
| 74 | <application>Mesa</application>) if you have a supported video card.
|
---|
[f38727d] | 75 | </para>
|
---|
| 76 |
|
---|
| 77 | <para>
|
---|
| 78 | To check if DRI drivers are installed properly, check the log file
|
---|
[7612749] | 79 | <filename revision="sysv">/var/log/Xorg.0.log</filename><filename
|
---|
| 80 | revision="systemd">$HOME/.local/share/xorg/Xorg.0.log</filename> for
|
---|
| 81 | statements such as:
|
---|
[f38727d] | 82 | </para>
|
---|
| 83 |
|
---|
| 84 | <screen><literal>(II) intel(0): direct rendering: DRI2 Enabled</literal></screen>
|
---|
| 85 |
|
---|
[c96921c] | 86 | <para>or</para>
|
---|
| 87 |
|
---|
| 88 | <screen><literal>(II) NOUVEAU(0): Loaded DRI module</literal></screen>
|
---|
| 89 |
|
---|
[f38727d] | 90 | <note>
|
---|
| 91 | <para>
|
---|
| 92 | DRI configuration may differ if you are using alternate drivers, such
|
---|
| 93 | as those from
|
---|
| 94 | <ulink url="http://www.nvidia.com/page/home.html">NVIDIA</ulink> or
|
---|
[fce3067] | 95 | <ulink url="http://www.amd.com/">AMD</ulink>.
|
---|
[f38727d] | 96 | </para>
|
---|
[2001b3e] | 97 | </note>
|
---|
| 98 |
|
---|
[cc405844] | 99 | <!-- With elogind, this is not needed anymore
|
---|
[f38727d] | 100 | <para>
|
---|
[7612749] | 101 | Although all users can use software acceleration, any hardware
|
---|
| 102 | acceleration (DRI2) is only available to <systemitem
|
---|
| 103 | class="username">root</systemitem> and members of the <systemitem
|
---|
| 104 | class="groupname">video</systemitem> group, but
|
---|
| 105 | <phrase revision="sysv"><emphasis>ConsoleKit2</emphasis></phrase>
|
---|
| 106 | <phrase revision="systemd"><emphasis>systemd-logind</emphasis></phrase>
|
---|
| 107 | takes care of adding any logged in user to the user ACL's of
|
---|
| 108 | <filename>/dev/dri/card*</filename>, the special file(s) allowing access
|
---|
| 109 | to hardware acceleration.<phrase revision="systemd"> So, no further
|
---|
| 110 | configuration is needed.</phrase>
|
---|
[f38727d] | 111 | </para>
|
---|
[2001b3e] | 112 |
|
---|
[7612749] | 113 | <para revision="sysv">
|
---|
| 114 | If your driver is supported and <emphasis>ConsoleKit2</emphasis> is not
|
---|
| 115 | installed, add any users that might use X to the <systemitem
|
---|
| 116 | class="groupname">video</systemitem> group:
|
---|
[f38727d] | 117 | </para>
|
---|
[2001b3e] | 118 |
|
---|
[7612749] | 119 | <screen role="root" revision="sysv"><userinput>usermod -a -G video <replaceable><username></replaceable></userinput></screen>
|
---|
[cc405844] | 120 | -->
|
---|
[f38727d] | 121 | <para>
|
---|
[c96921c] | 122 | Another way to determine if DRI is working properly is to use one of the
|
---|
| 123 | two optionally installed OpenGL demo programs in <xref
|
---|
[7a395d1] | 124 | linkend="mesa"/>. From an X terminal, run <command>glxinfo</command>
|
---|
[f38727d] | 125 | and look for the phrase:
|
---|
| 126 | </para>
|
---|
| 127 |
|
---|
| 128 | <screen><computeroutput>name of display: :0
|
---|
| 129 | display: :0 screen: 0
|
---|
| 130 | direct rendering: Yes</computeroutput></screen>
|
---|
| 131 |
|
---|
| 132 | <para>
|
---|
| 133 | If direct rendering is enabled, you can add verbosity by running
|
---|
[7612749] | 134 | <command>LIBGL_DEBUG=verbose glxinfo</command>. This will show the
|
---|
| 135 | drivers, device nodes and files used by the DRI system.
|
---|
[f38727d] | 136 | </para>
|
---|
| 137 |
|
---|
| 138 | <para>
|
---|
[c96921c] | 139 | To confirm that DRI2 hardware acceleration is working, you can (still in
|
---|
| 140 | the X terminal) run the command <command>glxinfo | egrep "(OpenGL
|
---|
| 141 | vendor|OpenGL renderer|OpenGL version)"</command>.
|
---|
| 142 | If that reports something <emphasis>other than</emphasis>
|
---|
| 143 | <literal>Software Rasterizer</literal> then you have working
|
---|
| 144 | acceleration for the user who ran the command.
|
---|
[f38727d] | 145 | </para>
|
---|
| 146 |
|
---|
| 147 | <para>
|
---|
[c96921c] | 148 | If your hardware does not have any DRI2 driver available, it will use a
|
---|
[7612749] | 149 | Software Rasterizer for Direct Rendering. In such cases, you can use a
|
---|
| 150 | new, LLVM-accelerated, Software Rasterizer called LLVMPipe. In order to
|
---|
| 151 | build LLVMPipe just make sure that <xref linkend="llvm"/> is present at
|
---|
| 152 | Mesa build time. Note that all decoding is done on the CPU instead of
|
---|
| 153 | the GPU, so the display will run slower than with hardware acceleration.
|
---|
| 154 | To check if you are using LLVMpipe, review the output of the glxinfo
|
---|
| 155 | command above. An example of the output using the Software Rasterizer
|
---|
| 156 | is shown below:
|
---|
[f38727d] | 157 | </para>
|
---|
| 158 |
|
---|
[c8a70a5] | 159 | <screen><computeroutput>OpenGL vendor string: VMware, Inc.
|
---|
| 160 | OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.5, 256 bits)
|
---|
[9b175e27] | 161 | OpenGL version string: 3.0 Mesa 10.4.5</computeroutput></screen>
|
---|
[f38727d] | 162 |
|
---|
| 163 | <para>
|
---|
[7612749] | 164 | You can also force LLVMPipe by exporting the
|
---|
| 165 | <envar>LIBGL_ALWAYS_SOFTWARE=1</envar> environment variable when
|
---|
| 166 | starting Xorg.
|
---|
[f38727d] | 167 | </para>
|
---|
| 168 |
|
---|
| 169 | <para>
|
---|
[c96921c] | 170 | Again, if you have built the Mesa OpenGL demos, you can also run the test
|
---|
| 171 | program <command>glxgears</command>. This program brings up a window with
|
---|
| 172 | three gears turning. The X terminal will display how many frames were
|
---|
| 173 | drawn every five seconds, so this will give a rough benchmark. The window
|
---|
| 174 | is scalable, and the frames drawn per second is highly dependent on the
|
---|
| 175 | size of the window. On some hardware, <command>glxgears</command> will
|
---|
| 176 | run synchronized with the vertical refresh signal and the frame rate will
|
---|
| 177 | be approximately the same as the monitor refresh rate.
|
---|
[f38727d] | 178 | </para>
|
---|
[2001b3e] | 179 |
|
---|
[da4b5e0] | 180 | </sect2>
|
---|
[2001b3e] | 181 |
|
---|
[da4b5e0] | 182 | <sect2 role="configuration" id="hybrid-graphics" xreflabel="Hybrid Graphics">
|
---|
[f38727d] | 183 | <title>Hybrid Graphics</title>
|
---|
| 184 |
|
---|
| 185 | <para>
|
---|
[7612749] | 186 | Hybrid Graphics is still in experimental state for Linux. Xorg Developers
|
---|
| 187 | have developed a technology called PRIME that can be used for switching
|
---|
| 188 | between integrated and muxless discrete GPU at will. Automatic switching
|
---|
| 189 | is not possible at the moment.
|
---|
[f38727d] | 190 | </para>
|
---|
| 191 |
|
---|
| 192 | <para>
|
---|
[7612749] | 193 | In order to use PRIME for GPU switching, make sure that you are using
|
---|
| 194 | Linux Kernel 3.4 or later (recommended). You will need latest DRI and
|
---|
| 195 | DDX drivers for your hardware and <application>Xorg Server</application>
|
---|
[6039a39] | 196 | 1.13 or later.
|
---|
[f38727d] | 197 | </para>
|
---|
| 198 |
|
---|
| 199 | <para>
|
---|
[7612749] | 200 | <application>Xorg Server</application> should load both GPU drivers
|
---|
[6039a39] | 201 | automaticaly. You can check that by running:
|
---|
| 202 | </para>
|
---|
| 203 |
|
---|
| 204 | <screen><userinput>xrandr --listproviders</userinput></screen>
|
---|
| 205 |
|
---|
| 206 | <para>
|
---|
| 207 | There should be two (or more) providers listed, for example:
|
---|
| 208 | </para>
|
---|
| 209 |
|
---|
| 210 | <screen><computeroutput>Providers: number : 2
|
---|
| 211 | Provider 0: id: 0x7d cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 3 outputs: 4 associated providers: 1 name:Intel
|
---|
| 212 | Provider 1: id: 0x56 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 6 outputs: 1 associated providers: 1 name:radeon</computeroutput></screen>
|
---|
| 213 |
|
---|
| 214 | <para>
|
---|
| 215 | In order to be able to run a GLX application on a discrete GPU, you will
|
---|
| 216 | need to run the following command, where <provider> is the more
|
---|
| 217 | powerful discrete card, and <sink> is the card which has a display
|
---|
| 218 | connected:
|
---|
| 219 | </para>
|
---|
| 220 |
|
---|
| 221 | <screen><userinput>xrandr --setprovideroffloadsink <replaceable><provider> <sink></replaceable></userinput></screen>
|
---|
| 222 |
|
---|
| 223 | <note>
|
---|
| 224 | <para>
|
---|
| 225 | With newer <application>Xorg</application> drivers, such as modesetting
|
---|
| 226 | or intel, which are DRI3 capable, the above command is no longer
|
---|
| 227 | necessary. It does no harm however.
|
---|
| 228 | </para>
|
---|
| 229 | </note>
|
---|
| 230 |
|
---|
| 231 | <para>
|
---|
| 232 | Then, you will need to export the <envar>DRI_PRIME=1</envar> environment
|
---|
| 233 | variable each time you want the powerful GPU to be used. For example,
|
---|
[0d7900a] | 234 |
|
---|
[f38727d] | 235 | <screen><userinput>DRI_PRIME=1 glxinfo | egrep "(OpenGL vendor|OpenGL renderer|OpenGL version)"</userinput></screen>
|
---|
| 236 |
|
---|
| 237 | will show OpenGL vendor, renderer and version for the discrete GPU.
|
---|
| 238 | </para>
|
---|
| 239 |
|
---|
| 240 | <para>
|
---|
[c96921c] | 241 | If the last command reports same OpenGL renderer with and without
|
---|
| 242 | <envar>DRI_PRIME=1</envar>, you will need to check your installation.
|
---|
[f38727d] | 243 | </para>
|
---|
[2001b3e] | 244 |
|
---|
[da4b5e0] | 245 | </sect2>
|
---|
[2001b3e] | 246 |
|
---|
[d28b5ef] | 247 | <sect2 role="configuration" id='xconfig'>
|
---|
| 248 | <title>Setting up Xorg Devices</title>
|
---|
[c96921c] | 249 |
|
---|
[da4b5e0] | 250 | <para>
|
---|
| 251 | For most hardware configurations, modern Xorg will automatically
|
---|
| 252 | get the server configuration correct without any user intervention. There
|
---|
| 253 | are, however, some cases where auto-configuration will be incorrect.
|
---|
| 254 | Following are some example manual configuration items that may be of use
|
---|
| 255 | in these instances.
|
---|
| 256 | </para>
|
---|
[d28b5ef] | 257 |
|
---|
| 258 | <sect3 id="xinput">
|
---|
[da4b5e0] | 259 | <title>Setting up X Input Devices</title>
|
---|
| 260 | <para>
|
---|
| 261 | For most input devices, no additional configuration will be
|
---|
| 262 | necessary. This section is provided for informational purposes only.
|
---|
| 263 | </para>
|
---|
[0d7900a] | 264 |
|
---|
[da4b5e0] | 265 | <para>
|
---|
| 266 | A sample default XKB setup could look like the following (executed as
|
---|
| 267 | the <systemitem class="username">root</systemitem> user):
|
---|
| 268 | </para>
|
---|
[c96921c] | 269 |
|
---|
[7612749] | 270 | <screen role="root"><userinput>cat > /etc/X11/xorg.conf.d/xkb-defaults.conf << "EOF"
|
---|
[51dfb3e] | 271 | <literal>Section "InputClass"
|
---|
[d28b5ef] | 272 | Identifier "XKB Defaults"
|
---|
| 273 | MatchIsKeyboard "yes"
|
---|
[7612749] | 274 | Option "XkbLayout" "fr"
|
---|
[d28b5ef] | 275 | Option "XkbOptions" "terminate:ctrl_alt_bksp"
|
---|
[51dfb3e] | 276 | EndSection</literal>
|
---|
[d28b5ef] | 277 | EOF</userinput></screen>
|
---|
| 278 |
|
---|
[da4b5e0] | 279 | <para>
|
---|
| 280 | The <quote>XkbLayout</quote> line is an example for a French (AZERTY)
|
---|
| 281 | keyboard. Change it to your keyboard model. That line is not needed for
|
---|
| 282 | a QWERTY (US) keyboard.
|
---|
| 283 | </para>
|
---|
| 284 | </sect3>
|
---|
[d28b5ef] | 285 |
|
---|
[da4b5e0] | 286 | <sect3 id="xdisplay">
|
---|
| 287 | <title>Fine Tuning Display Settings</title>
|
---|
[f3429309] | 288 |
|
---|
[da4b5e0] | 289 | <para>
|
---|
| 290 | Again, with modern Xorg, little or no additional configuration is
|
---|
| 291 | necessary. If you should need extra options passed to your video driver,
|
---|
| 292 | for instance, you could use something like the following (again,
|
---|
| 293 | executed as the <systemitem class="username">root</systemitem> user):
|
---|
| 294 | </para>
|
---|
[d28b5ef] | 295 |
|
---|
[da4b5e0] | 296 | <screen role="root"><userinput>cat > /etc/X11/xorg.conf.d/videocard-0.conf << "EOF"
|
---|
[51dfb3e] | 297 | <literal>Section "Device"
|
---|
[d28b5ef] | 298 | Identifier "Videocard0"
|
---|
| 299 | Driver "radeon"
|
---|
| 300 | VendorName "Videocard vendor"
|
---|
| 301 | BoardName "ATI Radeon 7500"
|
---|
| 302 | Option "NoAccel" "true"
|
---|
[51dfb3e] | 303 | EndSection</literal>
|
---|
[d28b5ef] | 304 | EOF</userinput></screen>
|
---|
| 305 |
|
---|
[da4b5e0] | 306 | <para>
|
---|
| 307 | Another common setup is having multiple server layouts for use in
|
---|
| 308 | different environments. Though the server will automatically detect the
|
---|
| 309 | presence of another monitor, it may get the order incorrect:
|
---|
| 310 | </para>
|
---|
[d28b5ef] | 311 |
|
---|
[da4b5e0] | 312 | <screen role="root"><userinput>cat > /etc/X11/xorg.conf.d/server-layout.conf << "EOF"
|
---|
[51dfb3e] | 313 | <literal>Section "ServerLayout"
|
---|
[d28b5ef] | 314 | Identifier "DefaultLayout"
|
---|
| 315 | Screen 0 "Screen0" 0 0
|
---|
| 316 | Screen 1 "Screen1" LeftOf "Screen0"
|
---|
| 317 | Option "Xinerama"
|
---|
[51dfb3e] | 318 | EndSection</literal>
|
---|
[d28b5ef] | 319 | EOF</userinput></screen>
|
---|
| 320 |
|
---|
[da4b5e0] | 321 | </sect3>
|
---|
[d28b5ef] | 322 | </sect2>
|
---|
| 323 | </sect1>
|
---|