Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Turn xrandr script into xorg.conf.d configuration
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
AndrewAmmerlaan
Developer
Developer


Joined: 25 Jun 2014
Posts: 277
Location: Nijmegen

PostPosted: Mon Oct 19, 2020 8:29 pm    Post subject: Turn xrandr script into xorg.conf.d configuration Reply with quote

Hi,

So I've been messing around with sys-boot/plymouth, and it works rather nice once I got that up and running. However it breaks my X configuration.

I have a script in /usr/share/sddm/scripts/Xsetup that takes care of the the monitor configuration:
Code:

#!/bin/sh
# Xsetup - run as root before the login dialog appears

# Allow use of monitors connected to both GPUs
xrandr --setprovideroutputsource 1 0

# Monitor configuration
xrandr --output HDMI-3 --mode 1600x900 --pos 0x1080 --output DVI-D-1-0 --primary --mode 1920x1080 --pos 1600x1080 --output HDMI-A-1-0 --mode 1920x1080 --pos 1600x0 --output DP-5 --mode 1440x900 --pos 3520x1080


Now normally the Intel card is the default(=boot) GPU, and the first command sets the AMD GPU to offload to the Intel GPU (so I can use DRI_PRIME=1 to render heavy things on the AMD card, while the rest is rendered on the Intel card)
And normally the AMD GPU uses the amdgpu driver, and the intel card uses the modesetting driver.

However, when plymouth is enabled things change for some reason. The AMD card is now the default GPU (even though the Intel card is still set as the boot GPU in the BIOS), and the AMD GPU is using the modesetting driver all of a sudden (and the modesetting driver is very buggy with AMD cards in a dual-gpu setup).

If I run `rc-service xdm restart` after plymouth has started sddm works as expected again. This only happens if SDDM is run directly after Plymouth.

Now the solution I thought of was to turn the Xsetup script into xorg.conf configuration files, so far I've got:

xorg.conf.d/gpus.conf:
Code:

Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
### <percent>: "<f>%"
### [arg]: arg optional
#Option     "SWcursor"                  # [<bool>]
#Option     "kmsdev"                    # <str>
#Option     "ShadowFB"                  # [<bool>]
#Option     "AccelMethod"               # <str>
#Option     "PageFlip"                  # [<bool>]
#Option     "ZaphodHeads"               # <str>
#Option     "DoubleShadow"              # [<bool>]
#Option     "Atomic"                    # [<bool>]
Identifier  "Intel"
Driver      "modesetting"
BusID       "PCI:0:2:0"
EndSection
Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
### <percent>: "<f>%"
### [arg]: arg optional
#Option     "Accel"                     # [<bool>]
#Option     "SWcursor"                  # [<bool>]
#Option     "EnablePageFlip"            # [<bool>]
#Option     "SubPixelOrder"             # [<str>]
#Option     "ZaphodHeads"               # <str>
#Option     "AccelMethod"               # <str>
#Option     "DRI3"                      # [<bool>]
#Option     "DRI"                       # <i>
#Option     "ShadowPrimary"             # [<bool>]
#Option     "TearFree"                  # [<bool>]
#Option     "DeleteUnusedDP12Displays"  # [<bool>]
#Option     "VariableRefresh"           # [<bool>]
Identifier  "AMD"
Driver      "amdgpu"
BusID       "PCI:1:0:0"
EndSection


xorg.conf.d/monitors.conf:
Code:

Section "Monitor"
Identifier  "HDMI-3"
Modeline    "1600x900_60.0"  108.00  1600 1624 1704 1800  900 901 904 1000 +hsync +vsync
Option      "PreferredMode" "1600x900_60.0"
Option      "Position" "0 1080"
EndSection
Section "Monitor"
Identifier  "DVI-D-1-0"
Option      "Primary" "true"
Modeline    "1920x1080_60.0"  148.50  1920 2008 2052 2200  1080 1084 1089 1125 +hsync +vsync
Option      "PreferredMode" "1920x1080_60.0"
Option      "Position" "1600 1080"
EndSection
Section "Monitor"
Identifier  "DP-5"
Modeline    "1440x900_59.9"  106.50  1440 1520 1672 1904  900 903 909 934 -hsync +vsync
Option      "PreferredMode" "1440x900_59.9"
Option      "Position" "3520 1080"
EndSection
Section "Monitor"
Identifier  "HDMI-A-1-0"
Modeline    "1920x1080_60.0"  148.50  1920 2008 2052 2200  1080 1084 1089 1125 +hsync -vsync
Option      "PreferredMode" "1920x1080_60.0"
Option      "Position" "1600 0"
EndSection


xorg.conf.d/screen.conf:
Code:

Section "ServerLayout"
Identifier     "X.org Configured"
Screen      0  "ScreenIntel" 0 0
EndSection
Section "Screen"
Identifier "ScreenIntel"
Device     "Intel"
Monitor    "HDMI-3"
EndSection


However, I keep getting this error:
Code:

[     8.263] (==) Log file: "/var/log/Xorg.0.log", Time: Mon Oct 19 22:46:32 2020
[     8.263] (==) Using config directory: "/etc/X11/xorg.conf.d"
[     8.263] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[     8.264] (==) ServerLayout "X.org Configured"
[     8.264] (**) |-->Screen "Screen" (0)
[     8.264] (**) |   |-->Monitor "<default monitor>"
[     8.264] (**) |   |-->Device "Intel"
[     8.264] (**) |   |-->GPUDevice "AMD"
[     8.264] (==) No monitor specified for screen "Screen".
Using a default monitor configuration.
[     8.264] (==) Automatically adding devices
[     8.264] (==) Automatically enabling devices
[     8.264] (==) Automatically adding GPU devices
[     8.264] (==) Max clients allowed: 256, resource mask: 0x1fffff
[     8.264] (WW) The directory "/usr/share/fonts/TTF/" does not exist.
[     8.264]    Entry deleted from font path.
[     8.264] (WW) The directory "/usr/share/fonts/OTF/" does not exist.
[     8.264]    Entry deleted from font path.
[     8.264] (WW) The directory "/usr/share/fonts/Type1/" does not exist.
[     8.264]    Entry deleted from font path.
[     8.264] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/".
[     8.264]    Entry deleted from font path.
[     8.264]    (Run 'mkfontdir' on "/usr/share/fonts/75dpi/").
[     8.264] (==) FontPath set to:
/usr/share/fonts/misc/,
/usr/share/fonts/100dpi/
[     8.264] (==) ModulePath set to "/usr/lib64/xorg/modules"
[     8.264] (II) The server relies on udev to provide the list of input devices.
If no devices become available, reconfigure udev or disable AutoAddDevices.
[     8.264] (II) Loader magic: 0x55af4ddf3d00
[     8.264] (II) Module ABI versions:
[     8.264]    X.Org ANSI C Emulation: 0.4
[     8.264]    X.Org Video Driver: 24.1
[     8.264]    X.Org XInput driver : 24.1
[     8.264]    X.Org Server Extension : 10.0
[     8.265] (++) using VT number 7

[     8.265] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[     8.265] (II) xfree86: Adding drm device (/dev/dri/card0)
[     8.265] (EE) /dev/dri/card0: failed to set DRM interface version 1.4: Permission denied
[     8.265] (II) xfree86: Adding drm device (/dev/dri/card1)
[     8.265] (EE) /dev/dri/card1: failed to set DRM interface version 1.4: Permission denied
[     8.266] (--) PCI:*(0@0:2:0) 8086:3e92:1462:7b48 rev 0, Mem @ 0xde000000/16777216, 0xb0000000/268435456, I/O @ 0x0000f000/64, BIOS @ 0x????????/131072
[     8.266] (--) PCI: (1@0:0:0) 1002:67df:1682:9587 rev 225, Mem @ 0xc0000000/268435456, 0xd0000000/2097152, 0xdf300000/262144, I/O @ 0x0000e000/256, BIOS @ 0x????????/131072
[     8.266] (II) LoadModule: "glx"
[     8.267] (II) Loading /usr/lib64/xorg/modules/extensions/libglx.so
[     8.268] (II) Module glx: vendor="X.Org Foundation"
[     8.268]    compiled for 1.20.8, module version = 1.0.0
[     8.268]    ABI class: X.Org Server Extension, version 10.0
[     8.268] (II) LoadModule: "modesetting"
[     8.269] (II) Loading /usr/lib64/xorg/modules/drivers/modesetting_drv.so
[     8.269] (II) Module modesetting: vendor="X.Org Foundation"
[     8.269]    compiled for 1.20.8, module version = 1.20.8
[     8.269]    Module class: X.Org Video Driver
[     8.269]    ABI class: X.Org Video Driver, version 24.1
[     8.269] (II) LoadModule: "amdgpu"
[     8.269] (II) Loading /usr/lib64/xorg/modules/drivers/amdgpu_drv.so
[     8.271] (II) Module amdgpu: vendor="X.Org Foundation"
[     8.271]    compiled for 1.20.8, module version = 19.1.0
[     8.271]    Module class: X.Org Video Driver
[     8.271]    ABI class: X.Org Video Driver, version 24.1
[     8.271] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[     8.271] (II) AMDGPU: Driver for AMD Radeon:
All GPUs supported by the amdgpu kernel driver
[     8.301] (WW) Falling back to old probe method for modesetting
[     8.686] (II) modeset(1): using default device
[     8.686] (II) AMDGPU(2): [KMS] Kernel modesetting enabled.
[     8.687] (EE) Screen 0 deleted because of no matching config section.
[     8.687] (II) UnloadModule: "modesetting"
[     8.687] (EE) Screen 1 deleted because of no matching config section.
[     8.687] (II) UnloadModule: "amdgpu"
[     8.687] (EE)
Fatal server error:
[     8.687] (EE) Cannot run in framebuffer mode. Please specify busIDs        for all framebuffer devices
[     8.687] (EE)
[     8.687] (EE)


I tried disabling some of the files, but I cannot get it to work.

Could someone who is more knowledgable on xorg.conf files help me with this please?


.
_________________
OS: Gentoo 6.7.3-gentoo-dist, ~amd64, 17.1/desktop/plasma/systemd/merged-usr
MB: MSI Z370-A PRO
CPU: Intel Core i9-9900KS
GPU: Intel Arc A770 16GB & Intel UHD Graphics 630
SSD: Samsung 970 EVO Plus 2 TB
RAM: Crucial Ballistix 32GB DDR4-2400
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum