Bug 466705 - X11, AMD+Nvidia: The external screen connected via usb type c port (display port 1.4 alt mode protocol) is black after sleep-wakeup cycle
Summary: X11, AMD+Nvidia: The external screen connected via usb type c port (display p...
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (show other bugs)
Version: 5.27.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL: https://download.nvidia.com/XFree86/L...
Keywords: multiscreen
Depends on:
Blocks:
 
Reported: 2023-03-02 10:43 UTC by Dmitrii Chermnykh
Modified: 2023-11-29 16:16 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitrii Chermnykh 2023-03-02 10:43:49 UTC
I have similar problem with hybrid amd+nvidia setup, but only after wake from sleep (reboot works fine)

STEPS TO REPRODUCE
1. Use amd+nvidia hybrid setup (using ryzen 5800 + nvidia 3050 ti)
X11 displays 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 "integrated"
        Inactive "nvidia"
        Option "AllowNVIDIAGPUScreens"
EndSection

Section "Device"
        Identifier "integrated"
        Driver "modesetting"
        BusID "PCI:6:0:0"
        Option "TearFree" "true"
        Option "DRI" "3"
        Option "VariableRefresh" "on"
        Option "AsyncFlipSecondaries" "on"
EndSection

Section "Screen"
        Identifier "integrated"
        Device "integrated"
        Option "AllowExternalGpus"
EndSection

Section "Device"
        Identifier "nvidia"
        Driver "nvidia"
        BusID "PCI:1:0:0"
        Option "RegistryDwords" "EnableBrightnessControl=1"
        Option "AsyncFlipSecondaries" "on"
EndSection

Section "Screen"
        Identifier "nvidia"
        Device "nvidia"
EndSection
```

2. Connect external screen via type c cable with display port alt mode protocol 
3. Put laptop into sleep mode
4. Wake the laptop up from sleep
5. Only internal screen is available, the external one sees no signal
6. Switch to tty2 and back (ctrl+alt+f2 -> ctrl+alt+f1)
7. Kernel refreshed the available screens and the external screen is available once again

OBSERVED RESULT
External display loses signal after sleep-wakeup cycle

EXPECTED RESULT
External display reconnects automatically 

POSSIBLE WORKAROUNDS:
Ask kernel/x11 to rescan displays when quirky hardware is detected

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
archlinux packages
KDE Plasma Version: First noticed on 5.26.5, still reproduces on 5.27.2 
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
NVIDIA drivers: 525.89.02
Linux kernel: 6.2.1-zen1-1-zen


OTHER INFO:
See also https://bugs.kde.org/show_bug.cgi?id=460341#c118
After fixing the mentioned issue the problem still occurs for me

This problem only appears when using type-c <-> dp cable. Does not reproduce with HDMI cable 
Both ports are internally connected to the NVIDIA GPU. The internal screen is connected to the integrated GPU
Comment 1 Nate Graham 2023-03-02 19:51:25 UTC
> 6. Switch to tty2 and back (ctrl+alt+f2 -> ctrl+alt+f1)
> 7. Kernel refreshed the available screens and the external screen is available once again

This is quite interesting. It's like the opposite of Bug 466187.
Comment 2 Dmitrii Chermnykh 2023-10-05 11:20:14 UTC
Also reproduces win NVIDIA Only (with amd iGPU turned off in bios) on X11

Does not reproduce on Wayland
Comment 3 Dmitrii Chermnykh 2023-11-29 13:40:49 UTC
It's NVIDIA's bug https://download.nvidia.com/XFree86/Linux-x86_64/545.29.06/README/dynamicpowermanagement.html (Known Issues And Workarounds, p.4)
Comment 4 Nate Graham 2023-11-29 16:16:06 UTC
Thanks for following up!