winft / disman

Qt/C++ display management library
GNU Lesser General Public License v2.1
2 stars 1 forks source link

Disabled display stays disabled even if it's the only display in system #37

Open romangg opened 3 years ago

romangg commented 3 years ago

In GitLab by @chermnyx on Nov 2, 2020, 12:23

Precondition: System with two or more displays; one of them is disabled in settings.

If all the displays but the disabled one were disconnected, the disabled display stays disabled (unlike stock kscreen behavior which enables the display back and disables when any other display gets connected)

romangg commented 3 years ago

Thanks for the report. Some more info please. Hardware? X11? Desktop environment?

romangg commented 3 years ago

In GitLab by @chermnyx on Nov 2, 2020, 15:22

I'm using KDE 5.20.2 with disman 0.520.0 on X11. Looks like the problem only appears after relogin/reboot. Both screens (internal laptop screen and external one) are connected to the intel gpu; but I use PRIME offloading form nvidia (with proprietary drivers). My xorg configuration:

Section "Files"
        ModulePath "/usr/lib/nvidia"
        ModulePath "/usr/lib32/nvidia"
        ModulePath "/usr/lib32/nvidia/xorg/modules"
        ModulePath "/usr/lib32/xorg/modules"
        ModulePath "/usr/lib64/nvidia/xorg/modules"
        ModulePath "/usr/lib64/nvidia/xorg"
        ModulePath "/usr/lib64/xorg/modules"
EndSection

Section "ServerLayout"
        Identifier "layout"
        Screen 0 "nvidia"
        Inactive "intel"
EndSection

Section "Device"
        Identifier "nvidia"
        Driver "nvidia"
        BusID "PCI:1:0:0"
        Option "TripleBuffer" "true"
EndSection

Section "Screen"
        Identifier "nvidia"
        Device "nvidia"
        Option "AllowEmptyInitialConfiguration"
        Option "AllowExternalGpus"
EndSection

Section "Device"
        Identifier "intel"
        Driver "modesetting"
        BusID "PCI:0:2:0"
EndSection

Section "Screen"
        Identifier "intel"
        Device "intel"
EndSection

Section "ServerFlags"
        Option "IgnoreABI" "1"
EndSection

The problem does not appear with kscreen.

romangg commented 3 years ago

In GitLab by @Kodehawa on Dec 4, 2020, 19:40

Reading the code this doesn't make sense to me. We shouldn't be saving any sort of "disabled" attribute to the global controls, and the display settings are saved in a per-arrangement basis (aka, a single display is a different config -- unless you somehow managed to disable it on the single-display config)

Mind sending the files on ~/.local/share/disman? They don't contain any confidential info, unless you believe your display config is such :)

Thanks.

romangg commented 3 years ago

In GitLab by @chermnyx on Dec 4, 2020, 22:26

disman.tar.zst

romangg commented 3 years ago

In GitLab by @chermnyx on Dec 4, 2020, 22:30

Looks like it is disabled for single screen layout. Could this occur if disman was started with laptop screen disabled (via another screen manager or xrandr)?

romangg commented 3 years ago

Could this occur if disman was started with laptop screen disabled (via another screen manager or xrandr)?

Disman actually tries to always load the config it has on an hotplug event (or generate a new one if such does not exist) so it is more likely it sets the wrong value itself.

From your configs it looks like the laptop screen was disabled in the two-screen config and then also became disabled in the one-screen config.

I could imagine two reasons for that:

romangg commented 3 years ago

In GitLab by @Kodehawa on Dec 4, 2020, 23:08

As a workaround, you can set disabled to false on the single display config :)

Something is definitely going wrong here, it's probably what Roman pointed out. Or that you started disman with the screen already disabled (but unlikely, as Roman said), and there was no other display on your system (probably, not sure here)