Xorg is slooow on the RPi4

I have RPi4B and there’s no such an issue with fps in glxgears (over 1200 fps!):


It is slightly overclocked (if you would call 1,5→1,6 GHz an overclock), but with no overvoltage set.

Is this an issue then with 4K resolution only? Have you tried setting your monitor to lower resolutions and checked if there’s a fps gain? As you can see, I’m on 1440x900 resolution – quite small comparing to 4K. If it affects also the lower resolutions modes on your Pi, you could try my tips below.

What is your cmdline.txt? Did you set usbhid.mousepoll to 0 (if yes, better try higher values, I personally recommend 8). Also, you could try disabling the compositor (that’s all thing I do on my RPi after I installed on it Manjaro – except setting the usbhid.mousepoll since my mouse works fine with the default values). I know from practise that combination of vblank_mode=auto in XFCE on the Manjaro ARM + high mouse polling makes Pi quite slow.

Sorry if I’m saying the same I were on the old forum. Even if you’re using Plasma Desktop, setting mouse-polling might give you some fps up as it did for me on XFCE (and even on Raspberry Pi OS as I checked later).

Update: I had some issues with performance, even with a 1920x1080 HDMI monitor and an annoying momentary blanking of the entire screen, when using Chromium and the V3D driver. However, after switching to the mainline kernel, the V3D drivers are working quite well for me now. So for my home setup, I have switched to the V3D driver.

I will try to test on a 4K monitor tomorrow, when I am back in the office. :fingers_crossed:

Unfortunately the test on a 4K monitor produced the same poor performance… so for 4K monitors, xf86-video-fbturbo-git driver is still the better option. 25 fps with glxgears on a 4K, very sluggish performance, just not very usable.

With the 5.10-rc2 kernel, the mesa-git drivers and the following settings, I perceive slightly better performance at 4K and fps is closer to 30. glxgears did not indicate any change in performance between gpu_mem=64 up to 512 in my limited testing. At 1024, my RPi4 did not boot.

gpu_mem=64
dtoverlay=vc4-kms-v3d-pi4
max_framebuffers=2
over_voltage=6
arm_freq=2000
gpu_freq=750

While not a huge step up, it is progress and at these low fps, each one counts. I wonder if they will ever make it to 60 fps @4K with the VC4?

I forgot to mention that I was getting spikes of almost double on a webgl test page I use with the 5.10-rc4 kernel using firefox.

http://webglsamples.org/aquarium/aquarium.html

It won’t. Where it shows up where it comes in handy is playing hi res videos but that is with fbturbo. 64m is fine using v3d as it uses cma 256M (by default) for video. Any more mem allocated for gpu is a waste and does not get used when using V3D.

I get between 5 and 8 fps depending how large I make the window with 500 fish.

lol, and 1 fps with Chromium.

After using this setup a little more, I think this is just the performance improvement needed to make accelerated 4K usable for the desktop. I hoped for more of course, but this is a nice improvement. Not great, it still lags some but less so. Now the user experience just feels slowish but it is smooth enough for general desktop use.

Addition
I switched back to my 1920x1080 HDMI monitor and performance is snappy and glxgears shows a steady 60 fps. I only get 10 fps with the webGL demo but it is smooth.

@SpacingBat3 I think technically this issue exists for all resolutions, at 4K the issue is more noticeable. I have not made any attempts to alter the mousepoll or vblank_mode. I am not concerned with fps exactly, I need a smooth desktop user experience at 4K and fbturbo provides that well enough. However, 3D acceleration would be a nice bonus. And it appears good progress has been made with the recent changes.