gpu frequency change of flipping frames bug, which results flipping frames and lima job timout
gpu frequency change of flipping frames bug, which results flipping frames and lima job timout
device is pinephone, practically all gnu/linux variants with phosh and plasma are affected. however, frequency bug happens only in some pinephones. in my tests, in 1.2a hw series. it may not be because of 1.2a hardware, it might be because of related manufacturing series.
typical result:
https://barrelmem.s3.eu-north-1.amazonaws.com/flippingframesbug/VID_20230301_121914-mobian-freq.mp4
how to replicate:
run something on a screen, maybe glxgears. then on a background, run frequency changing script. crash or jams will happen in minutes.
echo 432000000 > /sys/class/devfreq/1c40000.gpu/min_freq
echo 432000000 > /sys/class/devfreq/1c40000.gpu/max_freq
while true
do echo 312000000 > /sys/class/devfreq/1c40000.gpu/max_freq
echo 432000000 > /sys/class/devfreq/1c40000.gpu/max_freq
done
device: pinephone 3GB, hw 1.2a.
software: mobian
linux-image-6.1-sunxi 6.1.12+sunxi64-1
mesa-va-drivers 22.3.3-1
root@mobian:~# inxi -GSC -xx
System:
Host: mobian Kernel: 6.1-sunxi64 arch: aarch64 bits: 64 compiler: gcc v: 12.2.0
Console: pty pts/3 DM: greetd Distro: Debian GNU/Linux bookworm/sid
CPU:
Info: quad core model: N/A variant: cortex-a53 bits: 64 type: MCP arch: ARMv8 rev: 4
Speed (MHz): avg: 1152 min/max: 648/1152 cores: 1: 1152 2: 1152 3: 1152 4: 1152 bogomips: N/A
Features: Use -f option to see features
Graphics:
Device-1: sun50i-a64-mali driver: lima v: kernel bus-ID: N/A chip-ID: allwinner:1c40000
Device-2: sun50i-a64-dw-hdmi driver: sun8i_dw_hdmi v: N/A bus-ID: N/A
chip-ID: allwinner:1ee0000
Device-3: sun50i-a64-display-engine driver: sun4i_drm v: N/A bus-ID: N/A
chip-ID: allwinner:display-engine
Device-4: sun9i-a80-hdmi-audio driver: N/A bus-ID: N/A chip-ID: allwinner:sound_hdmi
Display: server: Xwayland v: 22.1.8 compositor: phoc driver: N/A note: X driver n/a
tty: 213x52
Monitor-1: DSI-1 size-res: N/A in console
API: OpenGL Message: GL data unavailable in console for root.
root@mobian:~#
some logs:
[ 6165.772121] lima 1c40000.gpu: l2 cache wait command timeout
[ 6166.057984] [drm:lima_sched_timedout_job] *ERROR* lima job timeout
[ 6166.064362] lima 1c40000.gpu: pp task error 0 int_state=0 status=5
[ 6166.070658] lima 1c40000.gpu: pp task error 1 int_state=0 status=5
[ 6166.283431] [drm:lima_sched_timedout_job] *ERROR* lima job timeout
[ 6166.291031] lima 1c40000.gpu: gp task error int_state=0 status=a
https://forum.pine64.org/showthread.php?tid=17771&highlight=flipping+frames
workaround:
# udev rule. this prevent flipping frames bug
# example file location /lib/udev/rules.d/98-preventflippingbug.rules
# powersaving part
KERNEL=="1c40000.gpu", SUBSYSTEM=="platform", DRIVER=="lima", ATTR{power/autosuspend_delay_ms}="-1"
KERNEL=="1c40000.gpu", SUBSYSTEM=="platform", DRIVER=="lima", ATTR{power/control}="on"
# frequency part, may not be needed
KERNEL=="1c40000.gpu", SUBSYSTEM=="devfreq", ATTR{min_freq}="432000000"
KERNEL=="1c40000.gpu", SUBSYSTEM=="devfreq", ATTR{max_freq}="432000000"
i will post another bug, which is related to this. i call it powersaving part of the bug. but it has some differences. like, it affects all pinephones and is harder to replicate. added link #8415 .
i put this bug report, because something weird is going on. some pinephones have this and other pinephones don't. is frequency change reliable? can someone give additional information about this? is it hardware or software dependent?