Skip to content

Commit

Permalink
Prepare the rpi for Qt Auto
Browse files Browse the repository at this point in the history
Build qtbase without gbm (because the graphics stack in yocto for rpi is
weird), qtwayland (add rpi support) and rpi-config (redistribute RAM/GPU
memory). Also add a systemd service file for neptune that sets the
proper wayland backend for the pi.

Signed-off-by: Tobias Olausson <tobias.olausson@pelagicore.com>
  • Loading branch information
Tobias Olausson authored and tobsan committed Oct 26, 2017
1 parent b41435c commit 341020a
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ After=dbus-session@root.service
Requires=dbus-session@root.service

[Service]
ExecStart=/usr/bin/appman -r -c /opt/am/sc-config.yaml -c am-config.yaml --dbus session Main.qml -platform eglfs
ExecStart=/usr/bin/appman -r -c am-config.yaml --dbus session -platform eglfs $EXTRA_ARGUMENTS
Restart=on-failure
WorkingDirectory=/opt/neptune
Environment=HOME=/home/%u/
Expand Down
21 changes: 21 additions & 0 deletions layers/b2qt/recipes-qt/automotive/neptune-ui_git.bbappend
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,24 @@ RDEPENDS_${PN}_append = "\
qtwebengine \
qtquickcontrols2 \
"

HAS_CONTAINMENT = "${@bb.utils.contains('DISTRO_FEATURES', 'process-containment', '-c /opt/am/sc-config.yaml', '', d)}"

#
# Add software-container AM config to appman cmdline if we have containment
# support
#
do_install_prepend() {
sed -i -e "s|\$EXTRA_ARGUMENTS|${HAS_CONTAINMENT}|" ${WORKDIR}/neptune.service
}

#
# If we are installing on a rpi3, we need to force wayland to use the broadcom
# driver when starting appman with neptune.
#
do_install_prepend_rpi() {
ENV_LINE="Environment=QT_WAYLAND_HARDWARE_INTEGRATION=brcm"
if ! grep -q "$ENV_LINE" "${WORKDIR}/neptune.service"; then
sed -i -e "/^\[Install\]$/i $ENV_LINE" ${WORKDIR}/neptune.service
fi
}
5 changes: 5 additions & 0 deletions layers/b2qt/recipes-qt/qt5/qtbase_%.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

#
# Remove gbm support if we're building for rpi
#
PACKAGECONFIG_remove_rpi = "gbm"
4 changes: 4 additions & 0 deletions layers/b2qt/recipes-qt/qt5/qtwayland_%.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#
# Make sure we build with support for the broadcom driver if building for rpi
#
PACKAGECONFIG_append_rpi = " wayland-brcm "
8 changes: 8 additions & 0 deletions meta-rpi-extras/recipes-bsp/boot-files/rpi-config_%.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

#
# Reserve 512MB RAM for the GPU if this is the QtAS variant, otherwise 128MB
#
# This checks if the b2qt layer is included.
#

GPU_MEM="${@bb.utils.contains("BBFILE_COLLECTIONS", "b2qt", 512, 128, d)}"

0 comments on commit 341020a

Please sign in to comment.