Bug 457002 - DisplayPort monitor is disabled instantly
Summary: DisplayPort monitor is disabled instantly
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: platform-drm (show other bugs)
Version: master
Platform: Compiled Sources Linux
: VHI major
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression, wayland
: 457519 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-07-22 03:00 UTC by morguldir
Modified: 2022-08-16 13:56 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
morguldir: Wayland+
morguldir: NVIDIA+


Attachments
Kwin Debug Logs (deleted)
2022-07-22 03:00 UTC, morguldir
Details
KWIN Debug Log (243.46 KB, text/plain)
2022-07-22 03:14 UTC, morguldir
Details
KWIN Crash Backtrace (5.28 KB, text/plain)
2022-07-22 20:18 UTC, morguldir
Details
KWIN Valgrind Output (18.08 KB, text/plain)
2022-07-23 14:14 UTC, morguldir
Details
KWIN Crash Backtrace for !2711 (5.21 KB, text/plain)
2022-07-23 22:26 UTC, morguldir
Details
KWIN Crash Backtrace for !2711 (3.21 KB, text/plain)
2022-07-24 10:37 UTC, morguldir
Details
KWIN Valgrind Output for !2711 (22.71 KB, text/plain)
2022-07-24 13:10 UTC, morguldir
Details

Note You need to log in before you can comment on or make changes to this bug.
Description morguldir 2022-07-22 03:00:31 UTC
Created attachment 150802 [details]
Kwin Debug Logs

SUMMARY

On master my main monitor stopped working, I tried enabling it with kscreen-doctor, but kwin logs say it just get's disabled again instantly. With git-bisect i have narrowed it down to this commit https://invent.kde.org/plasma/kwin/-/commit/f50547de1ee1e892dbaa6e020db3818db4333e14

STEPS TO REPRODUCE
1. Have a displayport monitor connected to your (NVIDIA?) GPU
2. Launch the Plasma Wayland session

OBSERVED RESULT
The monitor does not display anything

EXPECTED RESULT
The monitor displays something and receives a signal

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux (5.18.12)
KDE Plasma Version: 5.25.80
KDE Frameworks Version: 5.97.0
Qt Version: 5.15.5
Comment 1 morguldir 2022-07-22 03:02:43 UTC
Comment on attachment 150802 [details]
Kwin Debug Logs

a
Comment 2 morguldir 2022-07-22 03:03:49 UTC
Comment on attachment 150802 [details]
Kwin Debug Logs

3e4yh34hthe4rhteherhreher
Comment 3 morguldir 2022-07-22 03:14:43 UTC
Created attachment 150803 [details]
KWIN Debug Log
Comment 4 Ben Cooksley 2022-07-22 08:05:04 UTC
The content of attachment 150802 [details] has been deleted for the following reason:

Requested by submitter
Comment 5 Zamundaaa 2022-07-22 19:45:30 UTC
I don't see anything that would cause the output to be disabled like that but as KWin crashes afterwards, that's most likely related. Can you provide a backtrace with debug symbols?
Comment 6 morguldir 2022-07-22 20:18:02 UTC
Created attachment 150836 [details]
KWIN Crash Backtrace

Here you go (took a bit since I had written RelWithDebug instead of RelWithDebInfo)
Comment 7 Zamundaaa 2022-07-23 11:56:50 UTC
It's crashing in qdebug, that's too late for getting anything useful out of it. Can you try running kwin with valgrind? It'll likely be super slow, but it finds out exactly where things go wrong.
Comment 8 morguldir 2022-07-23 14:14:35 UTC
Created attachment 150848 [details]
KWIN Valgrind Output

It seems to not crash anymore when i run with valgrind, nor kwin standalone, here is valgrind with kwin though, still has a few errors

Sidenote: I couldn't run kwin or plasma from a tty, but i just ran a script that uses valgrind with my display manager instead
Comment 9 morguldir 2022-07-23 18:58:03 UTC
Found a workaround at least, if I disable one of my other monitors first (doesn't matter which one) and then enable the main monitor, and then enable the other monitor, all with kscreen-doctor, it works again.
Comment 10 morguldir 2022-07-23 22:26:17 UTC
Created attachment 150859 [details]
KWIN Crash Backtrace for !2711
Comment 11 morguldir 2022-07-24 10:37:57 UTC
Created attachment 150865 [details]
KWIN Crash Backtrace for !2711
Comment 12 morguldir 2022-07-24 13:10:18 UTC
Created attachment 150867 [details]
KWIN Valgrind Output for !2711
Comment 13 Vlad Zahorodnii 2022-07-24 14:42:14 UTC
Git commit 5aef41663ab7da5b02e3c5871adb8b39213778f9 by Vlad Zahorodnii.
Committed on 24/07/2022 at 14:20.
Pushed by vladz into branch 'master'.

backends/drm: Fix potential use-after-free

When the output is removed, there are legit cases when the connector can
be still accessed.

M  +1    -1    src/backends/drm/drm_gpu.cpp

https://invent.kde.org/plasma/kwin/commit/5aef41663ab7da5b02e3c5871adb8b39213778f9
Comment 14 Vlad Zahorodnii 2022-07-24 14:42:22 UTC
Git commit 96f3a5eec287ac81e84ae0442d2f8a1945471420 by Vlad Zahorodnii.
Committed on 24/07/2022 at 14:20.
Pushed by vladz into branch 'master'.

backends/drm: Fix dangling connectors in m_allObjects

We add connectors to m_allObjects but never remove them.

M  +2    -0    src/backends/drm/drm_gpu.cpp

https://invent.kde.org/plasma/kwin/commit/96f3a5eec287ac81e84ae0442d2f8a1945471420
Comment 15 Zamundaaa 2022-08-06 15:21:33 UTC
*** Bug 457519 has been marked as a duplicate of this bug. ***
Comment 16 Nate Graham 2022-08-16 13:27:30 UTC
In progress with https://invent.kde.org/plasma/kwin/-/merge_requests/2824!.
Comment 17 Zamundaaa 2022-08-16 13:48:11 UTC
Git commit 506e2d6f9f677b9975068b5d425e49273b2dd14c by Xaver Hugl, on behalf of Janet Blackquill.
Committed on 16/08/2022 at 13:04.
Pushed by zamundaaa into branch 'master'.

drm_gpu: don't bother trying to assign a crtc to a connector that isn't connected

M  +1    -1    src/backends/drm/drm_gpu.cpp

https://invent.kde.org/plasma/kwin/commit/506e2d6f9f677b9975068b5d425e49273b2dd14c
Comment 18 Zamundaaa 2022-08-16 13:56:56 UTC
Git commit ac232be9681d53bd09cded87313c1c0b0a4d7214 by Xaver Hugl, on behalf of Janet Blackquill.
Committed on 16/08/2022 at 13:56.
Pushed by zamundaaa into branch 'Plasma/5.25'.

drm_gpu: don't bother trying to assign a crtc to a connector that isn't connected


(cherry picked from commit 506e2d6f9f677b9975068b5d425e49273b2dd14c)

M  +1    -1    src/backends/drm/drm_gpu.cpp

https://invent.kde.org/plasma/kwin/commit/ac232be9681d53bd09cded87313c1c0b0a4d7214