Bug 431981 - Regression: VR headset is detected as display on a Wayland session and keeps disconnecting and re-appearing
Summary: Regression: VR headset is detected as display on a Wayland session and keeps ...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: multi-screen (other bugs)
Version First Reported In: 5.20.90
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-23 10:09 UTC by Bart Ribbers
Modified: 2021-01-26 21:15 UTC (History)
2 users (show)

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


Attachments
Screenshot of insane amount of crash messages (271.75 KB, image/png)
2021-01-23 15:28 UTC, Bart Ribbers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bart Ribbers 2021-01-23 10:09:19 UTC
SUMMARY
My system permanently has a Valve Index VR headset attached. Where on Plasma 5.20.5 it wasn't used as output by both the X11 and Wayland session (as it should), this changed in 5.20.90. Now, on the Wayland session, the output seems to be used as a regular monitor and keeps popping up and disappearing every few seconds. This causes the session to re-arrange the monitors constantly and makes the whole session unusable. This does not happen on an X11 session.

STEPS TO REPRODUCE
1. Attach a VR headset to your PC
2. Start a Wayland session on Plasma 5.20.90
3. Note the displays constantly re-arranging, and see the VR headset being detected as a monitor in the display settings

OBSERVED RESULT
The VR headset is detected as a regular monitor but instead of being able to just disable it (which shouldn't be needed in the first place), it keeps disappearing and reappearing every few seconds. This causes the monitors to be re-arranged constantly.

EXPECTED RESULT
The VR headset to be completely ignored.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Alpine Linux edge
KDE Plasma Version: 5.20.90
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
My specific headset is a Valve Index, I'm not sure if this matters.
Comment 1 Zamundaaa 2021-01-23 14:58:43 UTC
Are you using the latest firmware? It may be that it doesn't offer you the latest on Linux, so try updating it with Windows if you have a working partiiton.

Also, are you using any kernel flags concerning amdgpu? I have a hunch that you're using "amdgpu.dc=0" because in 5.20 VR headsets were treated as normal monitors and not ignored.
Comment 2 Bart Ribbers 2021-01-23 15:21:06 UTC
The latest firmware is installed yes, that shouldn't be a problem.

I am indeed running with "amdgpu.dc=0", but I was in 5.20 too. I'll try without that flag, but why would behaviour be different in this latest release?
Comment 3 Bart Ribbers 2021-01-23 15:28:42 UTC
Created attachment 135097 [details]
Screenshot of insane amount of crash messages

Removing "amdgpu.dc=1" did indeed resolve the issue, thanks. I'm not entirely sure anymore why I added it originally, I believe because of multi-monitor issues (often when turning all screens off and later back on again causes Plasma to not be able to initialize the screens properly and I have to reboot to make it work again).

However, the plasmashell crashed twice in like the 2 minutes that I had the session running. Not sure if related? See screenshot for the awful amount of crash popups I got.
Comment 4 Zamundaaa 2021-01-23 16:25:25 UTC
I have no clue why it would behave differently; the driver AFAIK just completely doesn't tell KWin about VR headsets with amdgpu.dc=0 (or it wouldn't have ignored it in 5.20) and that shouldn't change with KWin versions.

> However, the plasmashell crashed twice in like the 2 minutes that I had the session running. Not sure if related? See screenshot for the awful amount of crash popups I got.

It appears that a few more people have that problem with the beta, it's probably unrelated.
Comment 5 Bug Janitor Service 2021-01-26 20:30:37 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/625
Comment 6 Zamundaaa 2021-01-26 20:37:19 UTC
Turns out we can detect VR headsets without atomic modesetting. I didn't test with amdgpu.dc=0 specifically but if it still doesn't work with amdgpu.dc=0 and that patch then that's a driver problem we can't do anything about.
Comment 7 Zamundaaa 2021-01-26 21:14:15 UTC
Git commit 9f4a1433e416944fa26b8580eaad4a8f48fd61d8 by Xaver Hugl.
Committed on 26/01/2021 at 20:23.
Pushed by zamundaaa into branch 'master'.

Also initialize properties when not using AMS

M  +3    -3    autotests/drm/objecttest.cpp
M  +9    -11   plugins/platforms/drm/drm_gpu.cpp
M  +1    -1    plugins/platforms/drm/drm_object.h
M  +1    -1    plugins/platforms/drm/drm_object_connector.cpp
M  +1    -1    plugins/platforms/drm/drm_object_connector.h
M  +2    -2    plugins/platforms/drm/drm_object_crtc.cpp
M  +1    -1    plugins/platforms/drm/drm_object_crtc.h
M  +1    -1    plugins/platforms/drm/drm_object_plane.cpp
M  +1    -1    plugins/platforms/drm/drm_object_plane.h

https://invent.kde.org/plasma/kwin/commit/9f4a1433e416944fa26b8580eaad4a8f48fd61d8
Comment 8 Zamundaaa 2021-01-26 21:15:15 UTC
Git commit 031924b4d23e0a7cb5c68e43791f748b79a91ee1 by Xaver Hugl.
Committed on 26/01/2021 at 21:14.
Pushed by zamundaaa into branch 'Plasma/5.21'.

Also initialize properties when not using AMS
(cherry picked from commit 9f4a1433e416944fa26b8580eaad4a8f48fd61d8)

M  +3    -3    autotests/drm/objecttest.cpp
M  +9    -11   plugins/platforms/drm/drm_gpu.cpp
M  +1    -1    plugins/platforms/drm/drm_object.h
M  +1    -1    plugins/platforms/drm/drm_object_connector.cpp
M  +1    -1    plugins/platforms/drm/drm_object_connector.h
M  +2    -2    plugins/platforms/drm/drm_object_crtc.cpp
M  +1    -1    plugins/platforms/drm/drm_object_crtc.h
M  +1    -1    plugins/platforms/drm/drm_object_plane.cpp
M  +1    -1    plugins/platforms/drm/drm_object_plane.h

https://invent.kde.org/plasma/kwin/commit/031924b4d23e0a7cb5c68e43791f748b79a91ee1