When setting up Kodi under Arch Linux ARM running on Raspberry Pi 3, I encountered this error, which crashed the graphical environment right from the start:
[drm:vc4_bo_create [vc4]] ERROR Failed to allocate from CMA:
...
After some searching, I ran into an issue thread, where it was advised to increase the CMA memory (as a workaround that seems to just be the actual fix). You need to add ‘cma=256M’ to the kernel boot parameters. But how do you do that?
# Run as root...
# dependencies
pacman -S uboot-tools
# modify the kernel boot parameters
cd /boot
vim boot.txt # append cma=256M to the line with boot params
./mkscr
reboot
Before this fix, I had only 64 MB of CMA. This wasn’t enough. To check that this worked:
if the cma parameter is present and /proc/meminfo
cat /proc/cmdline
# should contain cma=256M
cat /proc/meminfo | grep Cma
# should say CmaTotal: 262144 kB
Now Kodi finally starts!
…though there are still some problems with the graphics driver (video doesn’t play, random switching to the console and back).
As it turns out, using the AArch64 version of Arch Linux ARM for Kodi is not the best option. Switching to the ARMv7 version helped a lot, everything worked from the start.