Bug 487037 - kwin software cursor fallback locks up entire screen under certain conditions
Summary: kwin software cursor fallback locks up entire screen under certain conditions
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: platform-drm (show other bugs)
Version: 6.0.4
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-15 00:00 UTC by James Calligeros
Modified: 2024-05-24 01:09 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0.5


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Calligeros 2024-05-15 00:00:39 UTC
SUMMARY
kwin is able to fall back to a software cursor if its cursor plane operation is rejected by the KMS driver's atomic plane check. This works fine in most circumstances, however locks up the entire screen surface when the rejected swap occurs over the windows of certain applications. This is most apparent with Firefox, VLC, LibreOffice or GIMP on Apple Silicon Macs with hardware plane support implemented.

This does not occur with Plasma panels or most KDE apps (tested with Konversation, System Settings, etc).

STEPS TO REPRODUCE
1. Use an Apple Silicon Mac
2. Observe that when moving the cursor to the bottom or right edge of the screen, kwin correctly picks up that the KMS driver has rejected the swap and falls back to software cursors.
3. Open one of Firefox, VLC, LibreOffice or GIMP
4. Make sure one of the application's windows clips the bottom or right edge of the screen
5. Move the cursor to the edge of the screen clipped by the window

OBSERVED RESULT
Kwin considers the entire screen state to be rejected and locks up all planes until the cursor is moved away from the edge of the screen, at which point things work properly again.

EXPECTED RESULT
kwin should fall back to software cursors consistently

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux 6.8.9-asahi-5 (with hardware plane patches)
KDE Plasma Version: 6.0.4
KDE Frameworks Version: 6.1.0
Qt Version: 6.7.0

ADDITIONAL INFORMATION
The patched KMS driver can be found at https://github.com/chadmed/linux/tree/dcp-overlay-planes
Comment 1 Bug Janitor Service 2024-05-19 16:37:32 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5750
Comment 2 Zamundaaa 2024-05-20 11:22:51 UTC
Git commit bbf4f46b280efb24c34df23253f20b195c1f347c by Xaver Hugl.
Committed on 20/05/2024 at 11:14.
Pushed by zamundaaa into branch 'master'.

compositor_wayland: properly handle moving the cursor plane failing

On test failure, the plane has to be disabled or future atomic tests fail

M  +24   -10   src/compositor_wayland.cpp

https://invent.kde.org/plasma/kwin/-/commit/bbf4f46b280efb24c34df23253f20b195c1f347c
Comment 3 Vlad Zahorodnii 2024-05-20 15:19:39 UTC
Git commit 772492471f60f06089fc0d3e70085ff3556b8edc by Vlad Zahorodnii, on behalf of Xaver Hugl.
Committed on 20/05/2024 at 15:08.
Pushed by vladz into branch 'Plasma/6.0'.

compositor_wayland: properly handle moving the cursor plane failing

On test failure, the plane has to be disabled or future atomic tests fail
(cherry picked from commit bbf4f46b280efb24c34df23253f20b195c1f347c)

M  +24   -10   src/compositor_wayland.cpp

https://invent.kde.org/plasma/kwin/-/commit/772492471f60f06089fc0d3e70085ff3556b8edc