rpi-config: add configurable CMA low and high water marks
[AGL/meta-agl.git] / meta-agl-bsp / meta-raspberrypi / recipes-bsp / bootfiles / rpi-config_git.bbappend
index ff14d36..9222fd5 100644 (file)
@@ -1,6 +1,14 @@
 DISABLE_OVERSCAN = "1"
 
 do_deploy_append() {
+    if [ "${ENABLE_CMA}" = "1" ] && [ -n "${CMA_LWM}" ]; then
+        sed -i '/#cma_lwm/ c\cma_lwm=${CMA_LWM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+    fi
+
+    if [ "${ENABLE_CMA}" = "1" ] && [ -n "${CMA_HWM}" ]; then
+        sed -i '/#cma_hwm/ c\cma_hwm=${CMA_HWM}' ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
+    fi
+
     echo "avoid_warnings=2" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
     echo "mask_gpu_interrupt0=0x400" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt
     echo "dtoverlay=vc4-kms-v3d-overlay,cma-256" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt