From cbd6423e90b06d9a942f4058b52386188b16e995 2020-11-17 15:51:05 From: g-vidal Date: 2020-11-17 15:51:05 Subject: [PATCH] enble to add graphics acceleration for Pi4 --- diff --git a/bootstrap.d/15-rpi-config.sh b/bootstrap.d/15-rpi-config.sh index 63f556c..2e318b9 100644 --- a/bootstrap.d/15-rpi-config.sh +++ b/bootstrap.d/15-rpi-config.sh @@ -265,7 +265,7 @@ fi echo "${CMDLINE}" > "${BOOT_DIR}/cmdline.txt" # Setup minimal GPU memory allocation size: 16MB (no X) -if [ "$ENABLE_MINGPU" = true ] ; then +if [ "$ENABLE_MINGPU" = true ] && [ "$ENABLE_GR_ACCEL" = false ] ; then echo "gpu_mem=16" >> "${BOOT_DIR}/config.txt" fi @@ -310,6 +310,17 @@ if [ "$ENABLE_SPI" = true ] ; then fi fi +#Enable graphics acceleration for Model 4 +if [ "$RPI_MODEL" = 4 ] && [ "$ENABLE_GR_ACCEL" = true ] ; then + echo "max_framebuffers=2" >> "${BOOT_DIR}/config.txt" + echo "arm_64bit=1" >> "${BOOT_DIR}/config.txt" + echo "cmdline=cmdline.txt" >> "${BOOT_DIR}/config.txt" + echo "dtparam=audio=on" >> "${BOOT_DIR}/config.txt" + echo "gpu_mem=128" >> "${BOOT_DIR}/config.txt" + echo "dtoverlay=vc4-fkms-v3d, cma-128" >> "${BOOT_DIR}/config.txt" +fi + + # Disable RPi2/3 under-voltage warnings if [ -n "$DISABLE_UNDERVOLT_WARNINGS" ] ; then echo "avoid_warnings=${DISABLE_UNDERVOLT_WARNINGS}" >> "${BOOT_DIR}/config.txt" diff --git a/rpi23-gen-image.sh b/rpi23-gen-image.sh index 8ec0198..1393b8e 100755 --- a/rpi23-gen-image.sh +++ b/rpi23-gen-image.sh @@ -191,6 +191,7 @@ CHROOT_SCRIPTS=${CHROOT_SCRIPTS:=""} ENABLE_UBOOT=${ENABLE_UBOOT:=false} UBOOTSRC_DIR=${UBOOTSRC_DIR:=""} ENABLE_FBTURBO=${ENABLE_FBTURBO:=false} +ENABLE_GR_ACCEL=$ENABLE_GR_ACCEL:=true} FBTURBOSRC_DIR=${FBTURBOSRC_DIR:=""} ENABLE_VIDEOCORE=${ENABLE_VIDEOCORE:=false} VIDEOCORESRC_DIR=${VIDEOCORESRC_DIR:=""}