Bug 399590

Summary: After resuming from suspend kwin_wayland doesn't detect an external monitor connected via USB C
Product: [Plasma] kwin Reporter: Diane Trout <diane>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: kde
Priority: NOR    
Version: 5.13.5   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: log of udevadm monitor after resuming connected to a different USB C dock
log of plugging in external dock after rebooting

Description Diane Trout 2018-10-10 04:12:40 UTC
SUMMARY
I have a Dell XPS 13 9360. When I resume the laptop after plugging in the USB-C docking station it regularly fails to detect the external HDMI monitor.

Only one monitor shows up in the Display System Settings Module, and only one display shows up in xrandr.


EXPECTED RESULT
Both displays should be configurable.

SOFTWARE VERSIONS
KDE Plasma Version: 5.13.5 
KDE Frameworks Version: 5.49.0
Qt Version: 5.11.1

ADDITIONAL INFORMATION
Kernel Version 4.18.0-1-amd64
4xIntel Core i7-7500U @ 2.7 GhZ
Comment 1 Diane Trout 2018-10-10 04:19:50 UTC
Logging out leaves an error message, I have to reboot for it to detect the external monitor
Comment 2 David Edmundson 2018-10-10 16:29:15 UTC
It's been a long time since I've seen that name! Hope all is well.

Can you clarify the state is as follows?
 - you boot with the USB dock - it works
 - you dynamically plug the USB dock - it works
 - you suspend/resume - the dock has gone

And it works on X?
Comment 3 Diane Trout 2018-10-10 17:16:06 UTC
Thank you. Everything is well here. (I'm just attempting Plasma again using GNOME for a while)

I can report kwin-wayland does two things better than gnome. It correctly scales Xwayland apps regardless of the dpi of the display the window is on, and it correctly scales a part of the window if its hanging onto a display with a different dpi)

So. I'll need a bit of testing to duplicate your questions but maybe these additional details will help.

At work I have one of these:
https://www.dell.com/en-us/shop/dell-adapter-usb-c-to-hdmi-vga-ethernet-usb-30-da200/apd/470-abqn/pc-accessories
With a Dell 2007FP plugged in via VGA.

I then suspend the laptop, take it home and plug it into one of these:
https://www.dell.com/support/article/us/en/19/sln304627/dell-dock-wd15-usb-type-c-information-compatibility-and-specifications?lang=en
There is a Dell 27" monitor plugged in via display port on the dock. (Sorry don't have model number since I'm not at home)

I wake the laptop and under plasma wayland only the laptop display is active. (Also under in this condition the scale for the laptop screen under plasma resets to 1x, I have to manually reset it to 2x.)

I'm not sure its 100% reliable, but it has certainly happened multiple times. For a bit I was avoiding the bug shutting down the laptop instead of sleeping it , but that was because I had been getting powerdevil segfaults and had uninstalled powerdevil.

Under gnome wayland after resuming from the same conditions sleeping at work, disconnecting the microdock, going home plugging in the WD15 dock, and resuming) both displays would work. (It "worked" with GNOME X too, but xrandr wasn't reliable at resetting both displays to the right scaling.)

I haven't tried resuming first and then plugging in the dock after getting home.
I also haven't tried suspending and then resuming without unplugging from the WD15 dock after it had been correctly detected on boot.

I'll try those tonight.
Comment 4 Diane Trout 2018-10-10 20:05:30 UTC
One more observation.

When I disconnected the microdock while the laptop was on. The laptop screen scale immediately went from x2 to x1.

(Desktop is currently running Debian testing)
Comment 5 Diane Trout 2018-10-10 20:25:48 UTC
Is kwin wayland listening for the resume signal from powerdevil?

Maybe me removing it is the cause for not scanning the hardware?

I saw the signal:
org.kde.Solid.PowerManagement.Actions.SuspendSession.resumingFromSuspend
Comment 6 Diane Trout 2018-10-11 03:35:00 UTC
Went home opened laptop from suspend, then laptop screen appeared with 1x scale. 

Plugged in dock and it didnt detect it.
Comment 7 David Edmundson 2018-10-22 23:05:13 UTC
From kwin's POV we monitor udev for events from the "drm" subsystem

Can you plug it in and using udevadm/udev-browse find some details for your DRM device.
Comment 8 Diane Trout 2018-10-23 03:15:08 UTC
Created attachment 115839 [details]
log of udevadm monitor after resuming connected to a different USB C dock
Comment 9 Diane Trout 2018-10-23 03:15:39 UTC
I haven't used those before, udev-browse isn't available for debian, so I went with udevadm monitor. Hope that's useful.

I started udevadm monitor | tee udev.monitor.log in a tmux session so even if plasma locked up I should still get some log messages.

I started it while plugged into the smaller USB C dongle connected to 1600x1200 monitor over VGA, and then I suspend the computer. I took it home and plugged it into a USB C dock and opened the computer.

I looked at twitter and watched a bit of a video, and then killed udevadm monitor. There was only one display listed in Displays and the scale for the laptop display had defaulted to 1x instead of 2x.

See log of udevadm monitor after resuming...
Comment 10 Diane Trout 2018-10-23 03:35:54 UTC
Created attachment 115840 [details]
log of plugging in external dock after rebooting

It didn't detect the monitor connected to the external dock either.

Any suggestions for udevadm info commands you'd like?
Comment 11 David Edmundson 2020-05-08 15:47:55 UTC
There has since been a change which probably fixes this.
Could you reopen if this persists with 5.19 or newer