Advertisement
drpanwe

drpaneas

Jun 11th, 2015
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 32.32 KB | None | 0 0
  1. ############################
  2. How to xorg.conf for nouveau
  3. ############################
  4.  
  5.  
  6.  
  7. DISCLAIMER: I am not responsible for your system
  8. or you mental state after reading this guide.
  9.  
  10. The purpose of this guide is to help you understand how
  11. you should configure your multi-head setup.
  12.  
  13.  
  14.  
  15. 0. Physical Display confiruation:
  16. ---------------------------------
  17.  
  18.  
  19. ---------- ---------- ----------
  20. | | | | | |
  21. | Monitor0 | | Monitor1 | | Monitor2 |
  22. | | | | | |
  23. ---------- ---------- ----------
  24. | | | | | |
  25. | | | | | |
  26. / \ / \ / \
  27. ===== ===== =====
  28.  
  29. DVI HDMI VGA
  30.  
  31. | | |
  32. ------ | ---------
  33. \ | /
  34. \ | /
  35. ===========
  36. | NVIDIA |
  37. | GeForce |
  38. ===========
  39.  
  40.  
  41.  
  42. 1. Try with dynamic detection
  43. ------------------------------
  44.  
  45. First all all, make sure there's no "/etc/X11/xorg.conf"
  46. and if there's, please remove it. In that way, X will try to
  47. configure your displays automatically.
  48.  
  49.  
  50. Once you are logged into the Gnome session (fingers' crossed),
  51. you are going to experience this:
  52.  
  53.  
  54. ---------- ---------- ----------
  55. | | | | | |
  56. | NoSignal | | Mirror | | Mirror |
  57. | | | | | |
  58. ---------- ---------- ----------
  59. | | | | | |
  60. | | | | | |
  61. / \ / \ / \
  62. ===== ===== =====
  63.  
  64. DEAD | |
  65. | |
  66. ------------
  67. Mirrored by default
  68.  
  69.  
  70.  
  71. Well, I suppose this is not the case that we want.
  72. We need to explicitely tell X Server how to organise
  73. our triple-head setup.
  74.  
  75.  
  76.  
  77. 2. Find out the Output names
  78. ----------------------------
  79.  
  80. While you're logged into Gnome, open a terminal
  81. and see the output names using "xrandr -q":
  82.  
  83.  
  84. :~> xrandr -q
  85.  
  86. Screen 0: minimum 320 x 200, current 1152 x 864, maximum 8192 x 8192
  87.  
  88. DVI-I-1 connected (normal left inverted right x axis y axis)
  89. 1680x1050 59.88 +
  90. 1280x1024 75.02 60.02
  91. 1152x864 75.00
  92. 1024x768 75.08 60.00
  93. 800x600 75.00 60.32
  94. 640x480 75.00 60.00
  95. 720x400 70.08
  96.  
  97. HDMI-1 connected 1152x864+0+0 (normal left inverted right x axis y axis) 473mm x 296mm
  98. 1680x1050 59.95 +
  99. 1280x1024 75.02 60.02
  100. 1152x864 75.00*
  101. 1024x768 75.08 60.00
  102. 800x600 75.00 60.32
  103. 640x480 75.00 60.00
  104. 720x400 70.08
  105.  
  106. VGA-1 connected 1152x864+0+0 (normal left inverted right x axis y axis) 527mm x 297mm
  107. 1920x1080 60.00 +
  108. 1600x900 59.98
  109. 1280x1024 75.02 60.02
  110. 1152x864 75.00*
  111. 1024x768 75.08 60.00
  112. 800x600 75.00 60.32
  113. 640x480 75.00 60.00
  114. 720x400 70.08
  115.  
  116.  
  117. So, the corresponding names for our displays are:
  118.  
  119. Monitor0 --> DVI-I-1
  120. Monitor1 --> HDMI-1
  121. Monitor2 --> VGA-1
  122.  
  123.  
  124.  
  125. 3. Create a very basic "xorg.conf"
  126. ----------------------------------
  127.  
  128. Let's ask X Server to create a very basic "xorg.conf"
  129. for us. To do that, shutdown any GUI by simply going into
  130. Runlevel 3.
  131.  
  132. :~> telinit 3
  133.  
  134. Then, press CTRL+ALT+F1 to go to the first tty and login back
  135. to the system as root. Now, ask the X Server to serve you
  136. the "xorg.conf" configuration file:
  137.  
  138. :~> X -configure
  139.  
  140. This will generate the "/root/xorg.conf.new" with some standard
  141. configuration. Here it is:
  142.  
  143. Section "ServerLayout"
  144. Identifier "X.org Configured"
  145. Screen 0 "Screen0" 0 0
  146. InputDevice "Mouse0" "CorePointer"
  147. InputDevice "Keyboard0" "CoreKeyboard"
  148. EndSection
  149.  
  150. Section "Files"
  151. ModulePath "/usr/lib64/xorg/modules"
  152. FontPath "/usr/share/fonts/misc:unscaled"
  153. FontPath "/usr/share/fonts/Type1/"
  154. FontPath "/usr/share/fonts/100dpi:unscaled"
  155. FontPath "/usr/share/fonts/75dpi:unscaled"
  156. FontPath "/usr/share/fonts/ghostscript/"
  157. FontPath "/usr/share/fonts/cyrillic:unscaled"
  158. FontPath "/usr/share/fonts/misc/sgi:unscaled"
  159. FontPath "/usr/share/fonts/truetype/"
  160. FontPath "built-ins"
  161. EndSection
  162.  
  163. Section "Module"
  164. Load "vnc"
  165. Load "glx"
  166. EndSection
  167.  
  168. Section "InputDevice"
  169. Identifier "Keyboard0"
  170. Driver "kbd"
  171. EndSection
  172.  
  173. Section "InputDevice"
  174. Identifier "Mouse0"
  175. Driver "mouse"
  176. Option "Protocol" "auto"
  177. Option "Device" "/dev/input/mice"
  178. Option "ZAxisMapping" "4 5 6 7"
  179. EndSection
  180.  
  181. Section "Monitor"
  182. Identifier "Monitor0"
  183. VendorName "Monitor Vendor"
  184. ModelName "Monitor Model"
  185. EndSection
  186.  
  187. Section "Device"
  188. ### Available Driver options are:-
  189. ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
  190. ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
  191. ### <percent>: "<f>%"
  192. ### [arg]: arg optional
  193. #Option "SWcursor" # [<bool>]
  194. #Option "HWcursor" # [<bool>]
  195. #Option "NoAccel" # [<bool>]
  196. #Option "ShadowFB" # [<bool>]
  197. #Option "VideoKey" # <i>
  198. #Option "WrappedFB" # [<bool>]
  199. #Option "GLXVBlank" # [<bool>]
  200. #Option "ZaphodHeads" # <str>
  201. #Option "PageFlip" # [<bool>]
  202. #Option "SwapLimit" # <i>
  203. #Option "AsyncUTSDFS" # [<bool>]
  204. #Option "AccelMethod" # <str>
  205. Identifier "Card0"
  206. Driver "nouveau"
  207. BusID "PCI:1:0:0"
  208. EndSection
  209.  
  210. Section "Screen"
  211. Identifier "Screen0"
  212. Device "Card0"
  213. Monitor "Monitor0"
  214. SubSection "Display"
  215. Viewport 0 0
  216. Depth 1
  217. EndSubSection
  218. SubSection "Display"
  219. Viewport 0 0
  220. Depth 4
  221. EndSubSection
  222. SubSection "Display"
  223. Viewport 0 0
  224. Depth 8
  225. EndSubSection
  226. SubSection "Display"
  227. Viewport 0 0
  228. Depth 15
  229. EndSubSection
  230. SubSection "Display"
  231. Viewport 0 0
  232. Depth 16
  233. EndSubSection
  234. SubSection "Display"
  235. Viewport 0 0
  236. Depth 24
  237. EndSubSection
  238. EndSection
  239.  
  240.  
  241.  
  242. As you can see, it's quite generic. For this reason,
  243. we are going to strip it down to a shorter version:
  244.  
  245. Section "ServerLayout"
  246. Identifier "TripleHead Setup with nouveau"
  247. Screen 0 "Screen0" 0 0
  248. EndSection
  249.  
  250. Section "Monitor"
  251. Identifier "Monitor0"
  252. EndSection
  253.  
  254. Section "Device"
  255. Identifier "Card0"
  256. Driver "nouveau"
  257. BusID "PCI:1:0:0"
  258. EndSection
  259.  
  260. Section "Screen"
  261. Identifier "Screen0"
  262. Device "Card0"
  263. Monitor "Monitor0"
  264. EndSection
  265.  
  266.  
  267.  
  268. What does it mean?
  269. ------------------
  270.  
  271. First of all we need a Monitor, which is equivalent to
  272. our physical display. Normally, we would have 3 Monitor
  273. sections, but hey: this is a very generic and basic, let's
  274. stick to that for now on.
  275.  
  276.  
  277. ----------
  278. | | The "Identifier" is just a name. You can put
  279. | Monitor0 | whatever you want. In this guide, I am sticking
  280. | | with the "Monitor<N>" naming-convention.
  281. ----------
  282. | |
  283. / \
  284. =====
  285.  
  286.  
  287.  
  288. Next we need to plug this monitor into our videocard and
  289. make use of the videodriver:
  290.  
  291.  
  292. =================
  293. | | The "Identifier" could be anything.
  294. | Card0 | But, the important part here is the driver which is responsible
  295. | | for the communication between the Card and the Linux kernel.
  296. =================
  297. ||||||||| |||
  298. --------- ---- ###########
  299. | PCIe 01:00.0 | <---> # nouveau # <---> KERNEL
  300. --------- ---- ###########
  301.  
  302.  
  303. Notice that the X found the open soure nvidia driver
  304. used for 3D accelleration, called "nouveau". JYFI, you
  305. should not use the old 2D "nv" driver, because is obsolete
  306. and not maintained.
  307.  
  308. Just to be on the safe side, make sure that "nouveau" is loaded:
  309.  
  310. :~> lsmod | grep drm
  311.  
  312. drm_kms_helper 65670 1 nouveau
  313. drm 335594 6 ttm,drm_kms_helper,nouveau
  314.  
  315.  
  316. and also, check that nouveau is the driver that userpace and kernel are using for
  317. your videocard:
  318.  
  319. :~ # lspci -nnk | grep -A3 VGA
  320.  
  321. 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF108 [GeForce GT 440] [10de:0de0] (rev a1)
  322. Subsystem: ASUSTeK Computer Inc. Device [1043:83b7]
  323. Kernel driver in use: nouveau
  324. Kernel modules: nouveau
  325.  
  326.  
  327. Notice that while the PCI BusID is: "01:00.0"
  328. we change it a bit when we are putting this info
  329. into "xorg.conf" like this: "PCI:1:0:0". This information is
  330. optional if you have only one GPU installed (also, no internal graphics).
  331. Otherwise, you have to specify it. For my system, I have Intel graphics
  332. disabled from BIOS and I could have omitted that line from "xorg.conf"
  333. but because there's always the danger to enable them sometime in the future,
  334. I wouldn't like to end up with broken X. Because in that case, there will be
  335. two PCI Buses:
  336.  
  337. PCI:1:0:0 --> nVIDIA
  338. PCI:0:2:0 --> Intel Graphics
  339.  
  340. and if there's no reference into "xorg.conf" what is what, then it is going to be a problem.
  341.  
  342. JFYI, the "0x10de" is the code for NVIDIA as a vendor
  343. and the "0x0d30" is the code for the specific device (GeForce GT 440).
  344. In case you need to validate these information, you can search
  345. for the kernel's data which are related to PCI bus:
  346.  
  347. :~ # cat /sys/bus/pci/devices/0000\:01\:00.0/vendor
  348. 0x10de
  349.  
  350. :~ # cat /sys/bus/pci/devices/0000\:01\:00.0/device
  351. 0x0de0
  352.  
  353.  
  354.  
  355. The only problem with the device section is that I cannot
  356. tell which monitor I want to use. That's why there is another section
  357. called "Screen" which is going to be the "link" between "Monitor" and "Device" sections.
  358.  
  359.  
  360.  
  361. ------------------------------------------------------------------------------
  362. | |
  363. | ----------- ================= |
  364. | | | | | | The screen is just a visual interface
  365. | | Monitor 0 | | Card0 | | used to combine a monitor with a
  366. | | | | | | device.
  367. | ----------- ================= |
  368. | | | ||||||||| ||| |
  369. | / \ --------- ---- ########### |
  370. | ===== | PCIe 01:00.0 | <---> # nouveau # <---> KERNEL |
  371. | --------- ---- ########### |
  372. | |
  373. | Screen0 |
  374. -------------------------------------------------------------------------------
  375.  
  376.  
  377. Notice, that we haven't yet mentioned how the card0 is connected with the Monitor0.
  378. That has been said, X Server doesn't know if the monitor we are talking about
  379. is VGA-0, DVI-I-1 or HDMI-1. We let X Server (for now) to choose this automatically.
  380.  
  381. Last but not least, we need a Layout Section. This section is used in order to
  382. place our screens in position. For now own, we have only one Monitor, thus
  383. we need to define this screen as the primary one.
  384.  
  385. Screen 0 "Screen0" 0 0
  386.  
  387. ^ ^ ^
  388. | | |
  389. Primary --------------- | | relative positions (x horizontal, y vertical)
  390. x --------- | which means the upper left corner of our display
  391. y -----------
  392.  
  393.  
  394.  
  395.  
  396.  
  397. 4. Start the X Server:
  398. ----------------------
  399.  
  400. In order to start X Server and tell it to use this file you have 2 ways:
  401.  
  402. I. Either, place the file into the appropriate directory:
  403.  
  404. :~> cp xorg.conf.new /etc/X11/xorg.conf
  405.  
  406. and then start X server:
  407.  
  408. :~> X
  409.  
  410.  
  411. II. Or, you simply can pass the configuration file as an parameter
  412. while starting the X Server (recommended):
  413.  
  414.  
  415. :~> X -config /root/xorg.conf.new
  416.  
  417.  
  418. You are going to see a black screen (this is surprisingly good)
  419. which means that X Server is running. Go again back to 'tty1'
  420. and kill it by pressing "ctrl+c".
  421.  
  422.  
  423. Now, view the logs:
  424.  
  425. :~> vim /var/log/Xorg.0.log
  426.  
  427.  
  428. First, let's see if X Server uses the same Output-names
  429. as XRandR does:
  430.  
  431. :~> grep "Output.*connected" /var/log/Xorg.0.log
  432.  
  433. [ 3409.088] (II) NOUVEAU(0): Output DVI-I-1 connected
  434. [ 3409.088] (II) NOUVEAU(0): Output HDMI-1 connected
  435. [ 3409.088] (II) NOUVEAU(0): Output VGA-1 connected
  436.  
  437.  
  438. The answer here is: yes it does.
  439. Do you remember that we didn't tell X Server what Output name is used
  440. for our monitor? Let's see what X Server probing picked up automatically:
  441.  
  442. [ 7177.781] (II) NOUVEAU(0): Output DVI-I-1 using monitor section Monitor0
  443. [ 7177.813] (II) NOUVEAU(0): Output HDMI-1 has no monitor section
  444. [ 7177.845] (II) NOUVEAU(0): Output VGA-1 has no monitor section
  445.  
  446.  
  447. So, X Server thinks that my Monitor0 is connected using DVI. Which is correct, but
  448. this is pure luck. Let's see the resolution that X chose:
  449.  
  450.  
  451. [ 7177.945] (II) NOUVEAU(0): Output DVI-I-1 using initial mode 1152x864
  452. [ 7177.945] (II) NOUVEAU(0): Output HDMI-1 using initial mode 1152x864
  453. [ 7177.945] (II) NOUVEAU(0): Output VGA-1 using initial mode 1152x864
  454.  
  455.  
  456. Hm, it makes sense (if you look my output from xrandr) that 1152x864 is the higher resolution
  457. supported by *all* of my displays.
  458.  
  459. Let's try to fire-up gnome and see what is going to be. To do that, we first have to place the
  460. configuration to the right place:
  461.  
  462. :~> cp xorg.conf.new /etc/X11/xorg.conf
  463.  
  464. and go into graphical target (aka Runlevel 5):
  465.  
  466. :~> telinit 5
  467.  
  468.  
  469. However, I still get the same result as my first state (without "xorg.conf").
  470. Let's make sure first that X Server is reading our configuration:
  471.  
  472. [ 7848.626] (==) Using config file: "/etc/X11/xorg.conf"
  473.  
  474. So, the file is the correct one.
  475.  
  476. [ 7848.627] (==) ServerLayout "TripleHead Setup with nouveau"
  477. [ 7848.627] (**) |-->Screen "Screen0" (0)
  478. [ 7848.627] (**) | |-->Monitor "Monitor0"
  479. [ 7848.627] (**) | |-->Device "Card0"
  480.  
  481.  
  482. So does the rest of the setup. Let's try to force Monitor0 to be the DVI-I-1 connection
  483. and see what happens. Go into your "device section" and put this line:
  484.  
  485.  
  486. Option "Monitor-DVI-I-1" "Monitor0"
  487.  
  488. and see what happens. In order to test this, we are going to follow the same procedure:
  489.  
  490. 1. Change /etc/X11/xorg.conf
  491. 2. Go to 'runlevel 3'
  492. 3. Start X Server by typing "X"
  493. 4. Go to tty1 (press ctrl+alt+F1)
  494. 5. Kill the X Server (pres ctrl+c)
  495. 6. See the logs (vi /var/log/Xorg.0.log)
  496. 7. Go to 'runlevel 5'
  497.  
  498. Hm, it didn't change. Same results.
  499.  
  500. 5) Optimize xorg.conf
  501. ---------------------
  502.  
  503. Let's try to add 3 monitors, which are going to be like our 3 displays.
  504.  
  505.  
  506.  
  507. Section "Monitor"
  508. Identifier "Monitor0"
  509. EndSection
  510.  
  511. Section "Monitor"
  512. Identifier "Monitor1"
  513. EndSection
  514.  
  515. Section "Monitor"
  516. Identifier "Monitor2"
  517. EndSection
  518.  
  519.  
  520. And let's connect the to corresponding hardware according to my setup:
  521.  
  522.  
  523. Section "Device"
  524. Identifier "Card0"
  525. Driver "nouveau"
  526. BusID "PCI:1:0:0"
  527. Option "Monitor-DVI-I-1" "Monitor0"
  528. Option "Monitor-HDMI-1" "Monitor1"
  529. Option "Monitor-VGA-1" "Monitor2"
  530. EndSection
  531.  
  532.  
  533. let's test. Same result (from Gnome) but the logs have changed:
  534.  
  535.  
  536. [ 8893.423] (II) NOUVEAU(0): Output DVI-I-1 using monitor section Monitor0
  537. [ 8893.455] (II) NOUVEAU(0): Output HDMI-1 using monitor section Monitor1
  538. [ 8893.487] (II) NOUVEAU(0): Output VGA-1 using monitor section Monitor2
  539.  
  540. Which is the correct configuration:
  541.  
  542.  
  543. ---------- ---------- ----------
  544. | | | | | |
  545. | Monitor0 | | Monitor1 | | Monitor2 |
  546. | | | | | |
  547. ---------- ---------- ----------
  548. | | | | | |
  549. | | | | | |
  550. / \ / \ / \
  551. ===== ===== =====
  552.  
  553. DVI HDMI VGA
  554.  
  555. | | |
  556. ------ | ---------
  557. \ | /
  558. \ | /
  559. ===========
  560. | NVIDIA |
  561. | GeForce |
  562. ===========
  563.  
  564.  
  565. Checking if they are all connected:
  566.  
  567. [ 8893.587] (II) NOUVEAU(0): Output DVI-I-1 connected
  568. [ 8893.587] (II) NOUVEAU(0): Output HDMI-1 connected
  569. [ 8893.587] (II) NOUVEAU(0): Output VGA-1 connected
  570.  
  571. They are all connected but still, I get:
  572.  
  573.  
  574. ---------- ---------- ----------
  575. | | | | | |
  576. | NoSignal | | Mirror | | Mirror |
  577. | | | | | |
  578. ---------- ---------- ----------
  579. | | | | | |
  580. | | | | | |
  581. / \ / \ / \
  582. ===== ===== =====
  583.  
  584. DEAD | |
  585. | |
  586. ------------
  587. Mirrored by default
  588.  
  589.  
  590. Check the logs:
  591.  
  592. [ 8893.587] (II) NOUVEAU(0): Output DVI-I-1 using initial mode 1152x864
  593. [ 8893.587] (II) NOUVEAU(0): Output HDMI-1 using initial mode 1152x864
  594. [ 8893.587] (II) NOUVEAU(0): Output VGA-1 using initial mode 1152x864
  595.  
  596.  
  597. Well, let's try to disable the Mirrored-ones (Monitor1 and Monitor2)
  598. by putting this line into their "Monitor Sections"
  599.  
  600. Option "Ignore" "True"
  601.  
  602. So, it will look like this:
  603.  
  604. Section "Monitor"
  605. Identifier "Monitor0"
  606. EndSection
  607.  
  608. Section "Monitor"
  609. Identifier "Monitor1"
  610. Option "Ignore" "True"
  611. EndSection
  612.  
  613. Section "Monitor"
  614. Identifier "Monitor2"
  615. Option "Ignore" "True"
  616. EndSection
  617.  
  618.  
  619. and continue testing....
  620.  
  621. Voila! For the first time, now, X Server does what we told him to do.
  622.  
  623.  
  624. ---------- ---------- ----------
  625. | | | | | |
  626. | Working | | Disabled | | Disabled |
  627. | | | | | |
  628. ---------- ---------- ----------
  629. | | | | | |
  630. | | | | | |
  631. / \ / \ / \
  632. ===== ===== =====
  633.  
  634. Monitor0 Monitor1 Monitor2
  635. DVI HDMI VGA
  636.  
  637.  
  638. let's see what the logs has to say about this new change:
  639.  
  640. [ 9346.246] (II) NOUVEAU(0): Output DVI-I-1 using monitor section Monitor0
  641. [ 9346.278] (II) NOUVEAU(0): Output HDMI-1 using monitor section Monitor1
  642. [ 9346.278] (**) NOUVEAU(0): Option "Ignore" "True"
  643. [ 9346.310] (II) NOUVEAU(0): Output VGA-1 using monitor section Monitor2
  644. [ 9346.310] (**) NOUVEAU(0): Option "Ignore" "True"
  645.  
  646.  
  647. which is correct (known from the previous configuration), but notice
  648. that HDMI-1 and VGA-1 are now marked with the "Ignore" option.
  649.  
  650.  
  651. [ 9346.346] (II) NOUVEAU(0): Output DVI-I-1 connected
  652.  
  653. Which has as a result that only DVI-I-1 to be connected.
  654.  
  655. [ 9346.346] (II) NOUVEAU(0): Output DVI-I-1 using initial mode 1680x1050
  656.  
  657. and as long as this is the only display, X server picked up the best resolution supported
  658. by my monitor (which makes sense because there is no other other monitor to operate with).
  659.  
  660.  
  661. So, let's try to leave only the HDMI disabled and see what is going to be. To do that
  662. remove the "Ignore" line from Monitor1.
  663.  
  664.  
  665. Section "Monitor"
  666. Identifier "Monitor0"
  667. EndSection
  668.  
  669. Section "Monitor"
  670. Identifier "Monitor1"
  671. EndSection
  672.  
  673. Section "Monitor"
  674. Identifier "Monitor2"
  675. Option "Ignore" "True"
  676. EndSection
  677.  
  678. and Test
  679.  
  680. Works! Here's the expected results:
  681.  
  682.  
  683. ---------- ---------- ----------
  684. | | | | | |
  685. | Primary | | 2ndary | | Disabled |
  686. | | | | | |
  687. ---------- ---------- ----------
  688. | | | | | |
  689. | | | | | |
  690. / \ / \ / \
  691. ===== ===== =====
  692.  
  693. Monitor0 Monitor1 Monitor2
  694. DVI HDMI VGA
  695.  
  696.  
  697.  
  698. let's see the logs:
  699.  
  700. [ 10227.375] (II) NOUVEAU(0): Output DVI-I-1 using monitor section Monitor0
  701. [ 10227.407] (II) NOUVEAU(0): Output HDMI-1 using monitor section Monitor1
  702. [ 10227.439] (II) NOUVEAU(0): Output VGA-1 using monitor section Monitor2
  703. [ 10227.439] (**) NOUVEAU(0): Option "Ignore" "True"
  704.  
  705. That's correct. Only the Monitor2 (VGA) is disabled.
  706.  
  707.  
  708. [ 10227.507] (II) NOUVEAU(0): Output DVI-I-1 connected
  709. [ 10227.507] (II) NOUVEAU(0): Output HDMI-1 connected
  710.  
  711. Again, that's correct. The VGA-1 is disconnected ;)
  712.  
  713. [ 10227.507] (II) NOUVEAU(0): Using exact sizes for initial modes
  714. [ 10227.507] (II) NOUVEAU(0): Output DVI-I-1 using initial mode 1680x1050
  715. [ 10227.507] (II) NOUVEAU(0): Output HDMI-1 using initial mode 1680x1050
  716.  
  717. and also, my two monitors seems to have same resolution.
  718.  
  719. So, dual-head works. What's happens and thins go crazy when I am using 3 connected monitors.
  720. So, far to my understaning is that the only thing that changes is the placement. When
  721. we have two monitors, it's pretty normal that one is going to be "left" and the other
  722. is going to be "right". For my current configuration, the primary monitor is the left one,
  723. which is monitor0. This can be also verified from gnome:
  724.  
  725. Monitor0 ---> Primary
  726. Monitor1 ---> Secondary
  727.  
  728. so, if I need to place a third monitor, maybe we need to statically say to X Server
  729. where my third monitor is going to be:
  730.  
  731. Section "Monitor"
  732. Identifier "Monitor0"
  733. EndSection
  734.  
  735. Section "Monitor"
  736. Identifier "Monitor1"
  737. EndSection
  738.  
  739. Section "Monitor"
  740. Identifier "Monitor2"
  741. Option "RightOf" "Monitor1"
  742.  
  743.  
  744. let's test it
  745.  
  746. Well, not exactly what I was expected:
  747.  
  748. ---------- ---------- ----------
  749. | | | | | |
  750. | NoSignal | | Primary | | 2ndary |
  751. | | | | | |
  752. ---------- ---------- ----------
  753. | | | | | |
  754. | | | | | |
  755. / \ / \ / \
  756. ===== ===== =====
  757.  
  758. Monitor0 Monitor1 Monitor2
  759. DVI HDMI VGA
  760.  
  761. let's see what the logs have to say about this new thing:
  762.  
  763. [ 10778.986] (II) NOUVEAU(0): Output DVI-I-1 using monitor section Monitor0
  764. [ 10779.018] (II) NOUVEAU(0): Output HDMI-1 using monitor section Monitor1
  765. [ 10779.050] (II) NOUVEAU(0): Output VGA-1 using monitor section Monitor2
  766. [ 10779.050] (**) NOUVEAU(0): Option "RightOf" "Monitor1"
  767.  
  768. which is correct.
  769.  
  770.  
  771. [ 10779.151] (II) NOUVEAU(0): Output DVI-I-1 connected
  772. [ 10779.151] (II) NOUVEAU(0): Output HDMI-1 connected
  773. [ 10779.151] (II) NOUVEAU(0): Output VGA-1 connected
  774.  
  775. which is correct
  776.  
  777. [ 10779.151] (II) NOUVEAU(0): Using user preference for initial modes
  778. [ 10779.151] (II) NOUVEAU(0): Output DVI-I-1 using initial mode 1680x1050
  779. [ 10779.151] (II) NOUVEAU(0): Output HDMI-1 using initial mode 1680x1050
  780. [ 10779.151] (II) NOUVEAU(0): Output VGA-1 using initial mode 1600x900
  781.  
  782. My third monitor uses different resolution (doesn't supprot 1680x1050).
  783. So, as a last chance let's try to say the place for its display except from
  784. the primary one (monitor0).
  785.  
  786. Section "Monitor"
  787. Identifier "Monitor0"
  788. EndSection
  789.  
  790. Section "Monitor"
  791. Identifier "Monitor1"
  792. Option "RightOf" "Monitor0"
  793. EndSection
  794.  
  795. Section "Monitor"
  796. Identifier "Monitor2"
  797. Option "RightOf" "Monitor1"
  798. EndSection
  799.  
  800.  
  801.  
  802.  
  803. AAnd test...
  804.  
  805. same result....
  806.  
  807.  
  808. After a *lot* of hacking into the "xorg.conf" file I didn't manage to enable all three monitors.
  809. The problem seems to be the CRTC. Most hardware only have 2 CRTCs, which means that they have only
  810. 2 rendering pipelines. Simply put, only two 2 displays output ports can be enabled at the same time.
  811. I can see the CRTC using xrandr:
  812.  
  813. :~> xrandr --verbose | grep CRTC
  814.  
  815. CRTCs: 0 1
  816. CRTC: 0
  817. CRTCs: 0 1
  818. CRTC: 1
  819. CRTCs: 0 1
  820.  
  821. Which means:
  822.  
  823. Monitor0 (DVI) --> Supports: 0 and 1 --> Enabled: none , so that's why it is turned off
  824. Monitor1 (HDMI) --> Supports: 0 and 1 --> Enabled: 0 (Working)
  825. Monitor1 (VGA) --> Supports: 0 and 1 --> Enabled: 1 (Working)
  826.  
  827. This is why X Server disabled one display out of three, because there's no enough CRTCs to use.
  828. Thus, we are doomed to use only 2 monitors.
  829.  
  830.  
  831. 6. DualHead Setup:
  832. ~~~~~~~~~~~~~~~~~~
  833.  
  834. Since I am going to use only two monitors, I will pick the monitors that they have
  835. the same resolution. But before configure and visual screen (shared window), let's enable them:
  836.  
  837.  
  838.  
  839. ---------- ---------- ----------
  840. | | | | | |
  841. | Primary | | Secondary| | Off |
  842. | | | | | |
  843. ---------- ---------- ----------
  844. | | | | | |
  845. | | | | | |
  846. / \ / \ / \
  847. ===== ===== =====
  848.  
  849. Monitor0 Monitor1 Monitor2
  850. DVI HDMI VGA
  851.  
  852.  
  853.  
  854. This is the setup we I am going to start with:
  855.  
  856. Section "ServerLayout"
  857. Identifier "DualHead Setup with nouveau" # Let's change the name from triple to dual
  858. Screen 0 "Screen0" 0 0
  859. EndSection
  860.  
  861. Section "Monitor"
  862. Identifier "Monitor0"
  863. Option "Primary" "True" # Force Monitor0 to be the Primary one
  864. EndSection
  865.  
  866. Section "Monitor"
  867. Identifier "Monitor1"
  868. Option "RightOf" "Monitor0" # This is going to be the secondary display
  869. EndSection
  870.  
  871. Section "Monitor"
  872. Identifier "Monitor2"
  873. Option "RightOf" "Monitor1"
  874. Option "Ignore" "True" # Turn this off (no CRTC left)
  875. EndSection
  876.  
  877. Section "Device"
  878. Identifier "Card0"
  879. Driver "nouveau"
  880. BusID "PCI:1:0:0"
  881. Option "Monitor-DVI-I-1" "Monitor0"
  882. Option "Monitor-HDMI-1" "Monitor1"
  883. Option "Monitor-VGA-1" "Monitor2"
  884. EndSection
  885.  
  886.  
  887. Section "Screen"
  888. Identifier "Screen0"
  889. Device "Card0"
  890. Monitor "Monitor0"
  891. EndSection
  892.  
  893.  
  894. and let's test.
  895.  
  896. And it works. The result is as expected:
  897.  
  898.  
  899. ---------- ---------- ----------
  900. | | | | | |
  901. | Primary | | Secondary| | Off |
  902. | | | | | |
  903. ---------- ---------- ----------
  904. | | | | | |
  905. | | | | | |
  906. / \ / \ / \
  907. ===== ===== =====
  908.  
  909. Monitor0 Monitor1 Monitor2
  910. DVI HDMI VGA
  911.  
  912.  
  913.  
  914. let's see the logs:
  915.  
  916.  
  917. [ 66561.307] (II) NOUVEAU(0): Output DVI-I-1 using monitor section Monitor0
  918. [ 66561.307] (**) NOUVEAU(0): Option "Primary" "True"
  919. [ 66561.339] (II) NOUVEAU(0): Output HDMI-1 using monitor section Monitor1
  920. [ 66561.339] (**) NOUVEAU(0): Option "RightOf" "Monitor0"
  921. [ 66561.371] (II) NOUVEAU(0): Output VGA-1 using monitor section Monitor2
  922. [ 66561.371] (**) NOUVEAU(0): Option "RightOf" "Monitor1"
  923. [ 66561.371] (**) NOUVEAU(0): Option "Ignore" "True"
  924. ...
  925. ...
  926. ...
  927. [ 66561.440] (II) NOUVEAU(0): Output DVI-I-1 connected
  928. [ 66561.440] (II) NOUVEAU(0): Output HDMI-1 connected
  929.  
  930.  
  931. which is correct. We had to disable the 3rd screen (Monitor1) because our hardware
  932. supports only 2 CRTCS:
  933.  
  934. [ 66561.371] (II) NOUVEAU(0): 2 crtcs needed for screen.
  935. [ 66561.375] (II) NOUVEAU(0): Allocated crtc nr. 0 to this screen.
  936. [ 66561.375] (II) NOUVEAU(0): Allocated crtc nr. 1 to this screen.
  937.  
  938. Indeed, X Server confirms that 2 CRTCs are needed for the screen:
  939.  
  940. ------------------------
  941. CRTC 0 ---> | |
  942. CRTC 1 ---> | Monitor0 Monitor1 |
  943. | |
  944. ------------------------
  945. | |
  946. | |
  947. / \
  948. =====
  949.  
  950.  
  951. Let's see what resolution is picked from X automatically:
  952.  
  953. [ 66561.440] (II) NOUVEAU(0): Using user preference for initial modes
  954. [ 66561.440] (II) NOUVEAU(0): Output DVI-I-1 using initial mode 1680x1050
  955. [ 66561.440] (II) NOUVEAU(0): Output HDMI-1 using initial mode 1680x1050
  956.  
  957. As expected, 1680x1050 is the top resolution for each of my individual displays,
  958. thus X server picked this up for both of them.
  959.  
  960. The "trick" I love in this configuration is that we are using only one screen,
  961. called "Screen0". This config, forced X Server to automatically combine
  962. my two monitors, into the same screen, and not separate. Simply put,
  963. there's only one DISPLAY env variable for both of my displays, which means
  964. that I can share windows (moving them from one display to another).
  965. The technical term for this Screen is called "Visual Screen", which
  966. unifies the monitors into a greater resolution:
  967.  
  968.  
  969. 1680 + 1680 = 3360
  970. -----------------------------
  971. | ----------- ----------- |
  972. | | | | | |
  973. | | 1680x1050 | | 1680x1050 | |
  974. | | | | | |
  975. | ----------- ----------- |
  976. | | | | | |
  977. | | | | | |
  978. | / \ / \ |
  979. | ===== ===== |
  980. -----------------------------
  981. | |
  982. | |
  983. / \
  984. / \
  985. =========
  986.  
  987. Visual Screen 3360x1050
  988.  
  989.  
  990. So, let's see if my calculations are related to logs:
  991.  
  992. [ 66561.440] (--) NOUVEAU(0): Virtual size is 3360x1050 (pitch 0)
  993.  
  994. indeed they are :)
  995. So, the the X Server picked the correct mode (resolution + refresh rate) and combined them altogether:
  996.  
  997. [ 66561.440] (**) NOUVEAU(0): Driver mode "1680x1050": 146.2 MHz (scaled from 0.0 MHz), 65.3 kHz, 60.0 Hz
  998. [ 66561.440] (II) NOUVEAU(0): Modeline "1680x1050"x60.0 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync (65.3 kHz eP)
  999.  
  1000.  
  1001. If the X Server has problem detecting the best mode, you have to explicitely, set it up into the "xorg.conf"
  1002. But first you need to know the complete list of modes that your display supports:
  1003.  
  1004. :~ # xrandr
  1005.  
  1006. DVI-I-1 connected primary 1680x1050+0+0 (normal left inverted right x axis y axis) 473mm x 296mm
  1007. 1680x1050 59.88*+
  1008. 1280x1024 75.02 60.02
  1009. 1152x864 75.00
  1010. 1024x768 75.08 60.00
  1011. 800x600 75.00 60.32
  1012. 640x480 75.00 60.00
  1013. 720x400 70.08
  1014.  
  1015. HDMI-1 connected 1680x1050+1680+0 (normal left inverted right x axis y axis) 473mm x 296mm
  1016. 1680x1050 59.95*+
  1017. 1280x1024 75.02 60.02
  1018. 1152x864 75.00
  1019. 1024x768 75.08 60.00
  1020. 800x600 75.00 60.32
  1021. 640x480 75.00 60.00
  1022. 720x400 70.08
  1023.  
  1024.  
  1025. So, for my displays, the best mode for them to work together is 1680x1050@59.95
  1026. In order to generate the "modeline" I am going to use the "gtf" tool:
  1027.  
  1028. gtf 1680 1050 59.95
  1029.  
  1030. # 1680x1050 @ 59.95 Hz (GTF) hsync: 65.17 kHz; pclk: 147.01 MHz
  1031. Modeline "1680x1050_59.95" 147.01 1680 1784 1968 2256 1050 1051 1054 1087 -HSync +Vsync
  1032.  
  1033. and then you have to put this info in your "xorg.conf". For my case this optional, because
  1034. X Server already pick this modeline by itself, but it not quite optimized:
  1035.  
  1036.  
  1037. X Server ---> Modeline "1680x1050"x60.0 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync (65.3 kHz eP)
  1038. gtf version ---> Modeline "1680x1050_59.95" 147.01 1680 1784 1968 2256 1050 1051 1054 1087 -HSync +Vsync
  1039.  
  1040. So, let's put the "gtf" result into my Xorg and see what happens:
  1041.  
  1042.  
  1043. Section "ServerLayout"
  1044. Identifier "DualHead Setup with nouveau"
  1045. Screen 0 "Screen0" 0 0
  1046. EndSection
  1047.  
  1048. Section "Monitor"
  1049. Identifier "Monitor0"
  1050. Option "Primary" "True"
  1051. Modeline "1680x1050_59.95" 147.01 1680 1784 1968 2256 1050 1051 1054 1087 -HSync +Vsync # The gtf version
  1052. Option "PreferredMode" "1680x1050_59.95" # Tell X to pick the gtf version
  1053. EndSection
  1054.  
  1055. Section "Monitor"
  1056. Identifier "Monitor1"
  1057. Option "RightOf" "Monitor0"
  1058. Modeline "1680x1050_59.95" 147.01 1680 1784 1968 2256 1050 1051 1054 1087 -HSync +Vsync # same
  1059. Option "PreferredMode" "1680x1050_59.95" # same
  1060. EndSection
  1061.  
  1062. Section "Monitor"
  1063. Identifier "Monitor2"
  1064. Option "RightOf" "Monitor1"
  1065. Option "Ignore" "True"
  1066. EndSection
  1067.  
  1068. Section "Device"
  1069. Identifier "Card0"
  1070. Driver "nouveau"
  1071. BusID "PCI:1:0:0"
  1072. Option "Monitor-DVI-I-1" "Monitor0"
  1073. Option "Monitor-HDMI-1" "Monitor1"
  1074. Option "Monitor-VGA-1" "Monitor2"
  1075. EndSection
  1076.  
  1077.  
  1078. Section "Screen"
  1079. Identifier "Screen0"
  1080. Device "Card0"
  1081. Monitor "Monitor0"
  1082.  
  1083. SubSection "Display" # Define the Virtual screen
  1084. Depth 24 # 24 is kind of a default nowadays
  1085. Virtual 3360 1050 # The visual screen resolution
  1086. EndSubSection
  1087.  
  1088. EndSection
  1089.  
  1090.  
  1091. And test it...
  1092.  
  1093. All good! Let's see the logs:
  1094.  
  1095. [ 74689.115] (II) NOUVEAU(0): Using user preference for initial modes
  1096. [ 74689.115] (II) NOUVEAU(0): Output DVI-I-1 using initial mode 1680x1050_59.95
  1097. [ 74689.115] (II) NOUVEAU(0): Output HDMI-1 using initial mode 1680x1050_59.95
  1098.  
  1099. Ah so, the X server picked our preference and used our modeline. Great :D
  1100.  
  1101.  
  1102. [ 74689.115] (--) NOUVEAU(0): Virtual size is 3360x1050 (pitch 0)
  1103. [ 74689.115] (**) NOUVEAU(0): Mode "1680x1050_59.95": 147.0 MHz (scaled from 0.0 MHz), 65.2 kHz, 59.9 Hz
  1104. [ 74689.115] (II) NOUVEAU(0): Modeline "1680x1050_59.95"x59.9 147.01 1680 1784 1968 2256 1050 1051 1054 1087 -hsync +vsync (65.2 kHz UP)
  1105.  
  1106.  
  1107. Here you can compare 1:1 the Modeline that X Server is using now, which is identicall to the "gtf".
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement