Bug 466487 - After connecting external screen through DisplayPort passthrough, primary screen goes black and any windows that are dragged to it flicker
Summary: After connecting external screen through DisplayPort passthrough, primary scr...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (other bugs)
Version First Reported In: 5.27.1
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: multiscreen
Depends on:
Blocks:
 
Reported: 2023-02-26 19:54 UTC by Anil
Modified: 2024-10-20 07:20 UTC (History)
4 users (show)

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


Attachments
kscreen-console (4.78 KB, text/plain)
2023-02-26 19:54 UTC, Anil
Details
screen recording of display flickering (2.57 MB, video/x-matroska)
2023-02-26 19:55 UTC, Anil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anil 2023-02-26 19:54:23 UTC
Created attachment 156763 [details]
kscreen-console

SUMMARY
At some point after connecting an external monitor via usb-c DP passthrough, the primary monitor (on the laptop) becomes completely black. When manually dragging a window over to the monitor, it displays, but then flickers endlessly (like when you win at solitare)

STEPS TO REPRODUCE
1. Log in with only one monitor (primary = laptop monitor)
2. Attach an external monitor via USB-C DP passthrough
3. ?? Still investigating to try to understand exactly when the bug triggers. I'm pretty sure it's not immediately on device attach
4. 

OBSERVED RESULT
* See the attached video for the screen flickering
* Restarting plasmashell does NOT fix the behavior

kscreen-doctor output:
>  Output: 1 eDP-1 enabled connected priority 1 Panel Modes: 0:2256x1504@60*! 1:2256x1504@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: 0,549 2256x1504 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: Automatic
>  Output: 2 DP-1 enabled connected priority 2 DisplayPort Modes: 0:3840x2160@60*! 1:3840x2160@30 2:1920x2160@60 3:2560x1440@60 4:1920x1200@60 5:2048x1080@24 6:1920x1080@60 7:1920x1080@60 8:1920x1080@60 9:1920x1080@60 10:1920x1080@60 11:1920x1080@50 12:1920x1080@50 13:1920x1080@24 14:1920x1080@24 15:1600x1200@60 16:1600x900@60 17:1280x1024@75 18:1280x1024@60 19:1152x864@75 20:1280x720@60 21:1280x720@60 22:1280x720@50 23:1024x768@75 24:1024x768@60 25:800x600@75 26:800x600@60 27:720x576@50 28:720x576@50 29:720x480@60 30:720x480@60 31:720x480@60 32:720x480@60 33:640x480@75 34:640x480@60 35:640x480@60 36:640x480@60 37:720x400@70 38:1600x1200@60 39:1280x1024@60 40:1024x768@60 41:2560x1600@60 42:1280x800@60 43:3200x1800@60 44:2880x1620@60 45:2560x1440@60 46:1920x1080@60 47:1600x900@60 48:1368x768@60 49:1280x720@60 Geometry: 2256,0 3840x2160 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: Automatic

kscreen-console hangs when running, not sure if that's expected, but I've attached the output to the bug report.



EXPECTED RESULT


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.27.1
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
Comment 1 Anil 2023-02-26 19:55:08 UTC
Created attachment 156764 [details]
screen recording of display flickering
Comment 2 Anil 2023-02-26 20:03:44 UTC
Some more debugging notes:
Pressing ctrl-alt-shift-f1 goes back to SDDM, which does display on the primary monitor. However, it doesn't appear responsive to mouse clicks or anything

* Opening a new virtual tty (e.g. ctrl-alt-shift-f2) is functional on the primary monitor

* Unplugging the monitor doesn't help, it stays in a black screen

* Plugging the monitor back in only makes it worse, now both monitors have the screen flickering behavior.

* It does not repro immediately after plugging in the monitor, but only sometime afterwards. Will try to figure out what causes the bug to trigger
Comment 3 Anil 2023-02-27 15:45:49 UTC
Also take a look at https://bugs.kde.org/show_bug.cgi?id=466489 as it appears that KWin was crashing around the time I took the screen recording.

I noticed KWin::PointerInputRedirection::updateAfterScreenChange is in that callstack, maybe it's related?
Comment 4 Aleix Pol 2023-02-27 18:48:59 UTC
This just means that your plasmashell crashed. Getting a backtrace there could be useful.

Does this mean that the other screen shows it properly?
Comment 5 Anil 2023-02-27 18:52:20 UTC
(In reply to Aleix Pol from comment #4)
> This just means that your plasmashell crashed. Getting a backtrace there
> could be useful.
> 
> Does this mean that the other screen shows it properly?

I don't have any record of it in my coredumpctl (and also restarting plasmashell didn't fix the issue).

And yes, if I drag the window to the external monitor, it displays without issue
Comment 6 Nate Graham 2023-03-01 17:29:03 UTC
Are you on Wayland or X11? Does it happen on both, or just one?
Comment 7 Zamundaaa 2024-10-15 13:59:21 UTC
Is this still happening for you on Plasma 6?
Comment 8 Anil 2024-10-20 07:20:07 UTC
No repro on KDE 6