Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: [EN] Setting up xorg for three monitors  (Read 3473 times)

Offline finotti

  • User
  • Posts: 273
[EN] Setting up xorg for three monitors
« on: 2023/09/11, 22:47:07 »
I've been able to set up my three monitors in plasma, but I wanted to have it set in xorg.conf, if possible:

Code: [Select]
$ xrandr
Screen 0: minimum 320 x 200, current 5560 x 1920, maximum 16384 x 16384
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
HDMI-2 disconnected (normal left inverted right x axis y axis)
DP-3 connected 1920x1200+0+360 (normal left inverted right x axis y axis) 518mm x 324mm
   1920x1200     59.95*+
   1920x1080     60.00    50.00    50.00    59.94
   1600x1200     60.00
   1680x1050     59.95
   1280x1024     75.02    72.05    60.02
   1440x900      74.98    59.89
   1280x720      60.00    50.00    59.94
   1024x768      75.03    70.07    60.00
   800x600       72.19    75.00    60.32
   720x576       50.00
   720x480       60.00    59.94
   640x480       75.00    72.81    66.03    60.00    59.94
   720x400       70.08
HDMI-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
HDMI-4 disconnected (normal left inverted right x axis y axis)
DisplayPort-1-4 connected primary 2560x1440+1920+240 (normal left inverted right x axis y axis) 597mm x 336mm
   2560x1440     59.95*+
   1920x1200     59.95
   2048x1080     60.00    24.00
   1920x1080     60.00    50.00    59.94    30.00    25.00    24.00    29.97    23.98
   1600x1200     60.00
   1680x1050     59.95
   1280x1024     75.02    60.02
   1440x900      59.95
   1280x800      59.95
   1152x864      75.00
   1280x720      60.00    50.00    59.94
   1024x768      75.03    60.00
   800x600       75.00    60.32
   720x576       50.00
   720x480       60.00    59.94
   640x480       75.00    60.00    59.94
   720x400       70.08
DisplayPort-1-5 connected 1080x1920+4480+0 right (normal left inverted right x axis y axis) 527mm x 296mm
   1920x1080     60.00*+
   1680x1050     60.00
   1600x900      60.00
   1280x1024     75.02    60.02
   1440x900      60.00
   1280x800      60.00
   1152x864      75.00
   1280x720      60.00
   1024x768      75.03    60.00
   800x600       75.00    60.32
   640x480       75.00    59.94
   720x400       70.08
  1920x1080 (0x4c) 148.500MHz +HSync +VSync
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  67.50KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  60.00Hz
  1920x1080 (0x4e) 148.500MHz +HSync +VSync
        h: width  1920 start 2448 end 2492 total 2640 skew    0 clock  56.25KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  50.00Hz
  1920x1080 (0x4f) 148.352MHz +HSync +VSync
        h: width  1920 start 2008 end 2052 total 2200 skew    0 clock  67.43KHz
        v: height 1080 start 1084 end 1089 total 1125           clock  59.94Hz
  1600x1200 (0x50) 162.000MHz +HSync +VSync
        h: width  1600 start 1664 end 1856 total 2160 skew    0 clock  75.00KHz
        v: height 1200 start 1201 end 1204 total 1250           clock  60.00Hz
  1280x1024 (0x52) 135.000MHz +HSync +VSync
        h: width  1280 start 1296 end 1440 total 1688 skew    0 clock  79.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  75.02Hz
  1280x1024 (0x54) 108.000MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock  63.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  60.02Hz
  1280x720 (0x57) 74.250MHz +HSync +VSync
        h: width  1280 start 1390 end 1430 total 1650 skew    0 clock  45.00KHz
        v: height  720 start  725 end  730 total  750           clock  60.00Hz
  1280x720 (0x58) 74.250MHz +HSync +VSync
        h: width  1280 start 1720 end 1760 total 1980 skew    0 clock  37.50KHz
        v: height  720 start  725 end  730 total  750           clock  50.00Hz
  1280x720 (0x59) 74.176MHz +HSync +VSync
        h: width  1280 start 1390 end 1430 total 1650 skew    0 clock  44.96KHz
        v: height  720 start  725 end  730 total  750           clock  59.94Hz
  1024x768 (0x5a) 78.750MHz +HSync +VSync
        h: width  1024 start 1040 end 1136 total 1312 skew    0 clock  60.02KHz
        v: height  768 start  769 end  772 total  800           clock  75.03Hz
  1024x768 (0x5c) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x5e) 49.500MHz +HSync +VSync
        h: width   800 start  816 end  896 total 1056 skew    0 clock  46.88KHz
        v: height  600 start  601 end  604 total  625           clock  75.00Hz
  800x600 (0x5f) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  720x576 (0x60) 27.000MHz -HSync -VSync
        h: width   720 start  732 end  796 total  864 skew    0 clock  31.25KHz
        v: height  576 start  581 end  586 total  625           clock  50.00Hz
  720x480 (0x61) 27.027MHz -HSync -VSync
        h: width   720 start  736 end  798 total  858 skew    0 clock  31.50KHz
        v: height  480 start  489 end  495 total  525           clock  60.00Hz
  720x480 (0x62) 27.000MHz -HSync -VSync
        h: width   720 start  736 end  798 total  858 skew    0 clock  31.47KHz
        v: height  480 start  489 end  495 total  525           clock  59.94Hz
  640x480 (0x63) 31.500MHz -HSync -VSync
        h: width   640 start  656 end  720 total  840 skew    0 clock  37.50KHz
        v: height  480 start  481 end  484 total  500           clock  75.00Hz
  640x480 (0x66) 25.200MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.50KHz
        v: height  480 start  490 end  492 total  525           clock  60.00Hz
  640x480 (0x67) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz
  720x400 (0x68) 28.320MHz -HSync +VSync
        h: width   720 start  738 end  846 total  900 skew    0 clock  31.47KHz
        v: height  400 start  412 end  414 total  449           clock  70.08Hz

Code: [Select]
$ inxi -G
Graphics:
  Device-1: Intel Raptor Lake-S GT1 [UHD Graphics 770] driver: i915 v: kernel
  Device-2: AMD Navi 24 [Radeon RX 6300] driver: amdgpu v: kernel
  Device-3: Logitech Webcam C270 driver: snd-usb-audio,uvcvideo type: USB
  Display: x11 server: X.Org v: 1.21.1.8 with: Xwayland v: 23.2.0 driver: X:
    loaded: amdgpu,modesetting unloaded: fbdev,radeon,vesa dri: iris
    gpu: amdgpu,i915 resolution: 1: 1920x1200~60Hz 2: 2560x1440~60Hz
    3: 1080x1920~60Hz
  API: OpenGL v: 4.6 Mesa 23.1.6-1 renderer: Mesa Intel Graphics (RPL-S)

I had tried the following 10-monitor.conf in /etc/X11/xorg.conf.d to copy that set up:

Code: [Select]
Section "Monitor"
    Identifier   "DP-1-5"
    Option       "Primary"    "true"
    Option       "Position"   "1920 240"
EndSection

Section "Monitor"
    Identifier   "DP-1-6"
    Option       "Position"   "4480 0"
    Option       "Rotate"     "right"
EndSection

Section "Monitor"
    Identifier   "DP-3"
    Option       "Position"   "0 360"
EndSection

I noticed that the identifiers from xrandr changed.  (Instead of DP-1-5, it now shows DisplayPort-1-5, for instance.  I assume that's why it did not work...)

How do I find the proper identifier for each monitor?

Offline ro_sid

  • User
  • Posts: 227
Re: Setting up xorg for three monitors
« Reply #1 on: 2023/09/12, 00:20:38 »
Hello! It has been quite some time, that I was manually setting up xorg X11 configurations, but I am pretty sure, the "Identifier" has only a name-giving meaning. You are totally free in your choice. To order "monitors" to your liking, you need to have a devices, screen and monitor section and select the connector/connection via an option in the device(?) section.
Have a look at "How do I configure xorg.conf for two X screens on one Nvidia card?"(https://askubuntu.com/questions/1376935/how-do-i-configure-xorg-conf-for-two-x-screens-on-one-nvidia-card) to get an idea, how to do it.
You can, of course, divide the sections into different files in the xorg.d directory, instead of a putting them into a single file.
« Last Edit: 2023/09/12, 00:28:47 by ro_sid »

Offline finotti

  • User
  • Posts: 273
Re: Setting up xorg for three monitors
« Reply #2 on: 2023/09/14, 22:27:02 »
To order "monitors" to your liking, you need to have a devices, screen and monitor section and select the connector/connection via an option in the device(?) section.

Thanks for the reply!  I checked your suggestions and attempted to fix the issue.  Unfortunately, I could not get it to really work.  SDDM just shows one monitor.

I have two cards, and I used their addresses to add Devices:

Code: [Select]
$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation Raptor Lake-S GT1 [UHD Graphics 770] (rev 04)
03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Navi 24 [Radeon RX 6300]

(You can see xrandr and inxi -G in the previous post.)

Here is what I made:

Code: [Select]
# cat /etc/X11/xorg.conf.d/10-monitor.conf
Section "Monitor"
    Identifier   "Dell27"
    Option       "Primary"    "true"
    Option       "Position"   "1920 240"
EndSection

Section "Monitor"
    Identifier   "Dell24"
    Option       "Position"   "4480 0"
    Option       "Rotate"     "right"
EndSection

Section "Monitor"
    Identifier   "Lenovo"
    Option       "Position"   "0 360"
EndSection

Section "Screen"
  Identifier "ScreenL"
  Device "intel"
  Monitor "Lenovo"
EndSection

Section "Screen"
  Identifier "ScreenM"
  Device "amd"
  Monitor "Dell27"
EndSection

Section "Screen"
  Identifier "ScreenR"
  Device "amd"
  Monitor "Dell24"
EndSection

Code: [Select]
# cat /etc/X11/xorg.conf.d/20-amdgpu.conf
#Section "OutputClass"
#     Identifier "AMD"
#     MatchDriver "amdgpu"
#     Driver "amdgpu"
#EndSection

Section "Device"
    Identifier "intel"
    #Driver "intel"
    BusID "PCI:00:02:0"
    #Screen 0
EndSection

Section "Device"
    Identifier "amd"
    Driver "amdgpu"
    BusID "PCI:03:00:0"
    #Screen 1
EndSection

I get no errors in /var/log/Xorg.0.log and SDDM start with no problems, but only one monitor (the one connected to the intel card) starts.

If I switch to a TTY, the same monitor switches, but the other two display what was there before in the X session.

It is not a huge deal, but it would be nice if it could work properly...

Offline eriefisher

  • User
  • Posts: 267
Re: Setting up xorg for three monitors
« Reply #3 on: 2023/09/15, 01:29:04 »
SDDM starts the xserver so your configuration is likely being ignored. You need to tell SDDM what to do. Not sure if this is still relavent but it might get you started. I don't know much about SDDM as I really don't like it and replace it with LightDM,

https://blog.victormendonca.com/2018/06/29/how-to-fix-sddm-on-multiple-screens/

Offline finotti

  • User
  • Posts: 273
Re: Setting up xorg for three monitors
« Reply #4 on: 2023/09/15, 18:35:15 »
SDDM starts the xserver so your configuration is likely being ignored. You need to tell SDDM what to do. Not sure if this is still relavent but it might get you started. I don't know much about SDDM as I really don't like it and replace it with LightDM,

https://blog.victormendonca.com/2018/06/29/how-to-fix-sddm-on-multiple-screens/

Thanks for that!  This did fix SDDM, where now the login screen appears in all monitors.

The thing that still remains (and bothers me) is that when changing to a TTY, only my left screen goes to it, while the middle and right screen still show the plasma desktop.  This makes me have to type looking to the left monitor instead of the center one... 

With my previous computer (and two monitors), when going to a TTY, all monitors would display the same content (from the terminal).  That was much better, and I can't seem to make it work.

Offline ro_sid

  • User
  • Posts: 227
Re: Setting up xorg for three monitors
« Reply #5 on: 2023/09/15, 19:21:44 »
Do you now use the much simpler and more elegant configuration from eriefisher's link alone, or are the xorg.conf.d files still also installed and active?

I am asking, because all display managers I worked with (wdm, lightdm, and (to my dismay) gdm3 (because of Ubuntu)) also did respect the xorg definition; and I believe, they had to. I do not know, if sddm behaves different.

With your xorg files/addtions, I do not see how you address the different connectors on the card with the two monitors hanging from.