Sway high CPU utilization and screen corruption

Hello,

This past long weekend I ran a full OS upgrade (apt full-upgrade) on my MNT Reform. At the same time I was trying to address why the kernel module for the battery level wasn’t being loaded.

After the upgrade, the system rebooted normally. Upon starting sway, I opened two terminal sessions side by side and I noticed some screen corruption as I moved the mouse pointer. At the same time I noticed the high CPU utilization of sway:

gsamu@reform:~$ htop
gsamu@reform:~$ top

top - 12:56:40 up 1:01, 1 user, load average: 1.89, 1.88, 1.64
Tasks: 187 total, 1 running, 186 sleeping, 0 stopped, 0 zombie
%Cpu(s): 11.5 us, 0.7 sy, 0.0 ni, 87.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 3920.0 total, 2029.2 free, 967.9 used, 1150.2 buff/cache
MiB Swap: 8192.0 total, 8192.0 free, 0.0 used. 2952.1 avail Mem

PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                         

2156 gsamu 20 0 1079788 152328 91408 S 41.6 3.8 52:14.42 sway
2188 gsamu 20 0 551412 47956 38516 S 3.3 1.2 0:43.63 xfce4-terminal
75 root 0 -20 0 0 0 S 1.7 0.0 0:22.12 pr/ttymxc0
2186 gsamu 20 0 1171164 51348 40280 S 1.0 1.3 0:41.75 waybar
2365 gsamu 20 0 18656 13284 6076 S 1.0 0.3 0:35.05 reform-compstat
2815 gsamu 20 0 10212 5172 3088 R 1.0 0.1 0:00.22 top
560 root 20 0 60176 24080 22468 D 0.7 0.6 0:07.60 systemd-journal
28 root 20 0 0 0 0 I 0.3 0.0 0:00.50 kworker/2:0-mm_percpu_wq
517 root 20 0 0 0 0 D 0.3 0.0 0:03.07 kworker/u16:5+events_unbound
1739 root 20 0 320304 9988 7984 S 0.3 0.2 0:02.72 upowerd
1 root 20 0 25396 15120 10368 S 0.0 0.4 0:07.99 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.03 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:00.00 pool_workqueue_release
4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/R-rcu_gp
5 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/R-sync_wq
6 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/R-kvfree_rcu_reclaim
7 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/R-slub_flushwq
8 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/R-netns
11 root 20 0 0 0 0 I 0.0 0.0 0:01.05 kworker/0:1-events
12 root 20 0 0 0 0 I 0.0 0.0 0:02.86 kworker/u16:0-kvfree_rcu_recla+
13 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/R-mm_percpu_wq
14 root 20 0 0 0 0 S 0.0 0.0 0:00.12 ksoftirqd/0
15 root 20 0 0 0 0 I 0.0 0.0 0:01.67 rcu_sched
16 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_exp_par_gp_kthread_worker/0
17 root 20 0 0 0 0 S 0.0 0.0 0:00.14 rcu_exp_gp_kthread_worker
18 root rt 0 0 0 0 S 0.0 0.0 0:00.01 migration/0
19 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0
20 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/1
21 root rt 0 0 0 0 S 0.0 0.0 0:00.02 migration/1
22 root 20 0 0 0 0 S 0.0 0.0 0:00.02 ksoftirqd/1
24 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/1:0H-events_highpri

I’m not quite certain how to debug this. I don’t see any errors in the syslog. The system is usable but when loading graphical applications like Chromium I’m seeing screen corruption and artifacting also. But again, this happens with the terminal application also.

Something to add, I’m seeing in the htop output that it’s the processes:

llvmpipe-# | sway

That are taking a lot of CPU. I thought etnaviv was the driver for the stock Reform 2 system?

If I remember correctly, you’re on LS1028A, right?

No, it’s not LS1028A. I didn’t purchase that one yet. It’s the stock board which shipped with the initial Reform2 systems:

root@reform:~# cat /proc/cpuinfo
processor : 0
BogoMIPS : 16.66
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 1
BogoMIPS : 16.66
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 2
BogoMIPS : 16.66
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 3
BogoMIPS : 16.66
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

@josch (and cc @austriancoder) can you confirm GPU issues with sway on the latest kernel for MNT Reform with i.MX8MQ? Didn’t we just ship a new patch?

@minute I also noticed that /etc/X11/xorg.conf.d is empty on my system. I don’t recall if there was any specific X configuration there for example.

Unfortunately not. I only have my A311D classic Reform, RK3588 classic Reform and RK3588 Pocket Reform with me. The imx8mq classic Reform is at home… :frowning:

Yes. This was the MR: Add patch 'drm/etnaviv: Fix flush sequence logic' to fix mmu faults (!136) · Merge requests · Reform / reform-debian-packages · GitLab

Yes, we used to ship /etc/X11/xorg.conf with this content:

Section "Device"
  Identifier "etnaviv"
  Driver "modesetting"
  Option "kmsdev" "/dev/dri/card1"
  Option "AccelMethod" "glamor"
  Option "SWcursor" "off"
  Option "ShadowFB" "off"
  Option "PageFlip" "off"
EndSection

Section "ServerFlags"
  Option "AutoAddGPU" "false"
EndSection

Section "Files"
  ModulePath "/usr/local/lib/xorg/modules"
  ModulePath "/usr/local/lib/arm-linux-gnueabihf/xorg/modules"
EndSection

And /usr/share/X11/xorg.conf.d/10-reform-etnaviv.conf with this content:

Section "Device"
  Identifier "eDP-1"
  Driver "modesetting"
  Option "kmsdev" "/dev/dri/card0"
  Option "AccelMethod" "glamor"
  Option "Atomic" "On"
EndSection

But the last reform-tools version that shipped these was version 1.34 from January 2024.

ok the xorg.conf on my system looks the same. I don’t have the file in /usr/share/X11 …

Some additional information:

root@reform:/etc/X11# lsmod |grep etnaviv
etnaviv 122880 0
gpu_sched 57344 2 etnaviv,panfrost
root@reform:/etc/X11# ls -la /dev/dri
total 0
drwxr-xr-x 3 root root 80 Sep 2 14:18 .
drwxr-xr-x 17 root root 3820 Sep 2 14:18 ..
drwxr-xr-x 2 root root 60 Sep 2 14:18 by-path
crw-rw----+ 1 root video 226, 0 Sep 2 14:20 card0

root@reform:/etc/X11# pwd
/etc/X11
root@reform:/etc/X11# grep dri xorg.conf
Option “kmsdev” “/dev/dri/card1”

My system doesn’t have /dev/dri/card1 (only /dev/dri/card0)

root@reform:/etc/X11# uname -a
Linux reform 6.16.3-mnt-reform-arm64 #1 SMP PREEMPT Debian 6.16.3-1+reform20250830T222127Z (2025-08-3 aarch64 GNU/Linux
root@reform:/etc/X11# cat /etc/os-release
PRETTY_NAME=“Debian GNU/Linux forky/sid”
NAME=“Debian GNU/Linux”
VERSION_CODENAME=forky
ID=debian
HOME_URL=“https://www.debian.org/”
SUPPORT_URL=“https://www.debian.org/support”
BUG_REPORT_URL=“https://bugs.debian.org/”

ok not to conflate the issues, but I just noticed that the battery gauge isn’t showing the correct value and I see repeatedly in the system logs:

[ 3501.515184] power_supply_format_property: 2 callbacks suppressed
[ 3501.515240] power_supply BAT0: driver failed to report voltage_now' property: -16 [ 3502.019197] power_supply BAT0: driver failed to report voltage_now’ property: -16
[ 3502.523205] power_supply BAT0: driver failed to report voltage_now' property: -16 [ 3503.027200] power_supply BAT0: driver failed to report voltage_now’ property: -16
[ 3503.531216] power_supply BAT0: driver failed to report voltage_now' property: -16 [ 3504.035219] power_supply BAT0: driver failed to report voltage_now’ property: -16
[ 3504.371220] power_supply BAT0: driver failed to report voltage_now' property: -16 [ 3504.707224] power_supply BAT0: driver failed to report voltage_now’ property: -16
[ 3505.043225] power_supply BAT0: driver failed to report voltage_now' property: -16 [ 3505.379234] power_supply BAT0: driver failed to report voltage_now’ property: -16

For this, I should log it separately here, unless this is known already.

On my system it looks like this: untitled - asciinema.org

@austriancoder thanks for sharing. Sadly I’m seeing sway use up to 150% CPU according to top - it jumps up to that and back down while I see some screen corruption.

@austriancoder Assuming you also have the i.MX8MQ board, could you share your /etc/X11/xorg.conf and /usr/share/X11/xorg.conf.d/10-reform-etnaviv.conf files as well?

Sure.

➜ ~ cat /etc/X11/xorg.conf
Section “Device”
Identifier “etnaviv”
Driver “modesetting”
Option “kmsdev” “/dev/dri/card1”
Option “AccelMethod” “glamor”
Option “SWcursor” “off”
Option “ShadowFB” “off”
Option “PageFlip” “off”
EndSection

Section “ServerFlags”
Option “AutoAddGPU” “false”
EndSection

Section “Files”
ModulePath “/usr/local/lib/xorg/modules”
ModulePath “/usr/local/lib/arm-linux-gnueabihf/xorg/modules”
EndSection

➜ ~ cat usr/share/X11/xorg.conf.d/10-reform-etnaviv.conf
cat: usr/share/X11/xorg.conf.d/10-reform-etnaviv.conf: No such file or directory

This looks strange:

root@reform:/etc/X11# ls -la /dev/dri
total 0
drwxr-xr-x 3 root root 80 Sep 2 14:18 .
drwxr-xr-x 17 root root 3820 Sep 2 14:18 ..
drwxr-xr-x 2 root root 60 Sep 2 14:18 by-path
crw-rw----+ 1 root video 226, 0 Sep 2 14:20 card0

There need to be two card device nodes - one etnaviv and one imx-dcss.
➜ ~ ls -la /dev/dri
total 0
drwxr-xr-x 3 root root 120 Sep 2 21:32 .
drwxr-xr-x 17 root root 3780 Sep 2 21:33 ..
drwxr-xr-x 2 root root 100 Sep 2 21:32 by-path
crw-rw----+ 1 root video 226, 0 Sep 2 21:33 card0
crw-rw----+ 1 root video 226, 1 Sep 2 21:33 card1
crw-rw----+ 1 root render 226, 128 Sep 2 21:33 renderD128

Can you provide the output of sudo dmesg | grep drm

I’m seeing the following:

root@reform:~# sudo dmesg | grep drm
[ 8.048167] nwl-dsi 30a00000.dsi: [drm:nwl_dsi_probe [nwl_dsi]] Using DCSS as input source
[ 9.293496] nwl-dsi 30a00000.dsi: [drm:nwl_dsi_host_attach [nwl_dsi]] lanes=4, format=0x0 flags=0x1
[ 9.320943] [drm] Initialized imx-dcss 1.0.0 for 32e00000.display-controller on minor 0
[ 9.459878] imx-dcss 32e00000.display-controller: [drm] fb0: imx-dcssdrmfb frame buffer device
[ 23.781041] systemd[1]: modprobe@drm.service - Load Kernel Module drm was skipped because of an unmet condition check (ConditionKernelModuleLoaded=!drm).

On your system etnaviv is not probed and you fall back to sw rendering. You should have that line:
[drm] Initialized etnaviv 1.4.0 for etnaviv on minor 1

1 Like

Yes I see that now. IIn the dmesg output there is an error about loading the DRM:

[ 30.733571] systemd[1]: modprobe@drm.service - Load Kernel Module drm was skipped because of an unmet condition check (ConditionKernelModuleLoaded=!drm).

@austriancoder I’m wondering if you also have this panfrost module being loaded? See here:

root@reform:/lib/modules# lsmod |grep etnaviv
etnaviv 122880 0
gpu_sched 57344 2 etnaviv,panfrost
root@reform:/lib/modules# lsmod |grep panfrost
panfrost 94208 0
drm_shmem_helper 32768 1 panfrost
gpu_sched 57344 2 etnaviv,panfrost

panfrost module is loaded too.