aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-graphics/wayland/weston-init.bbappend
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-graphics/wayland/weston-init.bbappend')
-rw-r--r--recipes-graphics/wayland/weston-init.bbappend110
1 files changed, 76 insertions, 34 deletions
diff --git a/recipes-graphics/wayland/weston-init.bbappend b/recipes-graphics/wayland/weston-init.bbappend
index 5710e9b5..9d04df23 100644
--- a/recipes-graphics/wayland/weston-init.bbappend
+++ b/recipes-graphics/wayland/weston-init.bbappend
@@ -6,46 +6,88 @@ IMX_REQUIRED_DISTRO_FEATURES_REMOVE:imxgpu2d = "opengl"
IMX_REQUIRED_DISTRO_FEATURES_REMOVE:imxgpu3d = ""
REQUIRED_DISTRO_FEATURES:remove = "${IMX_REQUIRED_DISTRO_FEATURES_REMOVE}"
-SRC_URI:append:mx6sl = " file://weston.config"
-
-# To customize weston.ini, start by setting the desired assignment in weston.ini,
-# commented out. For example:
-# #xwayland=true
-# Then add the assignment to INI_UNCOMMENT_ASSIGNMENTS.
-INI_UNCOMMENT_ASSIGNMENTS:append:imx = " \
- ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland=true', '', d)} \
-"
-INI_UNCOMMENT_ASSIGNMENTS:append:mx8 = " \
- repaint-window=16 \
-"
-INI_UNCOMMENT_ASSIGNMENTS:append:mx8mq = " \
- gbm-format=argb8888 \
- \\[shell\\] \
- size=1920x1080 \
-"
+SRC_URI:append:mx6sl-nxp-bsp = " file://weston.config"
-# FIXME: The 8QM and 8QXP SoCs have better performance without G2D so don't enable it
-# Ideally, this should be seamless and Vivante ought to handle it internally and take the fastest
-# rendering code.
-INI_UNCOMMENT_USE_G2D:imxgpu2d ?= "use-g2d=1"
-INI_UNCOMMENT_USE_G2D:mx8qm = ""
-INI_UNCOMMENT_USE_G2D:mx8qxp = ""
-INI_UNCOMMENT_ASSIGNMENTS:append:imxgpu2d = " \
- ${INI_UNCOMMENT_USE_G2D} \
+PACKAGECONFIG ??= " \
+ no-idle-timeout \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xwayland', '', d)} \
+ ${PACKAGECONFIG_GBM_FORMAT} \
+ ${PACKAGECONFIG_REPAINT_WINDOW} \
+ ${PACKAGECONFIG_SIZE} \
+ ${PACKAGECONFIG_USE_G2D} \
"
-uncomment() {
- if ! grep -q "^#$1" $2 && ! grep -q "^$1" $2; then
- bbwarn "Commented setting '#$1' not found in file $2"
- fi
- sed -i -e 's,^#'"$1"','"$1"',g' $2
-}
+# Mainline BSPs dont support xwayland
+PACKAGECONFIG:remove:use-mainline-bsp = "xwayland"
+
+PACKAGECONFIG_GBM_FORMAT ?= ""
+PACKAGECONFIG_GBM_FORMAT:mx8mq-nxp-bsp ?= "gbm-format"
+PACKAGECONFIG_GBM_FORMAT:mx93-nxp-bsp ?= "gbm-format"
+
+GBM_FORMAT_VALUE:mx8mq-nxp-bsp = "argb8888"
+GBM_FORMAT_VALUE:mx93-nxp-bsp = "argb8888"
+
+PACKAGECONFIG_REPAINT_WINDOW ?= ""
+PACKAGECONFIG_REPAINT_WINDOW:mx8-nxp-bsp ?= "repaint-window"
+PACKAGECONFIG_REPAINT_WINDOW:mx9-nxp-bsp ?= "repaint-window"
+
+PACKAGECONFIG_SIZE ?= ""
+PACKAGECONFIG_SIZE:mx8mq-nxp-bsp ?= "size"
+
+SIZE_VALUE:mx8mq-nxp-bsp = "1920x1080"
+
+HAS_G2D = "false"
+HAS_G2D:imxgpu2d = "true"
+
+PACKAGECONFIG_USE_G2D ?= ""
+PACKAGECONFIG_USE_G2D:imxgpu2d ?= "use-g2d"
+PACKAGECONFIG_USE_G2D:mx8qm-nxp-bsp ?= ""
+PACKAGECONFIG_USE_G2D:mx8qxp-nxp-bsp ?= ""
+PACKAGECONFIG_USE_G2D:mx8dx-nxp-bsp ?= ""
+PACKAGECONFIG_USE_G2D:mx93-nxp-bsp ?= "use-g2d"
+
+USE_G2D_VALUE = "true"
+USE_G2D_VALUE:mx6-nxp-bsp = "1"
+USE_G2D_VALUE:mx7-nxp-bsp = "1"
+
+PACKAGECONFIG[gbm-format] = ",,"
+PACKAGECONFIG[rdp] = ",,"
+PACKAGECONFIG[repaint-window] = ",,"
+PACKAGECONFIG[size] = ",,"
+PACKAGECONFIG[use-g2d] = ",,"
+PACKAGECONFIG[xwayland] = ",,"
do_install:append() {
if [ -f "${WORKDIR}/weston.config" ]; then
install -Dm0755 ${WORKDIR}/weston.config ${D}${sysconfdir}/default/weston
fi
- for assignment in ${INI_UNCOMMENT_ASSIGNMENTS}; do
- uncomment "$assignment" ${D}${sysconfdir}/xdg/weston/weston.ini
- done
+
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'gbm-format', 'yes', 'no', d)}" = "yes" ]; then
+ sed -i -e "/^\[core\]/a gbm-format=${GBM_FORMAT_VALUE}" ${D}${sysconfdir}/xdg/weston/weston.ini
+ fi
+
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'rdp', 'yes', 'no', d)}" = "yes" ]; then
+ sed -i -e "s|^command=${bindir}/weston .*|& --rdp-tls-cert=${sysconfdir}/freerdp/keys/server.crt --rdp-tls-key=${sysconfdir}/freerdp/keys/server.key|" ${D}${sysconfdir}/xdg/weston/weston.ini
+ sed -i -e "/^\[core\]/a modules=screen-share.so" ${D}${sysconfdir}/xdg/weston/weston.ini
+ fi
+
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'repaint-window', 'yes', 'no', d)}" = "yes" ]; then
+ sed -i -e "/^\[core\]/a repaint-window=16" ${D}${sysconfdir}/xdg/weston/weston.ini
+ fi
+
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'size', 'yes', 'no', d)}" = "yes" ]; then
+ sed -i -e "/^\[shell\]/a size=${SIZE_VALUE}" ${D}${sysconfdir}/xdg/weston/weston.ini
+ fi
+
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'use-g2d', 'yes', 'no', d)}" = "yes" ]; then
+ sed -i -e "/^\[core\]/a use-g2d=${USE_G2D_VALUE}" ${D}${sysconfdir}/xdg/weston/weston.ini
+ elif ${HAS_G2D}; then
+ sed -i -e "/^\[core\]/a #use-g2d=${USE_G2D_VALUE}" ${D}${sysconfdir}/xdg/weston/weston.ini
+ fi
+
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "no" ]; then
+ sed -i -e "s/^xwayland=true/#xwayland=true/g" ${D}${sysconfdir}/xdg/weston/weston.ini
+ fi
+
+ sed -i -e 's,@bindir@,${bindir},g' ${D}${sysconfdir}/xdg/weston/weston.ini
}