#980536 raspi-firmware: CMA=64M too small for 4K display and vc4.ko in 5.10 kernel

Package:
raspi-firmware
Source:
raspi-firmware
Submitter:
Ryutaroh Matsumoto
Date:
2023-10-13 07:51:04 UTC
Severity:
wishlist
Tags:
#980536#5
Date:
2021-01-20 09:09:40 UTC
From:
To:
Dear Maintainer,

Linux 5.10.x enables vc4.ko for Raspberry Pi, and it enables
4K resolution on raspi 4B.
When gdm3 display manager starts, it consumes roughly 100 MB of
CMA, as

# grep -i cma /proc/meminfo
CmaTotal:         262144 kB
CmaFree:          143008 kB

When CMA is insufficient, the screen becomes blank and kernel logs
kernel: [drm:vc4_bo_create [vc4]] *ERROR* Failed to allocate from CMA:
which is also discussed at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=968181#60

I am using CMA=256M@128M in /etc/default/raspi-firmware.
The default 64M does not work for high resolution displays and 5.10 kernel.


Best regards, Ryutaroh Matsumoto

#980536#10
Date:
2021-04-05 18:48:29 UTC
From:
To:
tags -1 wontfix
severity -1 wishlist
thanks

Hi,

There are Raspberries in use with memory ranging from 256M (512M
currently for sale) to 8G. I do not want to ship a package that's
unusable in all of the 0 and 1 families.

As you mention in your bug report, it's easy to do this fix in
/etc/default/raspi-firmware -- that's the reason for it to exist!

Please note /etc/default/raspi-firmware discourages setting a CMA in
the RPi4 family. I don't have the needed hardware (i.e. 4K monitor) to
test this, but I do remember having unbootable RPi4 when I had CMA
set.

I'm tagging this bug as "wontfix", at least for the time being. I
think it's best for all users to be able to boot (and then tweak as
you did) than to make it more difficult for some users to get to basic
system functionality.

#980536#19
Date:
2023-10-13 07:36:15 UTC
From:
To:
Hi Gunnar,

on a RPi4B with 8G RAM and two Full HD displays connected I am running
bookworm. After upgrading firefox (102.15.1esr-1~deb12u1 to
115.3.0esr-1~deb12u1) recently, it failed to start and threw multiply:

```
DRM_IOCTL_MODE_CREATE_DUMB failed: Cannot allocate memory
Failed to create scanout resource
```

After setting CMA=128M in /etc/default/raspi-firmware, update-initramfs
and reboot firefox started properly and is usable.

```
# grep -i cma /proc/meminfo
CmaTotal:         131072 kB
CmaFree:           48612 kB
```

And if I run mpv (with CMA=128M) in addition to firefox, I occasionally
also get the above error.

I suggest removing the notice in /etc/default/raspi-firmware concerning
RPi4, or referring to this bug, and maybe updating other docs and the
image when you find time, because I guess firefox is a frequently used
application on this device and if it fails, it would push off users.

Cheers,
ibu