diff options
author | Tom Hochstein <tom.hochstein@nxp.com> | 2023-05-18 05:26:35 -0700 |
---|---|---|
committer | Tom Hochstein <tom.hochstein@nxp.com> | 2023-05-18 05:26:35 -0700 |
commit | 47f0410be104d69c779f9e697b86eac9eb366a12 (patch) | |
tree | 4eb8db09b63ac753a78ef53092dc967feb49adfa /recipes-graphics/wayland/weston-init.bbappend | |
parent | 011aa5617d287aa83fff549494a63c4baad0c171 (diff) | |
download | meta-freescale-47f0410be104d69c779f9e697b86eac9eb366a12.tar.gz |
weston-init: Rework weston.ini configuration
The main recipe has a different mechanism for customizing weston.ini.
Rework our mechanism to follow.
Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
Diffstat (limited to 'recipes-graphics/wayland/weston-init.bbappend')
-rw-r--r-- | recipes-graphics/wayland/weston-init.bbappend | 98 |
1 files changed, 51 insertions, 47 deletions
diff --git a/recipes-graphics/wayland/weston-init.bbappend b/recipes-graphics/wayland/weston-init.bbappend index a742bb86..fa088b6f 100644 --- a/recipes-graphics/wayland/weston-init.bbappend +++ b/recipes-graphics/wayland/weston-init.bbappend | |||
@@ -8,64 +8,68 @@ REQUIRED_DISTRO_FEATURES:remove = "${IMX_REQUIRED_DISTRO_FEATURES_REMOVE}" | |||
8 | 8 | ||
9 | SRC_URI:append:mx6sl-nxp-bsp = " file://weston.config" | 9 | SRC_URI:append:mx6sl-nxp-bsp = " file://weston.config" |
10 | 10 | ||
11 | # To customize weston.ini, start by setting the desired assignment in weston.ini, | 11 | PACKAGECONFIG ??= " \ |
12 | # commented in. For example: | 12 | no-idle-timeout \ |
13 | # xwayland=true | 13 | rdp \ |
14 | # Then add the assignment to INI_COMMENT_ASSIGNMENTS. | 14 | ${PACKAGECONFIG_GBM_FORMAT} \ |
15 | # | 15 | ${PACKAGECONFIG_REPAINT_WINDOW} \ |
16 | # commented out. For example: | 16 | ${PACKAGECONFIG_SIZE} \ |
17 | # #xwayland=true | 17 | ${PACKAGECONFIG_USE_G2D} \ |
18 | # Then add the assignment to INI_UNCOMMENT_ASSIGNMENTS. | ||
19 | INI_COMMENT_ASSIGNMENTS:append:imx-mainline-bsp = " \ | ||
20 | xwayland=true \ | ||
21 | " | 18 | " |
22 | 19 | ||
23 | INI_UNCOMMENT_ASSIGNMENTS:append:mx8-nxp-bsp = " \ | 20 | PACKAGECONFIG_GBM_FORMAT ?= "" |
24 | repaint-window=16 \ | 21 | PACKAGECONFIG_GBM_FORMAT:mx8mq-nxp-bsp ?= "gbm-format" |
25 | " | ||
26 | INI_UNCOMMENT_ASSIGNMENTS:append:mx8mq-nxp-bsp = " \ | ||
27 | gbm-format=argb8888 \ | ||
28 | \\[shell\\] \ | ||
29 | size=1920x1080 \ | ||
30 | " | ||
31 | 22 | ||
32 | # FIXME: The 8QM and 8QXP SoCs have better performance without G2D so don't enable it | 23 | GBM_FORMAT_VALUE:mx8mq-nxp-bsp = "argb8888" |
33 | # Ideally, this should be seamless and Vivante ought to handle it internally and take the fastest | ||
34 | # rendering code. | ||
35 | INI_UNCOMMENT_USE_G2D ?= "" | ||
36 | INI_UNCOMMENT_USE_G2D:imxgpu2d ?= "use-g2d=1" | ||
37 | INI_UNCOMMENT_USE_G2D:mx8qm-nxp-bsp ?= "" | ||
38 | INI_UNCOMMENT_USE_G2D:mx8qxp-nxp-bsp ?= "" | ||
39 | INI_UNCOMMENT_USE_G2D:mx8dx-nxp-bsp ?= "" | ||
40 | INI_UNCOMMENT_ASSIGNMENTS:append = " \ | ||
41 | ${INI_UNCOMMENT_USE_G2D} \ | ||
42 | " | ||
43 | 24 | ||
44 | comment() { | 25 | PACKAGECONFIG_REPAINT_WINDOW ?= "" |
45 | if ! grep -q "^#$1" $2 && ! grep -q "^$1" $2; then | 26 | PACKAGECONFIG_REPAINT_WINDOW:mx8-nxp-bsp ?= "repaint-window" |
46 | bbwarn "Commented setting '#$1' not found in file $2" | 27 | PACKAGECONFIG_REPAINT_WINDOW:mx9-nxp-bsp ?= "repaint-window" |
47 | fi | ||
48 | sed -i -e 's,^'"$1"',#'"$1"',g' $2 | ||
49 | } | ||
50 | 28 | ||
51 | uncomment() { | 29 | PACKAGECONFIG_SIZE ?= "" |
52 | if ! grep -q "^#$1" $2 && ! grep -q "^$1" $2; then | 30 | PACKAGECONFIG_SIZE:mx8mq-nxp-bsp ?= "size" |
53 | bbwarn "Commented setting '#$1' not found in file $2" | 31 | |
54 | fi | 32 | SIZE_VALUE:mx8mq-nxp-bsp = "1920x1080" |
55 | sed -i -e 's,^#'"$1"','"$1"',g' $2 | 33 | |
56 | } | 34 | PACKAGECONFIG_USE_G2D ?= "" |
35 | PACKAGECONFIG_USE_G2D:imxgpu2d ?= "use-g2d" | ||
36 | PACKAGECONFIG_USE_G2D:mx8qm-nxp-bsp ?= "" | ||
37 | PACKAGECONFIG_USE_G2D:mx8qxp-nxp-bsp ?= "" | ||
38 | PACKAGECONFIG_USE_G2D:mx8dx-nxp-bsp ?= "" | ||
39 | |||
40 | PACKAGECONFIG[gbm-format] = ",," | ||
41 | PACKAGECONFIG[rdp] = ",," | ||
42 | PACKAGECONFIG[repaint-window] = ",," | ||
43 | PACKAGECONFIG[size] = ",," | ||
44 | PACKAGECONFIG[use-g2d] = ",," | ||
57 | 45 | ||
58 | do_install:append() { | 46 | do_install:append() { |
59 | if [ -f "${WORKDIR}/weston.config" ]; then | 47 | if [ -f "${WORKDIR}/weston.config" ]; then |
60 | install -Dm0755 ${WORKDIR}/weston.config ${D}${sysconfdir}/default/weston | 48 | install -Dm0755 ${WORKDIR}/weston.config ${D}${sysconfdir}/default/weston |
61 | fi | 49 | fi |
62 | 50 | ||
63 | for assignment in ${INI_COMMENT_ASSIGNMENTS}; do | 51 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'gbm-format', 'yes', 'no', d)}" = "yes" ]; then |
64 | comment "$assignment" ${D}${sysconfdir}/xdg/weston/weston.ini | 52 | sed -i -e "/^\[core\]/a gbm-format=${GBM_FORMAT_VALUE}" ${D}${sysconfdir}/xdg/weston/weston.ini |
65 | done | 53 | fi |
54 | |||
55 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'rdp', 'yes', 'no', d)}" = "yes" ]; then | ||
56 | 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 | ||
57 | sed -i -e "/^\[core\]/a modules=screen-share.so" ${D}${sysconfdir}/xdg/weston/weston.ini | ||
58 | fi | ||
59 | |||
60 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'repaint-window', 'yes', 'no', d)}" = "yes" ]; then | ||
61 | sed -i -e "/^\[core\]/a repaint-window=16" ${D}${sysconfdir}/xdg/weston/weston.ini | ||
62 | fi | ||
63 | |||
64 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'size', 'yes', 'no', d)}" = "yes" ]; then | ||
65 | sed -i -e "/^\[shell\]/a size=${SIZE_VALUE}" ${D}${sysconfdir}/xdg/weston/weston.ini | ||
66 | fi | ||
67 | |||
68 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'use-g2d', 'yes', 'no', d)}" = "yes" ]; then | ||
69 | sed -i -e "/^\[core\]/a use-g2d=1" ${D}${sysconfdir}/xdg/weston/weston.ini | ||
70 | else | ||
71 | sed -i -e "/^\[core\]/a #use-g2d=1" ${D}${sysconfdir}/xdg/weston/weston.ini | ||
72 | fi | ||
66 | 73 | ||
67 | for assignment in ${INI_UNCOMMENT_ASSIGNMENTS}; do | ||
68 | uncomment "$assignment" ${D}${sysconfdir}/xdg/weston/weston.ini | ||
69 | done | ||
70 | sed -i -e 's,@bindir@,${bindir},g' ${D}${sysconfdir}/xdg/weston/weston.ini | 74 | sed -i -e 's,@bindir@,${bindir},g' ${D}${sysconfdir}/xdg/weston/weston.ini |
71 | } | 75 | } |