Bug 511274 - Black box under cursor on PineTab2 since 6.5
Summary: Black box under cursor on PineTab2 since 6.5
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 6.5.0
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2025-10-28 16:32 UTC by didi.debian
Modified: 2025-11-12 17:02 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description didi.debian 2025-10-28 16:32:54 UTC
SUMMARY
Since upgrading to Plasma 6.5 I'm seeing a black box under the cursor on my Pine64 PineTab2 in 90+% of cases. Both in SDDM and when logged in to Plasma. I'm *not* seeing it on my amd64 systems with either Intel or AMD graphics.
I reported it to the debian-kde ML here: https://lists.debian.org/debian-kde/2025/10/msg00027.html
Most people use the PineTab2 with 'DanctNIX'/Arch linux and they reported the same problem and a bug report is here: https://codeberg.org/DanctNIX/Pine64-Arch/issues/2 which also includes a picture of the problem.

STEPS TO REPRODUCE
1. Upgrade to Plasma 6.5 including KWin 6.5
2. Reboot
3. See a black box under the cursor in SDDM
4. Log in to the system and still see a black box under the cursor

OBSERVED RESULT
Black box under the cursor

EXPECTED RESULT
No black box under the cursor

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 6.5.0
KDE Plasma Version: 6.5.0
KDE Frameworks Version: 6.18.0
Qt Version: 6.9.2

ADDITIONAL INFORMATION
In my post/reply on the debian-kde ML I said that maybe resetting/changing theme/cursor 'things' could help, but I tried all available combinations and none made the black box (consistently) go away.
As this problem only occurs on my PineTab2, I wondered if maybe 'panfrost' was the problem. So I went to #panfrost and asked there: https://oftc.catirclogs.org/panfrost/2025-10-28#
As you can see there, I tried to use it with llvmpipe and the problem was still there, so that makes it unlikely to be a panfrost problem. In that same channel, Daniel Stone said "that's a bug in either the rockchip-drm KMS driver, or in KWin, or both". As the problem appeared with the upgrade to Plasma/KWin 6.5.0 I figured I'd report it against that first.

On Pine64's #pinetab channel, someone asked for the output of ``drm_info`` while the cursor was visible. You can find that here: https://paste.sr.ht/~diederik/9a45003776d255685a52a21e421e3ae5cbcf9a10
Comment 1 didi.debian 2025-10-30 10:59:54 UTC
Just received an update to 6.5.1 and the problem is still there.
Comment 2 Zamundaaa 2025-10-30 15:03:28 UTC
Looks like the driver doesn't expose an actual cursor plane, so we choose an overlay plane for it instead. That's been the case since Plasma 6.3 though, so I would assume that the overlay plane works correctly. The buffer format on the plane has an alpha channel, so that bit checks out as well.

I don't currently have an idea of where the issue could come from, but you can use https://invent.kde.org/plasma/kwin/-/wikis/Environment-Variables#kwin_force_sw_cursor to work around it.

Could you get a drm_info output from Plasma 6.4 running on the same hardware, also with the cursor visible? It might shed some light on what the difference could be.
Comment 3 didi.debian 2025-10-30 15:43:22 UTC
I created ``~/.config/plasma-workspace/env/force-sw-cursor.sh`` with ``export KWIN_FORCE_SW_CURSOR=1`` in it. Without the ``=1`` I did not see the variable with the ``env`` command. I still have the black box though.

I've contacted someone who I think knows more about the rockchip-drm stuff, hopefully he'll respond (and/or joins this bug).

In the meantime I'll work on setting up a system with Plasma 6.4, but that'll take some time as (parts of) Plasma 6.5 have already migrated to Testing, so that likely means playing around with snapshot.debian.org. Doable, just takes some time.
If Plasma 6.3.6 would work too, that'll be much easier as Debian Stable has that version.
Comment 4 Zamundaaa 2025-10-30 16:00:16 UTC
(In reply to didi.debian from comment #3)
> I created ``~/.config/plasma-workspace/env/force-sw-cursor.sh`` with
> ``export KWIN_FORCE_SW_CURSOR=1`` in it. Without the ``=1`` I did not see
> the variable with the ``env`` command. I still have the black box though.
Huh, that is surprising. Did KWin maybe not pick it up for some reason? You can check with
> cat /proc/$(pidof kwin_wayland)/environ | tr '\0' '\n' | grep KWIN

(In reply to didi.debian from comment #3)
> If Plasma 6.3.6 would work too, that'll be much easier as Debian Stable has
> that version.
Yeah, 6.3 would work too. A live boot would be enough FWIW.
Comment 5 vosjedev 2025-10-30 16:03:13 UTC
Note that this bug does not occur when zoomed in or making a screenshot. As soon as you use the fullscreen zoom effect or make a screenshot, the black box disappears... maybe worth it to check the differences in rendering, if they exist?
Comment 6 didi.debian 2025-10-30 16:11:34 UTC
> cat /proc/$(pidof kwin_wayland)/environ | tr '\0' '\n' | grep KWIN
KWIN_FORCE_SW_CURSOR=1

So KWin should've picked it up.

I should have a basic Stable image laying around, so then it's just a matter of upgrading it and installing KDE.
I just found out 6.4 was never uploaded to Debian, so it's also not available via snapshots. Luckily 6.3 will do too :-)
Comment 7 vosjedev 2025-10-30 19:08:58 UTC
Someone in the pine64 IRC/discord/telegram/whateverelse mentioned it also goes away on x11.

> [T] <Cliff_Chism> Dont know if this helps sort out the cursor thing or not, but the black box went away when i switched to x11 (the smooth user experience went away too).  Also, forcing software rendering of the cursor had no effect on the black box.

for archiving purposes: https://discord.com/channels/463237927984693259/722173748647559298/1433531071324229833

-----

It also goes away when shaking the mouse to enlarge the cursor (should've mentioned it in the previous message, but forgot until Danct mentioned it)

(if you want me to stop providing this information feel free to tell me)
Comment 8 Zamundaaa 2025-10-30 21:23:26 UTC
(In reply to vosjedev from comment #5)
> Note that this bug does not occur when zoomed in or making a screenshot. As
> soon as you use the fullscreen zoom effect or make a screenshot, the black
> box disappears... maybe worth it to check the differences in rendering, if
> they exist?
Well, zoom forces a software cursor. I checked the code again, and we somehow managed to ignore the env var. So it's no wonder it doesn't do anything.
Comment 9 Bug Janitor Service 2025-10-31 11:52:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8342
Comment 10 Zamundaaa 2025-10-31 16:38:32 UTC
Git commit 5848e47dff19b4dd6bb47db7d37200fac5fd3862 by Xaver Hugl.
Committed on 31/10/2025 at 15:27.
Pushed by zamundaaa into branch 'master'.

compositor: fix KWIN_FORCE_SW_CURSOR

It somehow got dropped

M  +4    -1    src/compositor.cpp

https://invent.kde.org/plasma/kwin/-/commit/5848e47dff19b4dd6bb47db7d37200fac5fd3862
Comment 11 Bug Janitor Service 2025-10-31 22:04:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/8345
Comment 12 didi.debian 2025-11-01 10:50:17 UTC
Here is the output of ``drm_info`` under KDE Plasma 6.3 (with the exact same kernel):
https://paste.sr.ht/~diederik/4fd6ce7601178402e756832161d9db33ae2c369a
Comment 13 didi.debian 2025-11-01 11:37:52 UTC
The person I contacted asked me for a 'VOP2 summary' and that showed a difference (I don't know how to interpret it though).

Plasma 6.3:
```
root@trixie-kde:~# sleep 10 && cat /sys/kernel/debug/dri/0/vop2/summary 
Video Port0: DISABLED
Video Port1: ACTIVE
    Connector: DSI-1
        bus_format[0]: Unknown
        output_mode[0] color_space[0]
    Display mode: 800x1280p60
        clk[73500] real_clk[73500] type[48] flag[0]
        H: 800 864 880 944
        V: 1280 1282 1286 1298
    Esmart0-win0: ACTIVE
        win_id: 3
        format: AB24 little-endian (0x34324241) glb_alpha[0xff]
        rotate: xmirror: 0 ymirror: 0 rotate_90: 0 rotate_270: 0
        zpos: 0
        src: pos[0, 0] rect[800 x 1280]
        dst: pos[0, 0] rect[800 x 1280]
        buf[0]: addr: 0x00000000007e1000 pitch: 3200 offset: 0
```

Plasma 6.5:
```
root@sid-kde:~# sleep 10 && cat /sys/kernel/debug/dri/0/vop2/summary
Video Port0: DISABLED
Video Port1: ACTIVE
    Connector: DSI-1
        bus_format[0]: Unknown
        output_mode[0] color_space[0]
    Display mode: 800x1280p60
        clk[73500] real_clk[73500] type[48] flag[0]
        H: 800 864 880 944
        V: 1280 1282 1286 1298
    Esmart0-win0: ACTIVE
        win_id: 3
        format: AB24 little-endian (0x34324241) glb_alpha[0xff]
        rotate: xmirror: 0 ymirror: 0 rotate_90: 0 rotate_270: 0
        zpos: 0
        src: pos[0, 0] rect[800 x 1280]
        dst: pos[0, 0] rect[800 x 1280]
        buf[0]: addr: 0x00000000003e8000 pitch: 3200 offset: 0
    Cluster0-win0: ACTIVE
        win_id: 4
        format: AB24 little-endian (0x34324241)[AFBC] glb_alpha[0xff]
        rotate: xmirror: 0 ymirror: 0 rotate_90: 0 rotate_270: 0
        zpos: 1
        src: pos[0, 0] rect[32 x 32]
        dst: pos[438, 605] rect[32 x 32]
        buf[0]: addr: 0x00000000007d9000 pitch: 128 offset: 0
```
Comment 14 Zamundaaa 2025-11-01 12:45:23 UTC
Git commit 505b80660687585670f45150b31d17dacc80b546 by Xaver Hugl.
Committed on 01/11/2025 at 12:19.
Pushed by zamundaaa into branch 'Plasma/6.5'.

compositor: fix KWIN_FORCE_SW_CURSOR

It somehow got dropped


(cherry picked from commit 5848e47dff19b4dd6bb47db7d37200fac5fd3862)

Co-authored-by: Xaver Hugl <xaver.hugl@kde.org>

M  +4    -1    src/compositor.cpp

https://invent.kde.org/plasma/kwin/-/commit/505b80660687585670f45150b31d17dacc80b546
Comment 15 Zamundaaa 2025-11-03 15:10:21 UTC
Huh, so it did not use the overlay for you in 6.3. Then I'm pretty sure this is a kernel bug - KWin uses a format with alpha, and the driver just ignores the alpha channel.
I don't know where to report bugs in the rockchip driver to, probably someone in #panfrost can help with that.

In 6.5.2, KWIN_FORCE_SW_CURSOR should at least be usable as a workaround until the driver is fixed.
Comment 16 didi.debian 2025-11-03 16:18:01 UTC
> I'm pretty sure this is a kernel bug - KWin uses a format with alpha, 
> and the driver just ignores the alpha channel.

That is quite possible indeed.

I did some more tests and these are the findings:
- I could not reproduce it on a Rock64 (rk3328)
- I could not reproduce it on a Quartz64-B (rk3566, same as PineTab2)
- 'my' rockchip-drm expert could not reproduce it on his rk3566-box-demo
- ``cat /sys/kernel/debug/dri/0/vop2/summary`` gave some interesting results:

rk3566-box-demo:
Video Port0: ACTIVE
   Connector: HDMI-A-1
      ...
   Display mode: 1920x1080p60
      ...
   Smart0-win0: ACTIVE
      ...
      src: pos[0, 0] rect[1920 x 1080]
      dst: pos[0, 0] rect[1920 x 1080]
      ...
   Esmart0-win0: ACTIVE
      ...
      src: pos[0, 0] rect[32 x 32]
      dst: pos[1702, 615] rect[32 x 32]
      ...

Quartz64-B:
Video Port0: ACTIVE
   Connector: HDMI-A-1
      ...
   Display mode: 1920x1080p60
      ...
   Smart0-win0: ACTIVE
      ...
      src: pos[0, 0] rect[1920 x 1080]
      dst: pos[0, 0] rect[1920 x 1080]
   Esmart0-win0: ACTIVE
      ...
      src: pos[0, 0] rect[32 x 32]
      dst: pos[497, 402] rect[32 x 32]
      ...

PineTab2:
Video Port0: DISABLED
Video Port1: ACTIVE
   Connector: DSI-1
      ...
   Display mode: 800x1280p60
      ...
   Esmart0-win0: ACTIVE
      ...
      src: pos[0, 0] rect[800 x 1280]
      dst: pos[0, 0] rect[800 x 1280]
      ...
   Cluster0-win0: ACTIVE
      ...
      src: pos[0, 0] rect[32 x 32]
      dst: pos[290, 875] rect[32 x 32]
      ...

*I*IUC different 'planes' are used on the PineTab then in the other cases.

My rockchip-drm expert also said this:
> I suspect the root cause of this issue might be that the VOP driver
> didn't handle the alpha blending of AFBC format properly when
> Cluster0-win0 was used as cursor plane.
Comment 17 didi.debian 2025-11-03 16:21:15 UTC
> I don't know where to report bugs in the rockchip driver to, 
> probably someone in #panfrost can help with that.

It's likely that 'my rockchip-drm expert' is the right person to fix that.

> In 6.5.2, KWIN_FORCE_SW_CURSOR should at least be usable as a workaround until the driver is fixed.

Thanks!
Comment 18 didi.debian 2025-11-12 17:02:13 UTC
A patch which fixes this issue (for me) has been proposed to the upstream Linux kernel here:
https://lore.kernel.org/linux-rockchip/20251112085024.2480111-1-andyshrk@163.com/

Testers and 'Tested-by' tags are much appreciated (reply to that message)