1 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
2 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
3 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
4 | %general-entities;
|
---|
5 | ]>
|
---|
6 |
|
---|
7 | <sect1 id="xorg-config">
|
---|
8 | <?dbhtml filename="xorg-config.html"?>
|
---|
9 |
|
---|
10 |
|
---|
11 | <title>Xorg-&xorg-version; Testing and Configuration</title>
|
---|
12 |
|
---|
13 | <indexterm zone="xorg-config">
|
---|
14 | <primary sortas="g-configuring-xorg">Configuring Xorg</primary>
|
---|
15 | </indexterm>
|
---|
16 |
|
---|
17 | <sect2 id='X11-testing' xreflabel="Testing Xorg">
|
---|
18 | <title>Testing Xorg</title>
|
---|
19 |
|
---|
20 | <note>
|
---|
21 | <para>
|
---|
22 | Before starting Xorg for the first time, is useful to
|
---|
23 | rebuild the library cache by running <userinput>ldconfig</userinput>
|
---|
24 | as the <systemitem class="username">root</systemitem> user.
|
---|
25 | </para>
|
---|
26 | </note>
|
---|
27 |
|
---|
28 | <note>
|
---|
29 | <para>
|
---|
30 | Before starting Xorg for the first time, is often needed to
|
---|
31 | reboot the system to ensure all appropriate daemons are started
|
---|
32 | and appropriate security issues are properly set.
|
---|
33 | As an alternative, logging out and logging back in may work, but as
|
---|
34 | of this writing has not been tested.
|
---|
35 | </para>
|
---|
36 | </note>
|
---|
37 |
|
---|
38 | <warning>
|
---|
39 | <para>
|
---|
40 | If Xorg hangs for some reason (for example, lacking a proper
|
---|
41 | input driver), the system may stop responding to any user input.
|
---|
42 | As a precaution, you can enable a magic <keycap>SysRq</keycap> key
|
---|
43 | before testing Xorg. As the
|
---|
44 | <systemitem class="username">root</systemitem> user, issue:
|
---|
45 | </para>
|
---|
46 |
|
---|
47 | <screen><userinput>echo 4 > /proc/sys/kernel/sysrq</userinput></screen>
|
---|
48 |
|
---|
49 | <para>
|
---|
50 | Then if Xorg hangs, it's possible to use
|
---|
51 | <keycombo>
|
---|
52 | <keycap>Alt</keycap>
|
---|
53 | <keycap>SysRq</keycap>
|
---|
54 | <keycap>R</keycap>
|
---|
55 | </keycombo>
|
---|
56 | to reset the keyboard mode. Now it should be able to use
|
---|
57 | <keycombo>
|
---|
58 | <keycap>Ctrl</keycap>
|
---|
59 | <keycap>Alt</keycap>
|
---|
60 | <keycap>Fx</keycap>
|
---|
61 | </keycombo>
|
---|
62 | (replace x with a VT number) to switch to another VT.
|
---|
63 | If it works, login and kill Xorg using command line in the new VT.
|
---|
64 | </para>
|
---|
65 | </warning>
|
---|
66 |
|
---|
67 | <para>
|
---|
68 | To test the <application>Xorg</application> installation, issue
|
---|
69 | <command>startx</command>. This command brings up a rudimentary window
|
---|
70 | manager called <emphasis>twm</emphasis> with three xterm windows and one
|
---|
71 | xclock window. The xterm window in the upper left is a login terminal and
|
---|
72 | running <emphasis>exit</emphasis> from this terminal will exit the
|
---|
73 | <application>X Window</application> session. The third xterm window may
|
---|
74 | be obscured on your system by the other two xterms.
|
---|
75 | </para>
|
---|
76 |
|
---|
77 | <note>
|
---|
78 | <para>
|
---|
79 | When testing <application>Xorg</application> with the
|
---|
80 | <application>twm</application> window manager, there will be several
|
---|
81 | warnings in the Xorg log file, <!--<filename revision="sysv">
|
---|
82 | /var/log/Xorg.0.log</filename><filename revision="systemd">-->
|
---|
83 | $HOME/.local/share/xorg/Xorg.0.log<!--</filename>-->, about missing font
|
---|
84 | files. In addition, there will be several warnings on the text mode
|
---|
85 | terminal (usually tty1) about missing fonts. These warnings do not
|
---|
86 | affect functionality, but can be removed if desired by installing
|
---|
87 | the <xref linkend="xorg7-legacy"/>.
|
---|
88 | </para>
|
---|
89 | </note>
|
---|
90 |
|
---|
91 | <note>
|
---|
92 | <para>
|
---|
93 | On systems with NVIDIA GPUs which are using the Nouveau kernel driver,
|
---|
94 | you may encounter occasional GPU crashes and hangs. If this problem
|
---|
95 | occurs, downgrade to the latest version of the Linux 6.1 kernel.
|
---|
96 | <!--https://gitlab.freedesktop.org/drm/nouveau/-/issues/257-->
|
---|
97 | </para>
|
---|
98 | </note>
|
---|
99 |
|
---|
100 | <para>
|
---|
101 | Generally, there is no specific configuration required for
|
---|
102 | <application>Xorg</application>, but customization is possible. For
|
---|
103 | details, see <xref linkend='xconfig'/> below.
|
---|
104 | </para>
|
---|
105 |
|
---|
106 | </sect2>
|
---|
107 |
|
---|
108 | <sect2 role="configuration" id="checking-dri" xreflabel="Checking the DRI
|
---|
109 | installation">
|
---|
110 | <title>Checking the Direct Rendering Infrastructure (DRI)
|
---|
111 | Installation</title>
|
---|
112 |
|
---|
113 | <para>
|
---|
114 | DRI is a framework for allowing software to access graphics hardware in
|
---|
115 | a safe and efficient manner. It is installed in
|
---|
116 | <application>X</application> by default (using
|
---|
117 | <application>Mesa</application>) if you have a supported video card.
|
---|
118 | </para>
|
---|
119 |
|
---|
120 | <para>
|
---|
121 | To check if DRI drivers are installed properly, check the log file
|
---|
122 | <filename>$HOME/.local/share/xorg/Xorg.0.log</filename> (or
|
---|
123 | <filename>/var/log/Xorg.0.log</filename> if you have
|
---|
124 | built <xref linkend="xorg-server"/> with the suid bit) for
|
---|
125 | statements such as:
|
---|
126 | </para>
|
---|
127 |
|
---|
128 | <screen><literal>(II) modeset(0): [DRI2] Setup complete
|
---|
129 | (II) modeset(0): [DRI2] DRI driver: crocus
|
---|
130 | (II) modeset(0): [DRI2] VDPAU driver: va_gl</literal></screen>
|
---|
131 |
|
---|
132 | <note>
|
---|
133 | <para>
|
---|
134 | DRI configuration may differ if you are using alternate drivers, such
|
---|
135 | as traditional DDX drivers, or the proprietary drivers from
|
---|
136 | <ulink url="https://www.nvidia.com/page/home.html">NVIDIA</ulink> or
|
---|
137 | <ulink url="https://www.amd.com/">AMD</ulink>.
|
---|
138 | </para>
|
---|
139 | </note>
|
---|
140 |
|
---|
141 | <!-- With elogind, this is not needed anymore
|
---|
142 | <para>
|
---|
143 | Although all users can use software acceleration, any hardware
|
---|
144 | acceleration (DRI2) is only available to <systemitem
|
---|
145 | class="username">root</systemitem> and members of the <systemitem
|
---|
146 | class="groupname">video</systemitem> group, but
|
---|
147 | <phrase revision="sysv"><emphasis>ConsoleKit2</emphasis></phrase>
|
---|
148 | <phrase revision="systemd"><emphasis>systemd-logind</emphasis></phrase>
|
---|
149 | takes care of adding any logged in user to the user ACL's of
|
---|
150 | <filename>/dev/dri/card*</filename>, the special file(s) allowing access
|
---|
151 | to hardware acceleration.<phrase revision="systemd"> So, no further
|
---|
152 | configuration is needed.</phrase>
|
---|
153 | </para>
|
---|
154 |
|
---|
155 | <para revision="sysv">
|
---|
156 | If your driver is supported and <emphasis>ConsoleKit2</emphasis> is not
|
---|
157 | installed, add any users that might use X to the <systemitem
|
---|
158 | class="groupname">video</systemitem> group:
|
---|
159 | </para>
|
---|
160 |
|
---|
161 | <screen role="root" revision="sysv"><userinput>usermod -a -G video <replaceable><username></replaceable></userinput></screen>
|
---|
162 | -->
|
---|
163 | <para>
|
---|
164 | Another way to determine if DRI is working properly is to use one of the
|
---|
165 | two optionally installed OpenGL demo programs in <xref
|
---|
166 | linkend="mesa"/>. From an X terminal, run <command>glxinfo -B</command>
|
---|
167 | and look for the phrase:
|
---|
168 | </para>
|
---|
169 |
|
---|
170 | <screen><computeroutput>name of display: :0
|
---|
171 | display: :0 screen: 0
|
---|
172 | direct rendering: Yes</computeroutput></screen>
|
---|
173 |
|
---|
174 | <para>
|
---|
175 | If direct rendering is enabled, you can add verbosity by running
|
---|
176 | <command>LIBGL_DEBUG=verbose glxinfo</command>. This will show the
|
---|
177 | drivers, device nodes and files used by the DRI system.
|
---|
178 | </para>
|
---|
179 |
|
---|
180 | <para>
|
---|
181 | To confirm that DRI2 hardware acceleration is working, you can (still in
|
---|
182 | the X terminal) run the command <command>glxinfo | grep -E "(OpenGL
|
---|
183 | vendor|OpenGL renderer|OpenGL version)"</command>.
|
---|
184 | If that reports something <emphasis>other than</emphasis>
|
---|
185 | <literal>Software Rasterizer</literal> then you have working
|
---|
186 | acceleration for the user who ran the command.
|
---|
187 | </para>
|
---|
188 |
|
---|
189 | <para>
|
---|
190 | If your hardware does not have any DRI2 driver available, it will use a
|
---|
191 | Software Rasterizer for Direct Rendering. In such cases, you can use a
|
---|
192 | new, LLVM-accelerated, Software Rasterizer called LLVMPipe. In order to
|
---|
193 | build LLVMPipe just make sure that <xref linkend="llvm"/> is present at
|
---|
194 | Mesa build time. Note that all decoding is done on the CPU instead of
|
---|
195 | the GPU, so the display will run slower than with hardware acceleration.
|
---|
196 | To check if you are using LLVMpipe, review the output of the glxinfo
|
---|
197 | command above. An example of the output using the Software Rasterizer
|
---|
198 | is shown below:
|
---|
199 | </para>
|
---|
200 |
|
---|
201 | <screen><computeroutput>OpenGL vendor string: VMware, Inc.
|
---|
202 | OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.5, 256 bits)
|
---|
203 | OpenGL version string: 3.0 Mesa 10.4.5</computeroutput></screen>
|
---|
204 |
|
---|
205 | <para>
|
---|
206 | You can also force LLVMPipe by exporting the
|
---|
207 | <envar>LIBGL_ALWAYS_SOFTWARE=1</envar> environment variable when
|
---|
208 | starting Xorg.
|
---|
209 | </para>
|
---|
210 |
|
---|
211 | <para>
|
---|
212 | Again, if you have built the Mesa OpenGL demos, you can also run the test
|
---|
213 | program <command>glxgears</command>. This program brings up a window with
|
---|
214 | three gears turning. The X terminal will display how many frames were
|
---|
215 | drawn every five seconds, so this will give a rough benchmark. The window
|
---|
216 | is scalable, and the frames drawn per second is highly dependent on the
|
---|
217 | size of the window. On some hardware, <command>glxgears</command> will
|
---|
218 | run synchronized with the vertical refresh signal and the frame rate will
|
---|
219 | be approximately the same as the monitor refresh rate.
|
---|
220 | </para>
|
---|
221 |
|
---|
222 | </sect2>
|
---|
223 |
|
---|
224 | <sect2 role="configuration" id="xorg-debug" xreflabel="Debugging Xorg">
|
---|
225 | <title>Debugging Xorg</title>
|
---|
226 |
|
---|
227 | <para>
|
---|
228 | When starting xorg, there are a couple of ways to check what any
|
---|
229 | issues you may have. If the system comes up, you can see what driver
|
---|
230 | is being used by running <command>xdriinfo</command>. If there are
|
---|
231 | issues or you just want to check, look at <filename>Xorg.0.log</filename>.
|
---|
232 | </para>
|
---|
233 |
|
---|
234 | <para>
|
---|
235 | The location of <filename>Xorg.0.log</filename> depends on how Xorg is
|
---|
236 | installed. If the instructions in the book are followed closely and
|
---|
237 | Xorg is started from the command line, it will be located in the
|
---|
238 | <filename class="directory">$HOME/.local/share/xorg/</filename> directory.
|
---|
239 | If Xorg is started by a display manager (e.g. <xref linkend='lightdm'/>,
|
---|
240 | <xref linkend='sddm'/>, or <xref linkend='gdm'/>) or if
|
---|
241 | <filename>$XORG_PREFIX/bin/Xorg</filename> has the suid bit set,
|
---|
242 | it will be located in the <filename class="directory">/var/log/</filename>
|
---|
243 | directory.
|
---|
244 | </para>
|
---|
245 |
|
---|
246 | <bridgehead renderas="sect3">Xorg.0.log Issues</bridgehead>
|
---|
247 |
|
---|
248 | <para>
|
---|
249 | When you look at Xorg.0.log, check for entries like (EE) or (WW).
|
---|
250 | Below are some common entries:
|
---|
251 | </para>
|
---|
252 |
|
---|
253 | <bridgehead renderas="sect5">(WW) Open ACPI failed (/var/run/acpid.socket)</bridgehead>
|
---|
254 |
|
---|
255 | <para>
|
---|
256 | This warning is because <xref linkend='acpid'/> is not installed. If you
|
---|
257 | are not on a laptop, it can be safely ignored. On a laptop, install
|
---|
258 | <xref linkend='acpid'/> to enable actions like recognizing when the lid is
|
---|
259 | closed.
|
---|
260 | </para>
|
---|
261 |
|
---|
262 | <bridgehead renderas="sect5">(WW) VGA arbiter: cannot open kernel arbiter, no multi-card support</bridgehead>
|
---|
263 |
|
---|
264 | <para>
|
---|
265 | This warning is displayed when a regular user starts Xorg. The library
|
---|
266 | <filename>libpciaccess.so</filename> issues this warning when it
|
---|
267 | tries to open <filename>/dev/vga_arbiter</filename>. If there is no
|
---|
268 | more than one legacy PCI (not PCIe) graphic cards on the system, it
|
---|
269 | can safely be ignored. If really necessary, the
|
---|
270 | permissions of this device can be changed by adding a udev rule and
|
---|
271 | adding the local user to the video group. As the &root; user:
|
---|
272 | </para>
|
---|
273 |
|
---|
274 | <screen role="root"><userinput>cat > /etc/udev/rules.d/99-vga-arbiter.rules << EOF
|
---|
275 | # /etc/udev/rules.d/99-vga-arbiter.rules: Set vga_arbiter group/mode
|
---|
276 |
|
---|
277 | ACTION=="add", KERNEL=="vga_arbiter", GROUP="video" MODE="0660"
|
---|
278 | EOF
|
---|
279 |
|
---|
280 | usermod -a -G video <user running xorg></userinput></screen>
|
---|
281 |
|
---|
282 | </sect2>
|
---|
283 |
|
---|
284 | <sect2 role="configuration" id="hybrid-graphics" xreflabel="Hybrid Graphics">
|
---|
285 | <title>Hybrid Graphics</title>
|
---|
286 |
|
---|
287 | <para>
|
---|
288 | Hybrid Graphics is still in experimental state for Linux. Xorg Developers
|
---|
289 | have developed a technology called PRIME that can be used for switching
|
---|
290 | between integrated and muxless discrete GPU at will. Automatic switching
|
---|
291 | is not possible at the moment.
|
---|
292 | </para>
|
---|
293 |
|
---|
294 | <para>
|
---|
295 | In order to use PRIME for GPU switching, make sure that you are using
|
---|
296 | Linux Kernel 3.4 or later (recommended). You will need latest DRI and
|
---|
297 | DDX drivers for your hardware and <application>Xorg Server</application>
|
---|
298 | 1.13 or later.
|
---|
299 | </para>
|
---|
300 |
|
---|
301 | <para>
|
---|
302 | <application>Xorg Server</application> should load both GPU drivers
|
---|
303 | automatically. You can check that by running:
|
---|
304 | </para>
|
---|
305 |
|
---|
306 | <screen><userinput>xrandr --listproviders</userinput></screen>
|
---|
307 |
|
---|
308 | <para>
|
---|
309 | There should be two (or more) providers listed, for example:
|
---|
310 | </para>
|
---|
311 |
|
---|
312 | <screen><computeroutput>Providers: number : 2
|
---|
313 | Provider 0: id: 0x7d cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 3 outputs: 4 associated providers: 1 name:modesetting
|
---|
314 | Provider 1: id: 0x56 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 6 outputs: 1 associated providers: 1 name:modesetting</computeroutput></screen>
|
---|
315 |
|
---|
316 | <!-- Well, both "id" and "name" are supposed to work here but after
|
---|
317 | the xf86-video-* removal all the names will be modesetting unless
|
---|
318 | a proprietary driver used... -->
|
---|
319 | <para>
|
---|
320 | In order to be able to run a GLX application on a discrete GPU, you will
|
---|
321 | need to run the following command, where <provider> is the id of
|
---|
322 | the more powerful discrete card, and <sink> is the id of card
|
---|
323 | which has a display connected:
|
---|
324 | </para>
|
---|
325 |
|
---|
326 | <screen><userinput>xrandr --setprovideroffloadsink <replaceable><provider> <sink></replaceable></userinput></screen>
|
---|
327 |
|
---|
328 | <note>
|
---|
329 | <para>
|
---|
330 | With the <application>Xorg</application> modesetting driver,
|
---|
331 | which is DRI3 capable, the above command is no longer
|
---|
332 | necessary. It does no harm however.
|
---|
333 | </para>
|
---|
334 | </note>
|
---|
335 |
|
---|
336 | <para>
|
---|
337 | Then, you will need to export the <envar>DRI_PRIME=1</envar> environment
|
---|
338 | variable each time you want the powerful GPU to be used. For example,
|
---|
339 |
|
---|
340 | <screen><userinput>DRI_PRIME=1 glxinfo | grep -E "(OpenGL vendor|OpenGL renderer|OpenGL version)"</userinput></screen>
|
---|
341 |
|
---|
342 | will show OpenGL vendor, renderer and version for the discrete GPU.
|
---|
343 | </para>
|
---|
344 |
|
---|
345 | <para>
|
---|
346 | If the last command reports same OpenGL renderer with and without
|
---|
347 | <envar>DRI_PRIME=1</envar>, you will need to check your installation.
|
---|
348 | </para>
|
---|
349 |
|
---|
350 | </sect2>
|
---|
351 |
|
---|
352 | <sect2 role="configuration" id='xconfig'>
|
---|
353 | <title>Setting up Xorg Devices</title>
|
---|
354 |
|
---|
355 | <para>
|
---|
356 | For most hardware configurations, modern Xorg will automatically
|
---|
357 | get the server configuration correct without any user intervention. There
|
---|
358 | are, however, some cases where auto-configuration will be incorrect.
|
---|
359 | Following are some example manual configuration items that may be of use
|
---|
360 | in these instances.
|
---|
361 | </para>
|
---|
362 |
|
---|
363 | <sect3 id="xinput">
|
---|
364 | <title>Setting up X Input Devices</title>
|
---|
365 | <para>
|
---|
366 | For most input devices, no additional configuration will be
|
---|
367 | necessary. This section is provided for informational purposes only.
|
---|
368 | </para>
|
---|
369 |
|
---|
370 | <para>
|
---|
371 | A sample default XKB setup could look like the following (executed as
|
---|
372 | the <systemitem class="username">root</systemitem> user):
|
---|
373 | </para>
|
---|
374 |
|
---|
375 | <screen role="root"><userinput>cat > /etc/X11/xorg.conf.d/xkb-defaults.conf << "EOF"
|
---|
376 | <literal>Section "InputClass"
|
---|
377 | Identifier "XKB Defaults"
|
---|
378 | MatchIsKeyboard "yes"
|
---|
379 | Option "XkbLayout" "fr"
|
---|
380 | Option "XkbOptions" "terminate:ctrl_alt_bksp"
|
---|
381 | EndSection</literal>
|
---|
382 | EOF</userinput></screen>
|
---|
383 |
|
---|
384 | <para>
|
---|
385 | The <quote>XkbLayout</quote> line is an example for a French (AZERTY)
|
---|
386 | keyboard. Change it to your keyboard model. That line is not needed for
|
---|
387 | a QWERTY (US) keyboard.
|
---|
388 | </para>
|
---|
389 | </sect3>
|
---|
390 |
|
---|
391 | <sect3 id="xdisplay">
|
---|
392 | <title>Fine Tuning Display Settings</title>
|
---|
393 |
|
---|
394 | <para>
|
---|
395 | If you want to set the monitor resolution for Xorg, first run
|
---|
396 | <command>xrandr</command> in a X terminal to list the supported
|
---|
397 | resolutions and the corresponding refresh rates. For example, it
|
---|
398 | outputs the following for one monitor:
|
---|
399 | </para>
|
---|
400 |
|
---|
401 | <screen><computeroutput>Screen 0: minimum 16 x 16, current 5760 x 2160, maximum 32767 x 32767
|
---|
402 | DP-1 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 600mm x 340mm
|
---|
403 | 3840x2160 59.98*+
|
---|
404 | 2048x1536 59.95
|
---|
405 | 1920x1440 59.90
|
---|
406 | 1600x1200 59.87
|
---|
407 | 1440x1080 59.99
|
---|
408 | 1400x1050 59.98
|
---|
409 | 1280x1024 59.89
|
---|
410 | 1280x960 59.94
|
---|
411 | 1152x864 59.96
|
---|
412 | 1024x768 59.92
|
---|
413 | 800x600 59.86
|
---|
414 | 640x480 59.38</computeroutput></screen>
|
---|
415 |
|
---|
416 | <para>
|
---|
417 | From the output we can see the monitor is identified
|
---|
418 | <literal>DP-1</literal>. Select a suitable resolution from the
|
---|
419 | output list, for example <literal>1920x1440</literal>. Then
|
---|
420 | as the &root; user, create a configuration file for the Xorg server:
|
---|
421 | </para>
|
---|
422 |
|
---|
423 | <screen role="root"><userinput>cat > /etc/X11/xorg.conf.d/monitor-DP-1.conf << "EOF"
|
---|
424 | <literal>Section "Monitor"
|
---|
425 | Identifier "DP-1"
|
---|
426 | Option "PerferredMode" "1920x1440"
|
---|
427 | EndSection</literal>
|
---|
428 | EOF</userinput></screen>
|
---|
429 |
|
---|
430 | <para>
|
---|
431 | Sometimes <command>xrandr</command> may fail to detect some
|
---|
432 | resolution settings supported by the monitor. It usually happens
|
---|
433 | with virtual monitors of virtual machine managers like
|
---|
434 | <xref linkend='qemu'/> or VMWare: a virtual monitor actually
|
---|
435 | supports all pairs of integers in a range as the resolution, but
|
---|
436 | <command>xrandr</command> will only list a few. To use a
|
---|
437 | resolution not listed by <command>xrandr</command>, first run
|
---|
438 | <command>cvt</command> to get the mode line for the resolution.
|
---|
439 | For example:
|
---|
440 | </para>
|
---|
441 |
|
---|
442 | <screen><userinput>cvt 1600 900</userinput>
|
---|
443 | <computeroutput><literal># 1600x900 59.95 Hz (CVT 1.44M9) hsync: 55.99 kHz; pclk: 118.25 MHz
|
---|
444 | Modeline "1600x900_60.00" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync</literal></computeroutput></screen>
|
---|
445 |
|
---|
446 | <para>
|
---|
447 | As the &root; user, create a Xorg server configuration file
|
---|
448 | containing this mode line, and specify the mode as preferred mode:
|
---|
449 | </para>
|
---|
450 |
|
---|
451 | <screen role="root"><userinput>cat > /etc/X11/xorg.conf.d/monitor-DP-1.conf << "EOF"
|
---|
452 | <literal>Section "Monitor"
|
---|
453 | Identifier "DP-1"
|
---|
454 | Modeline "1600x900_60.00" 118.25 1600 1696 1856 2112 900 903 908 934 -hsync +vsync
|
---|
455 | Option "PerferredMode" "1600x900_60.00"
|
---|
456 | EndSection</literal>
|
---|
457 | EOF</userinput></screen>
|
---|
458 |
|
---|
459 | <para>
|
---|
460 | Some high-end LCD monitors support a refresh rate higher than 100 Hz
|
---|
461 | but <command>xrandr</command> may fail to recognize the supported
|
---|
462 | refresh rate and use 60 Hz instead. This issue would prevent you
|
---|
463 | from utilizing the full capability of the monitor, and may cause
|
---|
464 | the screen to flicker or show <quote>artifacts</quote> like meshes
|
---|
465 | or grids. To resolve the issue, again use <command>cvt</command>
|
---|
466 | to get the mode line with a custom refresh rate:
|
---|
467 | </para>
|
---|
468 |
|
---|
469 | <screen><userinput>cvt 3840 2160 144</userinput>
|
---|
470 | <computeroutput><literal># 3840x2160 143.94 Hz (CVT) hsync: 338.25 kHz; pclk: 1829.25 MHz
|
---|
471 | Modeline "3840x2160_144.00" 1829.25 3840 4200 4624 5408 2160 2163 2168 2350 -hsync +vsync</literal></computeroutput></screen>
|
---|
472 |
|
---|
473 | <para>
|
---|
474 | Then paste it into the Xorg server configuration file and set it
|
---|
475 | as the preferred mode.
|
---|
476 | </para>
|
---|
477 |
|
---|
478 | <para>
|
---|
479 | Another common setup is having multiple server layouts for use in
|
---|
480 | different environments. Though the server will automatically detect the
|
---|
481 | presence of another monitor, it may get the order incorrect:
|
---|
482 | </para>
|
---|
483 |
|
---|
484 | <screen role="root"><userinput>cat > /etc/X11/xorg.conf.d/server-layout.conf << "EOF"
|
---|
485 | <literal>Section "ServerLayout"
|
---|
486 | Identifier "DefaultLayout"
|
---|
487 | Screen 0 "Screen0" 0 0
|
---|
488 | Screen 1 "Screen1" LeftOf "Screen0"
|
---|
489 | Option "Xinerama"
|
---|
490 | EndSection</literal>
|
---|
491 | EOF</userinput></screen>
|
---|
492 |
|
---|
493 | <para>
|
---|
494 | When you drag a window in twm (or any non-compositing window
|
---|
495 | manager) horizontally, you may observe that the vertical borders
|
---|
496 | of the window are broken into multiple segments. This is an example
|
---|
497 | of the visual artifacts called <emphasis>screen tearing</emphasis>.
|
---|
498 | To resolve the screen tearing problems, create a configuration file
|
---|
499 | that enables the TearFree option. Note that you must have the
|
---|
500 | Tearfree patch applied from <xref role="nodep"
|
---|
501 | linkend="xorg-server"/> for this to function properly, and it may
|
---|
502 | increase memory allocation and reduce performance.
|
---|
503 | </para>
|
---|
504 |
|
---|
505 | <screen role="root"><userinput>cat > /etc/X11/xorg.conf.d/20-tearfree.conf << "EOF"
|
---|
506 | <literal>Section "Device"
|
---|
507 | Identifier "Graphics Adapter"
|
---|
508 | Driver "modesetting"
|
---|
509 | Option "TearFree" "true"
|
---|
510 | EndSection</literal>
|
---|
511 | EOF</userinput></screen>
|
---|
512 |
|
---|
513 | <para>
|
---|
514 | With modern Xorg, little or no additional graphic card configuration
|
---|
515 | is necessary. If you should need extra options passed to your video
|
---|
516 | driver, add them into the <literal>Device</literal> section as well.
|
---|
517 | The options supported by the modesetting driver are documented in
|
---|
518 | the man page <ulink role='man'
|
---|
519 | url='&man;modesetting.4'>modesetting(4)</ulink>.
|
---|
520 | </para>
|
---|
521 |
|
---|
522 | </sect3>
|
---|
523 | </sect2>
|
---|
524 | </sect1>
|
---|