Два монитора в linux xorg conf

xorg.conf и 2 монитора

Сейчас картинка дублируется на обоих мониторах. Гуглил, настраивал, но не заработало.
Заранее спасибо.

vdemin avatar

Section "ServerLayout" Identifier "X.org Configured" Screen 0 "Screen0" Screen 1 "Screen1" LeftOf "Screen0" Option "Xinerama" "1" InputDevice "Mouse0" "CorePointer" InputDevice "Keyboard0" "CoreKeyboard" EndSection Section "Files" ModulePath "/usr/lib/xorg/modules" FontPath "/usr/share/fonts/misc/" FontPath "/usr/share/fonts/TTF/" FontPath "/usr/share/fonts/OTF/" FontPath "/usr/share/fonts/Type1/" FontPath "/usr/share/fonts/100dpi/" FontPath "/usr/share/fonts/75dpi/" EndSection Section "Module" Load "extmod" Load "glx" Load "record" Load "dri2" Load "dri" Load "dbe" EndSection Section "InputDevice" Identifier "Keyboard0" Driver "kbd" EndSection Section "InputDevice" Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/input/mice" Option "ZAxisMapping" "4 5 6 7" EndSection Section "Monitor" #DisplaySize 340 270 # mm Identifier "Monitor0" Option "Enable" "true" VendorName "DEL" ModelName "DELL E178FP" HorizSync 31.0 - 80.0 VertRefresh 56.0 - 75.0 Option "DPMS" EndSection Section "Monitor" #DisplaySize 340 270 # mm Identifier "Monitor1" Option "Enable" "true" VendorName "DEL" ModelName "DELL E178FP" HorizSync 31.0 - 80.0 VertRefresh 56.0 - 75.0 Option "DPMS" EndSection Section "Device" Identifier "Device0" Driver "mga" Screen 1 BusID "PCI:3:0:0" EndSection Section "Device" Identifier "Device1" Driver "mga" Screen 1 BusID "PCI:3:0:0" EndSection Section "Screen" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 Option "TwinView" "0" SubSection "Display" Depth 24 Modes "1280x1024_60.00" Viewport 0 0 Depth 1 EndSubSection SubSection "Display" Depth 24 Modes "1280x1024_60.00" Viewport 0 0 Depth 4 EndSubSection SubSection "Display" Depth 24 #Modes "1280x1024_60.00" Viewport 0 0 Depth 8 EndSubSection SubSection "Display" Depth 24 Modes "1280x1024_60.00" Viewport 0 0 Depth 15 EndSubSection SubSection "Display" Depth 24 #Modes "1280x1024_60.00" Viewport 0 0 Depth 16 EndSubSection SubSection "Display" Depth 24 Modes "1280x1024_60.00" Viewport 0 0 Depth 24 EndSubSection EndSection Section "Screen" Identifier "Screen1" Device "Device1" Monitor "Monitor1" DefaultDepth 24 Option "TwinView" "0" SubSection "Display" Depth 24 Modes "1280x1024_60.00" Viewport 0 0 Depth 1 EndSubSection SubSection "Display" Depth 24 Modes "1280x1024_60.00" Viewport 0 0 Depth 4 EndSubSection SubSection "Display" Depth 24 Modes "1280x1024_75.00" Viewport 0 0 Depth 8 EndSubSection SubSection "Display" Depth 24 Modes "1280x1024_60.00" Viewport 0 0 Depth 15 EndSubSection SubSection "Display" Depth 24 #Modes "1280x1024_60.00" Viewport 0 0 Depth 16 EndSubSection SubSection "Display" Depth 24 Modes "1280x1024_60.00" Viewport 0 0 Depth 24 EndSubSection EndSection

На обоих монитора табличка с надпись, что оптимальное разрешение [email protected]

/offtop
Вау, неужели dell 1905fp?
у меня такой же 😉

© 2006-2023, Русскоязычное сообщество Arch Linux.
Название и логотип Arch Linux ™ являются признанными торговыми марками.
Linux ® — зарегистрированная торговая марка Linus Torvalds и LMI.

Источник

Update — partial success:

Edit: One additional note: I have tried supplying the PCI IDs under the «Device» section like BusID «PCI:44:0:0» . That actually seems to be the cause of my earlier problem with X not starting with:

[ 229.284] (WW) xf86OpenConsole: setpgid failed: Operation not permitted [ 229.284] (WW) xf86OpenConsole: setsid failed: Operation not permitted 

Yet another update

I removed the PCI BusID specification from the Device section of xorg.conf , as for some reason it prevented me from starting X with the xf86OpenConsole errors mentioned above. However I did notice that Nvidias more recent documentation suggests using a ServerLayout section. I added the second screen to this section, and it did change the output of xrandr , but not in the way I wanted. It still only mentions Screen0, but now there is no info about my HDMI monitor (although I have a cursor on it). This is now the output of xrandr :

~$ sudo xrandr -q Screen 0: minimum 8 x 8, current 1600 x 1200, maximum 16384 x 16384 VGA-0 disconnected primary (normal left inverted right x axis y axis) DVI-D-0 connected 1600x1200+0+0 (normal left inverted right x axis y axis) 367mm x 275mm 1600x1200 60.00*+ 1280x1024 75.02 60.02 1152x864 75.00 1024x768 75.03 60.00 800x600 75.00 60.32 640x480 75.00 59.94 

And my xorg.conf currently looks like this:

Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" 0 0 Screen 1 "Screen1" rightOf "Screen0" InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" EndSection Section "Files" EndSection Section "InputDevice" # generated from default Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/psaux" Option "Emulate3Buttons" "no" Option "ZAxisMapping" "4 5" EndSection Section "InputDevice" # generated from default Identifier "Keyboard0" Driver "kbd" EndSection Section "Monitor" Identifier "Monitor0" VendorName "Unknown" ModelName "Unknown" Option "DPMS" "DVI" EndSection Section "Device" Identifier "Device0" Driver "nvidia" Screen 0 VendorName "NVIDIA Corporation" Option "Monitor-DVI-D-0" "DVI" EndSection Section "Screen" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 SubSection "Display" Depth 24 EndSubSection EndSection Section "Monitor" Identifier "Monitor1" VendorName "Unknown" ModelName "Unknown" Option "DPMS" "HDMI" EndSection Section "Device" Identifier "Device1" Driver "nvidia" Screen 1 VendorName "NVIDIA Corporation" Option "Monitor-HDMI-0" "HDMI" EndSection Section "Screen" Identifier "Screen1" Device "Device1" Monitor "Monitor1" DefaultDepth 24 SubSection "Display" Depth 24 EndSubSection EndSection 

Edit: One more thing: I tried adding Option «ZaphodHeads» to my Device sections, but that did not help. Perhaps it isn’t what I wanted, or maybe I didn’t configure it correctly, I don’t know.

Читайте также:  Настройка ftp клиента linux

Источник

Xorg/Multiple monitors

Important
Anything passing for a modern Xorg has autoconfiguration and RandR extension which means that it should just work and any configuration can be done either via xrandr command line tool or a graphical tool provided by your desktop environment assuming you’re using one. Nevertheless this article can prove useful for legacy or advanced use cases.

This page describes the setup of multiple monitors under Xorg. Multihead support in X has luckily progressed in recent versions, so it is pretty easy to set up. Usually it is as simple as defining monitors in Xorg configuration files.

Installation

USE flags

Be aware, most desktop environments, window managers, and graphical toolkit require the xinerama USE flag to be enabled in order to support multiple monitors. When preparing to add second (or third!) monitor to the system, be sure to add this flag to /etc/portage/make.conf :

Emerge

Configuration

Simple

The basic procedure is defining one «Monitor» section per Monitor and then tying everything together in a «Device» section that specifies the video chip driving the monitor(s). For the following examples, Xorg’s configuration is presumed to be stored in /etc/X11/xorg.conf.d (no /etc/X11/xorg.conf file will be used). Alternatively, if the user desires, all files defined in the xorg.conf.d folder can be combined together to form an xorg.conf . The following example is the basic version for two monitors of the same resolution.

 
Section "Monitor" Identifier "DVI" EndSection 
 
Section "Monitor" Identifier "DP" Option "LeftOf" "DVI" EndSection 

Each "Monitor" section must contain an Identifier, everything else is optional. The identifier may be freely chosen. The placement of the monitors is done relatively with one of the keywords RightOf , LeftOf , Above , or Below . Additionally there is a Relative keyword for fancy cases, however this article avoids using it. Each monitor can receive custom options (e.g. resolution) in its configuration.

Next the monitors need to be mapped to the outputs. This is done in the Device section describing the video chip and driver. The Device section of the two monitor example (using an Intel video card) would look like the following.

 
Section "Device" Identifier "Device0" Option "Monitor-DVI2" "DVI" Option "Monitor-DP1" "DP" Driver "intel" EndSection 

Important
The Driver keyword has to be updated using the system's video card. Common options are intel , radeon or nouveau .

The names of the monitors are in the form "Monitor-". The port each monitor was on was determined by running the xrandr -q command. This should be everything needed for a basic setup.

More complex cases

Sometimes more complex layouts will be needed. A third example of a monitor file, with resolution options could look like the following.

FILE /etc/X11/xorg.conf.d/43-lvds-monitor.conf Advanced configuration with resolution defined

 
Section "Monitor" Modeline "1280x800x60" 71.00 1280 1328 1360 1440 800 803 809 823 Option "PreferredMode" "1280x800" Identifier "LVDS" Option "RightOf" "DVI" VendorName "CMO" EndSection 

It is possible to see in the example above that manufacturer names can be used to get a single config file attached to a single device.

Next a more complete example of the video configuration for x11-drivers/xf86-video-intel package will be provided:

 
Section "Device" Option "Monitor-DVI2" "DVI" Option "Monitor-DP1" "DP" Option "Monitor-LVDS2" "LVDS" Option "AccelMethod" "sna" Option "TearFree" "true" Option "DRI" "True" Option "XvMCSurfaces" "6" Identifier "GMA-X4500" Driver "intel" EndSection 

The following was made for the x11-drivers/xf86-video-ati radeon driver. Notice the change of the video output name on the same laptop.

 
Section "Device" Option "Monitor-DVI-0" "DVI" Option "Monitor-HDMI-0" "DP" Option "Monitor-LVDS" "LVDS" Option "AccelMethod" "EXA" Option "ClockGating" "On" Option "ForceLowPowerMode" "On" Option "VGAAccess" "On" Identifier "HD3450" Driver "radeon" Option "MonitorLayout" "LVDS, AUTO" EndSection 

Note
If the x11-drivers/ati-drivers package is being used, to increase the Virtual in xorg.conf it must be an exact multiple of the highest resolution monitor. For instance, if the largest monitor is 1920x1080, enter 3840 2160 for Virtual. This will enable xrandr to work properly. This is a problem and appears to be a bug.

Different resolutions

Xrandr-1.3 is a little deficient in this regard. X can precisely probe the screen devices, but xrandr will get/display the minimum resolution fitted to the smallest screen attached to the machine. This is annoying because it creates a debug situation. Xorg.0.log has to be read in order to get possible monitor resolutions, define a few modes with xrandr, and then choose a video mode with xrandr. There is nothing user friendly about the process. The process usually takes matter of minutes, but is annoying when a user desires to attach a bigger screen to a computer for a simple event like watching a movie. The latter can be achieved, somewhat, with the following example.

 
Section "Monitor" Option "SyncOnGreen" "True" Modeline "1280x1024x85" 157.50 1280 1344 1504 1728 1024 1025 1028 1072 Modeline "1600x1200x85" 229.50 1600 1664 1856 2160 1200 1201 1204 1250 Modeline "1600x1200x75" 202.50 1600 1664 1856 2160 1200 1201 1204 1250 Option "PreferredMode" "1600x1200" Identifier "VGA" VendorName "GSM" EndSection 

Troubleshooting

Bug: Anyone can notice the level of fine probing X server does (or rather x11-drivers/xf86-input-evdev). Numerous handy details are provided (numerous screen resolutions, gamma values, and other obscure values). One can pick any defined video mode on the list and X server display it. Now, whenever anyone desires to change the video mode of a particular display xrandr will complain about non-existant modes. What? The video modes vanished somewhere? The only that remain are the ones that can fit to the biggest resolution on the smallest display. To get more video modes copy/paste some preferred video modes like in the example above.

Источник

Оцените статью
Adblock
detector