Bug 456306 - Wayland-exclusive mouse cursor graphical artifacts
Summary: Wayland-exclusive mouse cursor graphical artifacts
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.25.4
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 459679 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-07-04 08:00 UTC by l1ttleofficial
Modified: 2022-10-24 00:29 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.26


Attachments
Camera image of the mouse cursor. This cannot be seen on screenshots (108.09 KB, image/jpeg)
2022-07-04 08:00 UTC, l1ttleofficial
Details

Note You need to log in before you can comment on or make changes to this bug.
Description l1ttleofficial 2022-07-04 08:00:51 UTC
Created attachment 150380 [details]
Camera image of the mouse cursor. This cannot be seen on screenshots

SUMMARY
On Wayland and on Wayland only, the mouse cursor has strong graphical artifacts;
The result cannot be captured on a screenshot and is only visible on the screen itself;
The artifact disappears when using the Zoom effect;
This occurs independently of the cursor theme selected.

STEPS TO REPRODUCE
1. Log into a Plasma Wayland session

OBSERVED RESULT
The mouse cursor is stretched vertically and has a square of artifacts around it

EXPECTED RESULT
The mouse cursor looks as intended

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Tumbleweed 20220702
(available in About System)
KDE Plasma Version: 5.25.2
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.5

ADDITIONAL INFORMATION
KWin support information: https://bytebin.lucko.me/kPsC2hqMJS
Comment 1 Bug Janitor Service 2022-07-13 07:51:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2646
Comment 2 Zamundaaa 2022-07-13 20:25:49 UTC
Git commit 7f04ea578f6b59f36f6321669a8eab3750e021c5 by Xaver Hugl.
Committed on 13/07/2022 at 19:10.
Pushed by zamundaaa into branch 'master'.

backends/drm: handle broken legacy drivers better

Some legacy drivers either don't accept gbm buffers suitable for cursors,
or don't handle them properly. In order to work around that, always do a
CPU import with legacy and use dumb buffers instead.
Related: bug 453860

M  +6    -2    src/backends/drm/egl_gbm_cursor_layer.cpp
M  +17   -16   src/backends/drm/egl_gbm_layer_surface.cpp
M  +11   -6    src/backends/drm/egl_gbm_layer_surface.h

https://invent.kde.org/plasma/kwin/commit/7f04ea578f6b59f36f6321669a8eab3750e021c5
Comment 3 Zamundaaa 2022-07-13 20:35:15 UTC
Git commit f3c1facdc477a18ff5c528972ffef5d09a3a6a35 by Xaver Hugl.
Committed on 13/07/2022 at 20:35.
Pushed by zamundaaa into branch 'Plasma/5.25'.

backends/drm: handle broken legacy drivers better

Some legacy drivers either don't accept gbm buffers suitable for cursors,
or don't handle them properly. In order to work around that, always do a
CPU import with legacy and use dumb buffers instead.
Related: bug 453860


(cherry picked from commit 7f04ea578f6b59f36f6321669a8eab3750e021c5)

M  +6    -2    src/backends/drm/egl_gbm_cursor_layer.cpp
M  +17   -16   src/backends/drm/egl_gbm_layer_surface.cpp
M  +11   -6    src/backends/drm/egl_gbm_layer_surface.h

https://invent.kde.org/plasma/kwin/commit/f3c1facdc477a18ff5c528972ffef5d09a3a6a35
Comment 4 l1ttleofficial 2022-08-06 06:22:11 UTC
Partially fixed in 5.25.4. There are no longer colorful artifacts around the mouse cursor, but the cursor itself is still stretched horizontally & vertically and has a scanline effect
Comment 5 l1ttleofficial 2022-08-06 12:35:03 UTC
(In reply to l1ttleofficial from comment #4)
> Partially fixed in 5.25.4. There are no longer colorful artifacts around the
> mouse cursor, but the cursor itself is still stretched horizontally &
> vertically and has a scanline effect

Apologies for misinformation, I submitted the comment in a hurry and thought I could edit it later.
- Artifacts still may appear using the mouse cursor, reusing previous screen content (can't replicate consistently)
- The cursor isn't "stretched" horizontally, only vertically.
- "stretched" and "scanline effect" is actually a 1 pixel gap between each pixel of the cursor texture
- Any issues disappear when zooming in
Comment 6 Zamundaaa 2022-10-03 19:35:33 UTC
*** Bug 459679 has been marked as a duplicate of this bug. ***
Comment 7 Bug Janitor Service 2022-10-03 19:37:28 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3019
Comment 8 Eugene 2022-10-03 19:53:15 UTC
There is screenshot in duplicated report.
Comment 9 Vlad Zahorodnii 2022-10-04 08:15:20 UTC
Git commit 18a72f7187ea2629671449ff6202292225235e82 by Vlad Zahorodnii, on behalf of Xaver Hugl.
Committed on 04/10/2022 at 07:33.
Pushed by vladz into branch 'master'.

backends/drm: also force linear layout for dumb buffer cursors

While it usually shouldn't make a difference, it ensures that the buffer import
always works properly

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

https://invent.kde.org/plasma/kwin/commit/18a72f7187ea2629671449ff6202292225235e82
Comment 10 Vlad Zahorodnii 2022-10-04 08:21:06 UTC
Git commit fc00487b6bdc9756714dfc69b65caee937a0097a by Vlad Zahorodnii, on behalf of Xaver Hugl.
Committed on 04/10/2022 at 08:21.
Pushed by vladz into branch 'Plasma/5.26'.

backends/drm: also force linear layout for dumb buffer cursors

While it usually shouldn't make a difference, it ensures that the buffer import
always works properly


(cherry picked from commit 18a72f7187ea2629671449ff6202292225235e82)

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

https://invent.kde.org/plasma/kwin/commit/fc00487b6bdc9756714dfc69b65caee937a0097a
Comment 11 Zamundaaa 2022-10-17 11:33:35 UTC
Can someone with an affected setup confirm whether or not it's still an issue with 5.26?
Comment 12 Zamundaaa 2022-10-23 20:31:27 UTC
.
Comment 13 Eugene 2022-10-23 23:43:55 UTC
Hello. I can confirm, in KDE 5.26 mouse cursor is ok. Thank you.
Comment 14 Zamundaaa 2022-10-24 00:29:14 UTC
great!