Bug 485805 - Wayland session black screen no cursor, X11 black screen with cursor until reboot after plugging into external monitor
Summary: Wayland session black screen no cursor, X11 black screen with cursor until r...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-19 17:38 UTC by nathanp
Modified: 2024-05-02 18:47 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nathanp 2024-04-19 17:38:50 UTC
SUMMARY
related discussion post: https://discuss.kde.org/t/wayland-boots-to-black-screen-no-cursor-x11-boots-to-black-screen-with-cursor/14274/2

The strange behavior began when I plugged in my laptop to an external monitor - specifically a projector that used a VGA to hdmi adapter. The main monitor went black but the secondary was still usable luckily.

Since then, the main laptop display has not shown an image except the login screen when trying to log into wayland. I can log in from SDDM, but if I choose wayland I get no splash screen just black without a cursor and have to enter a tty and run killall sddm to get back to the sddm login screen or I have to reboot. If I try to log in to X11 session after this, I get a black screen with a cursor. In the X11 session, I am able to move my mouse to the top left corner and I am able to see the view where it shows all your desktops at the top and you can search for applications just below that. I usually have to reboot at least once and log into x11 to get a full desktop environment again.

Additionally, when the screen locks in X11 session I am unable to see the lockscreen until I switch to a different tty and then back again. 


STEPS TO REPRODUCE
1.  Plug in external monitor 


OBSERVED RESULT
Main laptop screen is black and will not come back on during wayland session. Unable to login to wayland session after this, X11 session also misbehaves. Reboot does not fix. 

EXPECTED RESULT
Screen mirror or extended. Main laptop screen works still. 

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: 
Platform: Garuda Linux
Kernel: Zen 6.8.7
KDE Plasma Version:  6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION

I have tried reinstalling wayland, mesa and kwin_wayland which did not help. I am not completely sure if this is a KDE bug or somewhere else. I h


kwin_wayland journalctl: https://pastebin.com/bey65eS0

sddm journalctl: https://pastebin.com/8kJD5VWE

wayland info: https://pastebin.com/f5Sd2j9q
Comment 1 Zamundaaa 2024-04-30 18:50:56 UTC
In the discuss thread, you mention that renaming the output config file makes it work. Does putting the old file back also break it again?
Comment 2 duha.bugs 2024-04-30 18:53:31 UTC
For reference:
The issue was resolved after deleting(renaming= ~/.config/kwinoutputconfig.json 

Discuss thread: https://discuss.kde.org/t/wayland-boots-to-black-screen-no-cursor-x11-boots-to-black-screen-with-cursor/14274

Broken kwinoutputconfig.json file: https://pastebin.com/gBJmH1Nm
Comment 3 nathanp 2024-04-30 20:32:29 UTC
Yes I just tried this, restoring the old config json brings the issue back. I will include both the good one and the bad one here. I did change some display settings like scaling and theming once I got it working again, sorry about that hopefully it does not complicate things. 

The broken one: 

https://pastebin.com/gBJmH1Nm

The working one:

https://pastebin.com/Q8fMeiZx
Comment 4 Zamundaaa 2024-04-30 21:50:01 UTC
okay, I think I see what's going on. With the working config, does switching the mode to 1600x1200 trigger the issue again as well?
Comment 5 nathanp 2024-04-30 22:10:12 UTC
(In reply to Zamundaaa from comment #4)
> okay, I think I see what's going on. With the working config, does switching
> the mode to 1600x1200 trigger the issue again as well?

Yes changing the resolution to 1600x1200 from display settings while logged in causes a black screen with no cursor again.
Comment 6 Zamundaaa 2024-04-30 22:17:10 UTC
Okay, then this probably happened when you tried to mirror the laptop screen to the other screen with the same resolution.
Just to confirm this is something we can prevent from happening, could you attach the output of drm_info here?
Comment 7 nathanp 2024-04-30 22:25:26 UTC
(In reply to Zamundaaa from comment #6)
> Okay, then this probably happened when you tried to mirror the laptop screen
> to the other screen with the same resolution.
> Just to confirm this is something we can prevent from happening, could you
> attach the output of drm_info here?

Is that the same thing as `drmdevice`? I tried installing drm_info and drminfo as well as searching for it in the arch packages repo but I cannot find anything.
Comment 8 Zamundaaa 2024-04-30 22:34:09 UTC
No. It's easy enough to compile for yourself though (https://gitlab.freedesktop.org/emersion/drm_info), but it's probably in the AUR as well
Comment 9 nathanp 2024-04-30 22:44:39 UTC
(In reply to Zamundaaa from comment #8)
> No. It's easy enough to compile for yourself though
> (https://gitlab.freedesktop.org/emersion/drm_info), but it's probably in the
> AUR as well

Ok, couldn't find in AUR but yes easy enough to compile. Here is the output:

https://pastebin.com/EChSCCjx
Comment 10 Zamundaaa 2024-04-30 22:56:36 UTC
Oh, the mode is advertised by the driver...
> │   │   │   ├───1600x1200@60.00 driver phsync pvsync 

If you manually select that same mode on Xorg, does that have the same problem?
Comment 11 nathanp 2024-04-30 23:29:06 UTC
(In reply to Zamundaaa from comment #10)
> Oh, the mode is advertised by the driver...
> > │   │   │   ├───1600x1200@60.00 driver phsync pvsync 
> 
> If you manually select that same mode on Xorg, does that have the same
> problem?

Yep same issue in Xorg if I select 1600x1200@60 - although I am not completely sure if I set phsync or pvsy
Comment 12 Zamundaaa 2024-05-01 01:05:50 UTC
Okay, then this is on a lower level than KWin. You can create an issue at https://gitlab.freedesktop.org/drm/amd/-/issues about the broken mode.
If you want, you can also follow bug 481222; when that's fixed, mirroring won't change modes anymore and would work around this issue
Comment 13 nathanp 2024-05-02 18:47:13 UTC
(In reply to Zamundaaa from comment #12)
> Okay, then this is on a lower level than KWin. You can create an issue at
> https://gitlab.freedesktop.org/drm/amd/-/issues about the broken mode.
> If you want, you can also follow bug 481222; when that's fixed, mirroring
> won't change modes anymore and would work around this issue

I will do this this weekend, just got a bit busier during the week.  Thank you for all the help.