summaryrefslogtreecommitdiff
path: root/recipes-graphics/wayland/weston-init.bbappend
blob: 5de9d50430fd5bd9a9fd68a1370519283ec57480 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
INI_UNCOMMENT_ASSIGNMENTS_append_mx8 = " \
    use-g2d=1 \
"


uncomment() {
    # already uncommented, do nothing
    if ! (grep "^$1" $2); then
        if ! (grep "^#$1" $2); then
            bbfatal "Commented setting '#$1' not found in file $2"
        fi
        sed -i -e 's,^#'"$1"','"$1"',g' $2
    fi
}


configure_noidle() {
    sed -i '/idle-time=0/d' ${D}${sysconfdir}/xdg/weston/weston.ini
    sed -i '/^\[core\]/a idle-time=0' ${D}${sysconfdir}/xdg/weston/weston.ini
}

# Prevent weston from going to sleep
do_install_append_upstream() {
    configure_noidle
}

configure_pixman() {
    sed -i '/use-pixman=true/d' ${D}${sysconfdir}/xdg/weston/weston.ini
    sed -i '/^\[core\]/a use-pixman=true' ${D}${sysconfdir}/xdg/weston/weston.ini
}

# With upstream weston and modules without GPU weston uses a lot of
# cpu time and becomes very unresponsive. Setting use-pixman=true works
# around it.
do_install_append_upstream_colibri-imx6ull() {
    configure_pixman
}

do_install_append_upstream_colibri-imx6ull-emmc() {
    configure_pixman
}

do_install_append_upstream_colibri-imx7() {
    configure_pixman
}

do_install_append_upstream_colibri-imx7-emmc() {
    configure_pixman
}

# openembedded-core commit 4efdcc1090 ("weston: Use systemd notify,")
# forces systemd-notify which in our setup does not work. Uncomment the
# relevant lines for now.
do_install_append_tdx() {
    sed -i 's/\(Type=notify\)/# \1/' ${D}${systemd_system_unitdir}/weston@.service
    sed -i 's/\(NotifyAccess=all\)/# \1/' ${D}${systemd_system_unitdir}/weston@.service
}