Skip to content

libcamera and cma allocation

99degree edited this page May 30, 2024 · 1 revision

Since yavta is for testing only. Apps like gcam can do better. Nearly all of those app are depending on libcamera. Once pmos boots up, qcam kind of app will acquire CMA memory for frame capture.

CMA allocation

Here is an example of CMA allocation in device tree. The first one is reserved for qcom isp for fail-safe. the one leading "linux,cma" is the one needed. As stated, allocating 64MB ram for camera is needed. Tests show 32MB is not enough for libcamera dma-heap use.

&reserved_memory {
		camera_mem: camera_region@8e400000 {
				compatible = "removed-dma-pool";
				no-map;
				reg = <0x00 0x8e400000 0x00 0x500000>;
		};

		linux,cma {
				compatible = "shared-dma-pool";
				reusable;
				size = <0 0x4000000>;
				alignment = <0 0x4000>;
				linux,cma-default;
		};
};