Tuesday, April 28, 2020

[fedora-arm] Re: CMA on raspberry pi 4

Hi Thomas,

> I have looked into the CMA setting issue a bit. This is what I have found so far.
> The rpi4 needs CMA to be in ZONE_DMA (lower 1GB of memory) as this is the only area that the peripherals on the rpi4 can address.
> The DT sets the allowed range to allocate the CMA from (arch/arm/boot/dts/bcm2711.dtsi#L869), but it seems to not work here. What does work is instead to set the offset manually. I replaced "cma=256MB" with "cma=256M@704M" and then it boots. Note that it has to be 256M instead of 256MB.

Right, because of this it may be able to be set in config.txt, I seem
to remember seeing this somewhere but as we don't support accelerated
graphics on the RPi4 I've not looked. I don't believe the
unaccelerated graphics uses the CMA so for the current situation you
may be able to drop it.

If it's an option to set it in config.txt we need to work out if this
is a general option that works for all the rpi models or if it's
explicitly for the RPi4, if the later we really need to report and get
the bug fixed because we aim to produce generic images which "just
work" across all the rpi devices, anything else just makes it a
support nightmare for people like myself that attempt to support it
and it would be less work just not to support the RPi4 at all TBH.

> Removing the cma option on the command line was known as a workaround. Without that we would fall back to the build config of 64MB cma which was located at offset 0x38000000. This left 64MB at the end of ZONE_DMA, and I chose offset 704M so that those 64MB would still be free. Not sure if that is needed or not. The crashkernel needs to be in ZONE_DMA as well but it seems to be set to 0 size.
> I have tested on 5.7 rc2 from rawhide.
> This probably belongs in a bug report. What would be the correct place to file that? From what I can tell upstream has been tested with cma settings without problems (as long as the requested CMA size can fit in ZONE_DMA). From that it seems like fedora-specific issue. Not sure though.

Not sure what you mean by "upstream" here, we use an almost pure
upstream Linus kernel, if you mean the "Raspberry Pi Foundation" and
their kernel, that's a downstream fork of Linus's kernel. They also
have a lot of other patches and use a different desktop, GNOME from
experience and working with them then RPi upstream GPU maintainer we
worked out GNOME needed the 256Mb allocation but desktops like XFCE
use a lot less (~192Mb if memory serves) and Raspbian uses a light
desktop so I suspect they allocate a lot less.

arm mailing list -- arm@lists.fedoraproject.org
To unsubscribe send an email to arm-leave@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/arm@lists.fedoraproject.org

No comments:

Post a Comment