Bug 470590 - After logging in or unlocking the screen, external DP monitor connected to Thunderbolt Dock isn't automatically activated by KWin, but KScreen and Plasma act like it's there
Summary: After logging in or unlocking the screen, external DP monitor connected to Th...
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (show other bugs)
Version: 5.27.5
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-03 14:58 UTC by Firlaev-Hans
Modified: 2023-07-23 15:20 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
drm_info in normal state (214.73 KB, text/plain)
2023-07-16 17:49 UTC, Firlaev-Hans
Details
drm_info in broken state (213.61 KB, text/plain)
2023-07-16 17:49 UTC, Firlaev-Hans
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Firlaev-Hans 2023-06-03 14:58:50 UTC
SUMMARY
I have a laptop with a thunderbolt dock with an external monitor, and I typically use both the internal and the external display at the same time.
Sometimes when I log in, the external monitor is behaving normally in SDDM but once I'm in the Plasma Wayland session, it goes to sleep. However, as far as Plasma is concerned the screen is active, my panel and windows stay on that screen. I have to unplug and re-plug the thunderbolt dock to make it work again.
The same thing occasionally happens when I wake the system from sleep and unlock the screen, only the internal display wakes up while the external one stays on stand-by.
The following lines appear in the journal when this happens:
>kwin_wayland_wrapper[16159]: warning: queue 0x56161e88c840 destroyed while proxies still attached:
>kwin_wayland_wrapper[16159]:   wl_display@1 still attached

STEPS TO REPRODUCE
1. (Not sure how to reproduce reliably, unfortunately)
2. Boot up your laptop to SDDM while an external display is attached (not sure if thunderbolt is important)
3. Log in to Plasma Wayland, which should be configured to use both the internal and external display

OBSERVED RESULT
The external screen may stay black / go to sleep, but Plasma will still treat it as an active screen.

EXPECTED RESULT
The external screen should just... work.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 38
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.106.0
Qt Version: 5.15.9
Kernel Version: 6.2.15-300.fc38.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 20 × 12th Gen Intel® Core™ i7-12700H
Memory: 15.3 GiB of RAM
Graphics Processor: Mesa Intel® Graphics
Manufacturer: Dell Inc.
Product Name: Inspiron 14 Plus 7420
Comment 1 Nate Graham 2023-06-05 19:00:44 UTC
A couple of questions:

1. Is the affected screen plugged into the dock via an HDMI cable or DisplayPort, or something else?

2. When this happens and the external screen is in this state, can you paste the output of `kscreen-doctor -o` in a terminal window, Then, when you fix it by unplugging and re-plugging the screen, can you paste the output of that command a second time?
Comment 2 Firlaev-Hans 2023-06-07 07:23:31 UTC
(In reply to Nate Graham from comment #1)
> A couple of questions:
> 
> 1. Is the affected screen plugged into the dock via an HDMI cable or
> DisplayPort, or something else?
> 
> 2. When this happens and the external screen is in this state, can you paste
> the output of `kscreen-doctor -o` in a terminal window, Then, when you fix
> it by unplugging and re-plugging the screen, can you paste the output of
> that command a second time?

1. The screen is plugged into the thunderbolt dock via (Mini) Display Port

2.) Output of kscreen-doctor -o while in bad state:

Output: 1 eDP-1 enabled connected priority 2 Panel Modes: 0:2240x1400@60*! 1:2240x1400@48 2:1600x1200@60 3:1280x1024@60 4:1024x768@60 5:1920x1200@60 6:1280x800@60 7:1920x1080@60 8:1600x900@60 9:1368x768@60 10:1280x720@60 Geometry: 122,1440 2240x1400 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: Automatic
Output: 2 DP-4 enabled connected priority 1 DisplayPort Modes: 0:2560x1440@60*! 1:1920x1440@60 2:2560x1080@60 3:2560x1080@60 4:2560x1080@50 5:1920x1080@60 6:1920x1080@60 7:1920x1080@60 8:1920x1080@50 9:1600x1200@60 10:1680x1050@60 11:1600x900@60 12:1280x1024@75 13:1280x1024@60 14:1280x800@60 15:1152x864@75 16:1280x720@60 17:1280x720@60 18:1280x720@60 19:1280x720@50 20:1024x768@75 21:1024x768@70 22:1024x768@60 23:832x624@75 24:800x600@75 25:800x600@72 26:800x600@60 27:800x600@56 28:720x576@50 29:720x480@60 30:720x480@60 31:720x480@60 32:720x480@60 33:720x480@60 34:640x480@75 35:640x480@73 36:640x480@67 37:640x480@60 38:640x480@60 39:640x480@60 40:720x400@70 Geometry: 0,0 2560x1440 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: Automatic


Output after reconnecting the monitor, returning to normal state:

Output: 1 eDP-1 enabled connected priority 2 Panel Modes: 0:2240x1400@60*! 1:2240x1400@48 2:1600x1200@60 3:1280x1024@60 4:1024x768@60 5:1920x1200@60 6:1280x800@60 7:1920x1080@60 8:1600x900@60 9:1368x768@60 10:1280x720@60 Geometry: 122,1440 2240x1400 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: Automatic
Output: 2 DP-5 enabled connected priority 1 DisplayPort Modes: 0:2560x1440@60*! 1:1920x1440@60 2:2560x1080@60 3:2560x1080@60 4:2560x1080@50 5:1920x1080@60 6:1920x1080@60 7:1920x1080@60 8:1920x1080@50 9:1600x1200@60 10:1680x1050@60 11:1600x900@60 12:1280x1024@75 13:1280x1024@60 14:1280x800@60 15:1152x864@75 16:1280x720@60 17:1280x720@60 18:1280x720@60 19:1280x720@50 20:1024x768@75 21:1024x768@70 22:1024x768@60 23:832x624@75 24:800x600@75 25:800x600@72 26:800x600@60 27:800x600@56 28:720x576@50 29:720x480@60 30:720x480@60 31:720x480@60 32:720x480@60 33:720x480@60 34:640x480@75 35:640x480@73 36:640x480@67 37:640x480@60 38:640x480@60 39:640x480@60 40:720x400@70 Geometry: 0,0 2560x1440 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: Automatic

So for some reason the display gets a different number (DP4 vs DP5) when this error happens.

I also noticed that most of the time then running kscreen-doctor, it aborts abnormally. I don't know if this is related at all. Unfortunately I couldn't generate a good backtrace for some reason, the kscreen debuginfo package it complains about *is* installed:

malloc_consolidate(): unaligned fastbin chunk detected
Thread 1 "kscreen-doctor" received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
Downloading source file /usr/src/debug/glibc-2.37-4.fc38.x86_64/nptl/pthread_kill.c
44            return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;                                                                                                                                                                                            
Missing separate debuginfos, use: dnf debuginfo-install libkscreen-qt5-5.27.5-1.fc38.x86_64
Comment 3 Nate Graham 2023-06-07 18:11:30 UTC
Thanks. Unfortunately those Thunderbolt docks often change the display connector names or numbers around, and maybe this is confusing KWin. It seems like KScreen has managed to avoid getting confused though.

The kscreen-doctor issue might be Bug 469160.
Comment 4 Zamundaaa 2023-06-07 19:10:24 UTC
Please attach the output of drm_info when the output isn't working correctly
Comment 5 Firlaev-Hans 2023-07-16 17:49:26 UTC
Created attachment 160317 [details]
drm_info in normal state
Comment 6 Firlaev-Hans 2023-07-16 17:49:48 UTC
Created attachment 160318 [details]
drm_info in broken state
Comment 7 Firlaev-Hans 2023-07-16 17:52:59 UTC
(In reply to Zamundaaa from comment #4)
> Please attach the output of drm_info when the output isn't working correctly

Sorry about the long delay, I had to send my only thunderbolt capable laptop in for repair and was without it for a few weeks.

I experienced this issue again today and ran drm_info both in the broken state and in the good state after re-plugging the dock.
At first glance, other than different connector numbers once again, I can't tell any significant difference.
Comment 8 Zamundaaa 2023-07-17 11:09:32 UTC
I can't see any real differences either, it's just different IDs. As far as KWin is concerned, the output is showing stuff... So this is likely a kernel issue.
We can check at least one thing to maybe narrow it down though. Can you put
KWIN_DRM_PREFER_COLOR_DEPTH=24
into /etc/environment, reboot and see if that makes a difference?
Comment 9 Firlaev-Hans 2023-07-23 09:29:32 UTC
(In reply to Zamundaaa from comment #8)
> I can't see any real differences either, it's just different IDs. As far as
> KWin is concerned, the output is showing stuff... So this is likely a kernel
> issue.
> We can check at least one thing to maybe narrow it down though. Can you put
> KWIN_DRM_PREFER_COLOR_DEPTH=24
> into /etc/environment, reboot and see if that makes a difference?

Just experienced the issue again despite that variable in /etc/environment, so I guess we can rule that out...
Comment 10 Zamundaaa 2023-07-23 15:05:58 UTC
Okay, then please open a bug report about this at https://gitlab.freedesktop.org/drm/intel/-/issues
Comment 11 Firlaev-Hans 2023-07-23 15:20:03 UTC
For the record:
https://gitlab.freedesktop.org/drm/intel/-/issues/8402