Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Advanced screen management under plasma [SOLVED]
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
KShots
Guru
Guru


Joined: 09 Oct 2003
Posts: 591
Location: Florida

PostPosted: Thu May 19, 2016 2:48 pm    Post subject: Advanced screen management under plasma [SOLVED] Reply with quote

I have an interesting configuration... I have a laptop with a built-in 4k screen when I'm mobile... and when I'm docked, I have four 1080p screens (plus the built-in 4k screen).

This presents an interesting set of problems, including different graphics card (the docking station includes a desktop graphics card at a different PCI bus id) which triggers a different X11 config when docked, differing DPI settings, and other headaches.

I've been able to get X11 to automatically use the appropriate configuration through some systemd magic with the following unit files:

optiswitch-bi.service
Code:
[Unit]
Description=Built-in GTX 980 setup
Before=display-manager.service
ConditionPathExists=/sys/bus/pci/devices/0000:01:00.0

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/bin/ln -sf /usr/local/share/optimus/bi.sddm.conf /usr/share/sddm/scripts/Xsetup
ExecStartPre=/bin/ln -sf /usr/local/share/optimus/bi.home.conf /home/rich/.xinitrc
ExecStartPre=/bin/ln -sf /usr/local/share/optimus/bi.home.conf /home/kshots/.xinitrc
ExecStart=/bin/ln -sf /usr/local/share/optimus/bi.conf /etc/X11/xorg.conf.d/30-device-nvidia.conf

[Install]
WantedBy=multi-user.target
optiswitch-ga.service
Code:
[Unit]
Description=Alienware Graphics Amplifier setup
Before=display-manager.service
ConditionPathExists=/sys/bus/pci/devices/0000:02:00.0

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/bin/ln -sf /usr/local/share/optimus/ga.sddm.conf /usr/share/sddm/scripts/Xsetup
ExecStartPre=/bin/ln -sf /usr/local/share/optimus/ga.home.conf /home/rich/.xinitrc
ExecStartPre=/bin/ln -sf /usr/local/share/optimus/ga.home.conf /home/kshots/.xinitrc
ExecStart=/bin/ln -sf /usr/local/share/optimus/ga.conf /etc/X11/xorg.conf.d/30-device-nvidia.conf

[Install]
WantedBy=multi-user.target
Essentially, systemd detects if the docking station device exists, and if it does it links the appropriate configs in before starting X11. The docking station removes the built-in graphics card (it disappears from lspci and the sys tree), so it's mutually exclusive. This part seems to work well... the quad-monitor setup places the monitors in the correct locations when docked, and when not docked, nvidia optimus is engaged via the appropriate xrandr commands in sddm and user xinit scripts. I'm happy with this much of it. However, when I dock, the DPI is set so that everything is HUGE (254 DPI), and if I fix it to 92 DPI as is appropriate for a 1080p screen of the size I'm using, when I undock everything is horrendously tiny on the 4k screen (which requires 254 DPI).

I've been able to set my DPI manually every time via KDE, but I would much rather do this automatically like I do with the above systemd unit files.

Anybody know how plasma stores its DPI settings? Is it a flat file? A database entry?

In case anyone's curious, here's the two X11 configs as well:

bi.conf
Code:
Section "Module"
        Load "modesetting"
EndSection

Section "Device"
        Identifier "mydevice"
        Driver "nvidia"
        BusID "PCI:1:0:0"
        Option  "ConnectedMonitor" "CRT-0"
        Option  "CustomEDID" "CRT-0:/sys/class/drm/card0-eDP-1/edid"
        Option  "UseEDID" "true"
        Option  "AllowEmptyInitialConfiguration"
EndSection
ga.conf
Code:
Section "Module"
        Load "modesetting"
EndSection

Section "Device"
        Identifier "mydevice"
        Driver "nvidia"
        BusID "PCI:2:0:0"
        Option "nvidiaXineramaInfoOrder" "DFP-0"
        Option "metamodes" "DVI-I-1: 1920x1080_144 +1920+0, HDMI-0: nvidia-auto-select +3840+0, DP-4: 1920x1080_144 +0+0"
EndSection


Note that I'm taking the EDID from the intel module when using the built-in card, as optimus prevents the nvidia driver from seeing EDID information... but when I'm using the docking station, optimus is not standing in the way, so I don't do anything special for EDID.
_________________
Life without passion is death in disguise


Last edited by KShots on Tue May 24, 2016 5:43 pm; edited 1 time in total
Back to top
View user's profile Send private message
KShots
Guru
Guru


Joined: 09 Oct 2003
Posts: 591
Location: Florida

PostPosted: Tue May 24, 2016 5:42 pm    Post subject: Reply with quote

Found the culprit - I had forgotten that I had also updated /etc/sddm.conf to a DPI of 144. This had the effect of ignoring my ~/.xinitrc xrandr statement regarding DPI and overriding it with 144 every time, no matter which configuration I was in. I have since updated my system unit file to symlink in an appropriate /etc/sddm.conf for each hardware configuration, and now plasma has the correct DPI every time I log in. It was driving me nuts that apparently my ~/.xinitrc was being ignored... I don't think it was, I think it was being applied first, then sddm came in and stomped on it with its own DPI settings. If it was being ignored, I would get a blank screen on login when in standalone mode (optimus doesn't work without xrandr in the ~/.xinitrc).
_________________
Life without passion is death in disguise
Back to top
View user's profile Send private message
otakugeek
n00b
n00b


Joined: 26 Jun 2014
Posts: 50

PostPosted: Wed Jul 20, 2016 7:46 pm    Post subject: Reply with quote

Do you have a Alienware machine ?


if yes please could share some screens and systems information ?

I want buy a Alienware 17 R3 the last of year and I'm afraid about the drivers and all resources, as the 4k screen, wifi network or nvme.

I'm a ROG 750JX and I have alot of work to make all devices work.
Back to top
View user's profile Send private message
KShots
Guru
Guru


Joined: 09 Oct 2003
Posts: 591
Location: Florida

PostPosted: Wed Jul 20, 2016 10:27 pm    Post subject: Reply with quote

otakugeek wrote:
Do you have a Alienware machine ?


if yes please could share some screens and systems information ?

I want buy a Alienware 17 R3 the last of year and I'm afraid about the drivers and all resources, as the 4k screen, wifi network or nvme.

I'm a ROG 750JX and I have alot of work to make all devices work.
Yeah, I'm using an Alienware 17r3. Not sure what you mean by "posting some screens", but I can post some stuff on getting everything working except the audio jacks (which are not likely to ever work). I've also got a mostly-working solution on using the Graphics Amplifier, so I can dock with 4 monitors and travel with just the 4k display. The only part that's not working right is that Plasma seems to shuffle my monitor positions around randomly when I undock and re-dock, ignoring my X11 config stating where each one should reside, and making me go through their configuration interface every time.

I have an old thread describing my experience with a lot of the old issues. I don't think I mentioned the audio jack issue, but I honestly didn't notice it until several months in when I wanted to have some audio in an airport and it ignored my headphones. Solution: Buy a USB audio dongle.
_________________
Life without passion is death in disguise
Back to top
View user's profile Send private message
otakugeek
n00b
n00b


Joined: 26 Jun 2014
Posts: 50

PostPosted: Thu Jul 28, 2016 3:19 pm    Post subject: Reply with quote

Please post some screenshots or a teaser on youtube, Linux on gamer laptop is very rare is amazing someone that use a high top laptop with genuine Linux.
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