diff options
Diffstat (limited to 'meta-agl-core/recipes-graphics')
37 files changed, 1008 insertions, 0 deletions
diff --git a/meta-agl-core/recipes-graphics/libsdl2/libsdl2_%.bbappend b/meta-agl-core/recipes-graphics/libsdl2/libsdl2_%.bbappend new file mode 100644 index 000000000..48e50788e --- /dev/null +++ b/meta-agl-core/recipes-graphics/libsdl2/libsdl2_%.bbappend @@ -0,0 +1 @@ +require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'libsdl2_aglcore.inc', '', d)} diff --git a/meta-agl-core/recipes-graphics/libsdl2/libsdl2_aglcore.inc b/meta-agl-core/recipes-graphics/libsdl2/libsdl2_aglcore.inc new file mode 100644 index 000000000..7652e1843 --- /dev/null +++ b/meta-agl-core/recipes-graphics/libsdl2/libsdl2_aglcore.inc @@ -0,0 +1,3 @@ +# Make sure opengl is disabled, as using wayland implies gles2 in the +# libsdl2 PACKAGECONFIG definitions. +PACKAGECONFIG:remove = "opengl" diff --git a/meta-agl-core/recipes-graphics/rba/librba_1.0.bb b/meta-agl-core/recipes-graphics/rba/librba_1.0.bb new file mode 100644 index 000000000..e8b1e0dbc --- /dev/null +++ b/meta-agl-core/recipes-graphics/rba/librba_1.0.bb @@ -0,0 +1,24 @@ +SUMMARY = "RBA" +DESCRIPTION = "Rule Based Arbitrator decides which of the content to display \ +when a large number of contents to be displayed on the cockpit display device \ +(CID, meter, HUD, etc.) occur simultaneously under a certain rule (arbitration)" + +SECTION = "libs" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=13afa517927767fe9b7a65818a02bd8f" + +INHIBIT_PACKAGE_DEBUG_SPLIT = "1" + +SRC_URI = "git://gerrit.automotivelinux.org/gerrit/staging/rba;protocol=https;branch=master" +SRCREV = "87c0278dfbcf0953330330c28a8d48636dd4df7e" + +S = "${WORKDIR}/git" + +inherit pkgconfig cmake + +FILES:${PN} = "${libdir}/" +FILES:${PN}-dev = "${libdir}/pkgconfig/librba.pc \ + ${includedir}/ \ + " +INSANE_SKIP:${PN} += "dev-so" +INSANE_SKIP:${PN}-dev += "dev-elf" diff --git a/meta-agl-core/recipes-graphics/rba/rba-config.bb b/meta-agl-core/recipes-graphics/rba/rba-config.bb new file mode 100644 index 000000000..cbed9df0c --- /dev/null +++ b/meta-agl-core/recipes-graphics/rba/rba-config.bb @@ -0,0 +1,15 @@ +SUMMARY = "Rule Based Arbitrator Model required for RBA policy compositor." +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +SRC_URI = "file://RBAModel.json" + +S = "${WORKDIR}" + +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +do_install:append() { + install -d ${D}/${sysconfdir}/rba + install -m 0644 ${WORKDIR}/RBAModel.json ${D}/${sysconfdir}/rba +} diff --git a/meta-agl-core/recipes-graphics/rba/rba-config/RBAModel.json b/meta-agl-core/recipes-graphics/rba/rba-config/RBAModel.json new file mode 100644 index 000000000..753a9ed86 --- /dev/null +++ b/meta-agl-core/recipes-graphics/rba/rba-config/RBAModel.json @@ -0,0 +1,320 @@ +{ + "root":{ + "model":"", + "template":"02.00.00", + "areas":[ + { + "name":"ApplicationArea", + "visibility":-1, + "arbitrationPolicy":"DEFAULT", + "zorder":1, + "size":[ + { + "name":"ApplicationSize", + "width":1080, + "height":1488 + } + ] + }, + { + "name":"ShortcutIconArea", + "visibility":-1, + "arbitrationPolicy":"DEFAULT", + "zorder":0, + "size":[ + { + "name":"ShortcutIconSize", + "width":1080, + "height":216 + } + ] + } + ], + "viewcontents":[ + { + "name":"launcher", + "loserType":"NEVER_GIVEUP", + "size":[ + { + "name":"ApplicationSize:Area", + "width":1080, + "height":1488 + } + ], + "states":[ + { + "name":"NORMAL", + "priority":10 + } + ], + "allocatable":[ + "ApplicationArea:Area" + ] + }, + { + "name":"dashboard", + "loserType":"NEVER_GIVEUP", + "size":[ + { + "name":"ApplicationSize", + "width":1080, + "height":1488 + } + ], + "states":[ + { + "name":"NORMAL", + "priority":10 + } + ], + "allocatable":[ + "ApplicationArea:Area" + ] + }, + { + "name":"hvac", + "loserType":"NEVER_GIVEUP", + "size":[ + { + "name":"ApplicationSize:Area", + "width":1080, + "height":1488 + } + ], + "states":[ + { + "name":"NORMAL", + "priority":10 + } + ], + "allocatable":[ + "ApplicationArea:Area" + ] + }, + { + "name":"mediaplayer", + "loserType":"NEVER_GIVEUP", + "size":[ + { + "name":"ApplicationSize:Area", + "width":1080, + "height":1488 + } + ], + "states":[ + { + "name":"NORMAL", + "priority":10 + } + ], + "allocatable":[ + "ApplicationArea:Area" + ] + }, + { + "name":"messaging", + "loserType":"NEVER_GIVEUP", + "size":[ + { + "name":"ApplicationSize:Area", + "width":1080, + "height":1488 + } + ], + "states":[ + { + "name":"NORMAL", + "priority":10 + } + ], + "allocatable":[ + "ApplicationArea:Area" + ] + }, + { + "name":"mixer", + "loserType":"NEVER_GIVEUP", + "size":[ + { + "name":"ApplicationSize:Area", + "width":1080, + "height":1488 + } + ], + "states":[ + { + "name":"NORMAL", + "priority":10 + } + ], + "allocatable":[ + "ApplicationArea:Area" + ] + }, + { + "name":"navigation", + "loserType":"NEVER_GIVEUP", + "size":[ + { + "name":"ApplicationSize:Area", + "width":1080, + "height":1488 + } + ], + "states":[ + { + "name":"NORMAL", + "priority":10 + } + ], + "allocatable":[ + "ApplicationArea:Area" + ] + }, + { + "name":"phone", + "loserType":"NEVER_GIVEUP", + "size":[ + { + "name":"ApplicationSize:Area", + "width":1080, + "height":1488 + } + ], + "states":[ + { + "name":"NORMAL", + "priority":10 + } + ], + "allocatable":[ + "ApplicationArea:Area" + ] + }, + { + "name":"poi", + "loserType":"NEVER_GIVEUP", + "size":[ + { + "name":"ApplicationSize:Area", + "width":1080, + "height":1488 + } + ], + "states":[ + { + "name":"NORMAL", + "priority":10 + } + ], + "allocatable":[ + "ApplicationArea:Area" + ] + }, + { + "name":"radio", + "loserType":"NEVER_GIVEUP", + "size":[ + { + "name":"ApplicationSize:Area", + "width":1080, + "height":1488 + } + ], + "states":[ + { + "name":"NORMAL", + "priority":10 + } + ], + "allocatable":[ + "ApplicationArea:Area" + ] + }, + { + "name":"settings", + "loserType":"NEVER_GIVEUP", + "size":[ + { + "name":"ApplicationSize:Area", + "width":1080, + "height":1488 + } + ], + "states":[ + { + "name":"NORMAL", + "priority":10 + } + ], + "allocatable":[ + "ApplicationArea:Area" + ] + }, + { + "name":"taskmanager", + "loserType":"NEVER_GIVEUP", + "size":[ + { + "name":"ApplicationSize:Area", + "width":1080, + "height":1488 + } + ], + "states":[ + { + "name":"NORMAL", + "priority":10 + } + ], + "allocatable":[ + "ApplicationArea:Area" + ] + }, + { + "name":"unknown_app", + "loserType":"NEVER_GIVEUP", + "size":[ + { + "name":"ApplicationSize:Area", + "width":1080, + "height":1488 + } + ], + "states":[ + { + "name":"NORMAL", + "priority":10 + } + ], + "allocatable":[ + "ApplicationArea:Area" + ] + } + ], + "displays":[ + { + "name":"SampleDisplay", + "size":{ + "name":"FULLSCREEN", + "width":1080, + "height":1920 + }, + "PositionContainer":[ + { + "x":0, + "y":0, + "basePoint":"LEFT_TOP", + "areaReference":"ShortcutIconArea" + }, + { + "x":0, + "y":216, + "basePoint":"LEFT_TOP", + "areaReference":"ApplicationArea" + } + ] + } + ] + } +} diff --git a/meta-agl-core/recipes-graphics/wayland/Readme.weston-ini-conf b/meta-agl-core/recipes-graphics/wayland/Readme.weston-ini-conf new file mode 100644 index 000000000..ee75c7335 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/Readme.weston-ini-conf @@ -0,0 +1,43 @@ +##Generate a weston.ini file: + +To modify any of the default sections (core, shell), add a +do_configure() function to your bbappend, using machine (e.g. h3ulcb) +overrides (i.e. use the MACHINE name where "machine" is used below): + +''' +do_configure:machine() { + echo repaint-window=34 >> ${WORKDIR}/core.cfg + + echo transition-duration=300 >> ${WORKDIR}/ivishell.cfg + echo cursor-theme=default >> ${WORKDIR}/ivishell.cfg +} +''' +or: +''' +do_configure:machine() { + sed -i -e 's/drm-backend/fbdev-backend/' ${WORKDIR}/core.cfg +} +''' + +To add new non-display sections, just list them in SRC_URI and WESTON_FRAGMENTS: +''' +FILESEXTRAPATHS:prepend:machine := "${THISDIR}/${PN}:" + +SRC_URI:append:machine = " file://foo.cfg" +WESTON_FRAGMENTS:append:machine = " foo" + +''' + +To change the display, for example from the default assumption of an +HDMI-1-A connected screen that needs to be rotated 270 degrees to one +that is rotated 90 degrees, redefine the WESTON_DISPLAYS variable: + +''' +WESTON_DISPLAYS:machine = "hdmi-a-1-90" +''' + +Note that the weston-ini-conf recipe automatically generates a landscape +orientation version of weston.ini by replacing 90/270 degree rotation +fragments for HDMI-A-1 and the virtual output into 180 and 0 degrees, +respectively. This landscape configuration can be used in an image by +pulling in weston-ini-conf-landscape instead of weston-ini-conf. diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init.bb b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init.bb new file mode 100644 index 000000000..d8baf91f9 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init.bb @@ -0,0 +1,61 @@ +SUMMARY = "Startup systemd unit for the AGL Wayland compositor" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +inherit systemd + +# Reuse include file from upstream weston since we have the same requirements +require recipes-graphics/wayland/required-distro-features.inc + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +SRC_URI = "file://agl-compositor.service \ + file://agl-compositor.socket \ + file://agl-compositor-autologin \ + file://agl-compositor.conf.in \ +" + +S = "${WORKDIR}" + +AGL_COMPOSITOR_ARGS ?= " --config ${sysconfdir}/xdg/weston/weston.ini --idle-time=0" +AGL_COMPOSITOR_USE_PIXMAN ??= "0" + +AGL_COMPOSITOR_ARGS:append = " ${@bb.utils.contains("DISTRO_FEATURES", "agl-devel", " --debug", "",d)}" +AGL_COMPOSITOR_ARGS:append = " ${@bb.utils.contains("WESTON_USE_PIXMAN", "1", " --use-pixman", "",d)}" + +do_install() { + # Install systemd service + install -D -p -m0644 ${WORKDIR}/agl-compositor.service ${D}${systemd_system_unitdir}/agl-compositor.service + install -D -p -m0644 ${WORKDIR}/agl-compositor.socket ${D}${systemd_system_unitdir}/agl-compositor.socket + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then + install -D -p -m0644 ${WORKDIR}/agl-compositor-autologin ${D}${sysconfdir}/pam.d/agl-compositor-autologin + fi + + # Install systemd service drop-in with extra configuration + files=agl-compositor.conf.in + for f in ${files}; do + g=${f%.in} + if [ "${f}" != "${g}" ]; then + sed -e "s,@AGL_COMPOSITOR_ARGS@,${AGL_COMPOSITOR_ARGS},g" \ + ${WORKDIR}/${f} > ${WORKDIR}/${g} + fi + done + install -d ${D}${systemd_system_unitdir}/agl-compositor.service.d + install -m644 ${WORKDIR}/agl-compositor.conf ${D}/${systemd_system_unitdir}/agl-compositor.service.d/agl-compositor.conf +} + +FILES:${PN} += "\ + ${systemd_system_unitdir}/agl-compositor.service \ + ${systemd_system_unitdir}/agl-compositor.socket \ + ${systemd_system_unitdir}/agl-compositor.service.d \ + ${sysconfdir}/default/agl-compositor \ + ${sysconfdir}/pam.d/ \ + " + +CONFFILES:${PN} += "${sysconfdir}/default/agl-compositor" + +RDEPENDS:${PN} = "agl-users agl-compositor weston-ini" + +RCONFLICTS:${PN} = "weston-init" + +SYSTEMD_SERVICE:${PN} = "agl-compositor.service agl-compositor.socket" diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor-autologin b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor-autologin new file mode 100644 index 000000000..f6e6d106d --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor-autologin @@ -0,0 +1,11 @@ +auth required pam_nologin.so +auth required pam_unix.so try_first_pass nullok + +account required pam_nologin.so +account required pam_unix.so + +session required pam_env.so +session required pam_unix.so +-session optional pam_systemd.so type=wayland class=user desktop=weston +-session optional pam_loginuid.so + diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf.in b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf.in new file mode 100644 index 000000000..2918c410c --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf.in @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart=/usr/bin/agl-compositor @AGL_COMPOSITOR_ARGS@ diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service new file mode 100644 index 000000000..4ee14de27 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service @@ -0,0 +1,72 @@ +# This is a system unit for launching AGL compositor with auto-login as the +# user configured here. +# +# AGL compositor and Weston must be built with systemd support, and your +# weston.ini must load the plugin systemd-notify.so. +# +# Attention: +# If you will add new tty dependency setting, you need to update +# agl-compositor-guest.conf. +[Unit] +Description=AGL compositor +Documentation=man:weston(1) man:weston.ini(5) +Documentation=http://wayland.freedesktop.org/ + +# Make sure we are started after logins are permitted. +Requires=systemd-user-sessions.service +After=systemd-user-sessions.service + +# D-Bus is necessary for contacting logind. Logind is required. +Wants=dbus.socket +After=dbus.socket + +# Ensure the socket is present +Requires=agl-compositor.socket + +# Since we are part of the graphical session, make sure we are started before +# it is complete. +Before=graphical.target + +# Prevent starting on systems without virtual consoles, Weston requires one +# for now. +ConditionPathExists=/dev/tty0 + +[Service] +# Requires systemd-notify.so Weston plugin. +Type=notify +EnvironmentFile=-/etc/default/agl-compositor +ExecStart=/usr/bin/agl-compositor --modules=systemd-notify.so + +# Watchdog setup +TimeoutStartSec=60 +WatchdogSec=20 + +# The user to run as. +User=agl-driver +Group=agl-driver + +# Make sure the working directory is the users home directory +WorkingDirectory=/home/agl-driver + +# Set up a full user session for the user +PAMName=agl-compositor-autologin + +# A virtual terminal is needed. +TTYPath=/dev/tty7 +TTYReset=yes +TTYVHangup=yes +TTYVTDisallocate=yes + +# Fail to start if not controlling the tty. +StandardInput=tty-fail +StandardOutput=journal +StandardError=journal + +# Log this user with utmp, letting it show up with commands 'w' and 'who'. +UtmpIdentifier=tty7 +UtmpMode=user + +[Install] +# Note: If you only want weston to start on-demand, remove this line with a +# service drop file +WantedBy=graphical.target diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket new file mode 100644 index 000000000..ef9769ff7 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket @@ -0,0 +1,10 @@ +# +# Weston must be built with systemd support, and your weston.ini must load +# the plugin systemd-notify.so. + +[Unit] +Description=agl-compositor, a Wayland compositor, as a systemd user service +Documentation=https://docs.automotivelinux.org/en/master/#5_Component_Documentation/1_agl-compositor/ + +[Socket] +ListenStream=%t/wayland-0 diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor_git.bb b/meta-agl-core/recipes-graphics/wayland/agl-compositor_git.bb new file mode 100644 index 000000000..79b13df71 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor_git.bb @@ -0,0 +1,57 @@ +SUMMARY = "Reference Wayland compositor for AGL" +DESCRIPTION = "The AGL compositor is a reference Wayland server for Automotive \ +Grade Linux, using libweston as a base to provide a graphical environment for \ +the automotive environment." + +HOMEPAGE = "https://gerrit.automotivelinux.org/gerrit/q/project:src%252Fagl-compositor" +SECTION = "x11" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=fac6abe0003c4d142ff8fa1f18316df0" + +DEPENDS = "wayland wayland-protocols wayland-native weston" + +SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/agl-compositor.git;protocol=https;branch=${AGL_BRANCH}" +SRCREV = "c8ffca8f9c67114ca424b88df0740943fe7768e3" +AGL_BRANCH:aglnext = "next" +SRCREV:aglnext = "${AUTOREV}" + +AGL_COMPOSITOR_VERSION = "0.0.24" + +PV = "${AGL_COMPOSITOR_VERSION}+git${SRCPV}" +S = "${WORKDIR}/git" + +PACKAGECONFIG ?= "" +PACKAGECONFIG[policy-rba] = "-Dpolicy-default=rba,,librba,librba rba-config" +PACKAGECONFIG[policy-deny-all] = "-Dpolicy-default=deny-all,," +PACKAGECONFIG[grpc-proxy] = "-Dgrpc-proxy=true,-Dgrpc-proxy=false,grpc grpc-native,grpc agl-shell-grpc-server" + +inherit meson pkgconfig python3native + +# Reuse include file from upstream weston since we have the same requirements +require recipes-graphics/wayland/required-distro-features.inc + +PACKAGES =+ "agl-shell-grpc-server" + +LDFLAGS:append:riscv64 = " -Wl,--no-as-needed -latomic -Wl,--as-needed" + +FILES:${PN} = " \ + ${bindir}/agl-compositor \ + ${bindir}/agl-screenshooter \ + ${libdir}/agl-compositor/libexec_compositor.so.0 \ + ${libdir}/agl-compositor/libexec_compositor.so.${AGL_COMPOSITOR_VERSION} \ +" + +FILES:agl-shell-grpc-server = " \ + ${libdir}/agl-compositor/agl-shell-grpc-server \ +" + +RDEPENDS:${PN} += " \ + agl-compositor-init \ + xkeyboard-config \ +" + +FILES:${PN}-dev += " \ + ${datadir}/agl-compositor/protocols/agl-shell.xml \ + ${datadir}/agl-compositor/protocols/agl-shell-desktop.xml \ + ${libdir}/agl-compositor/libexec_compositor.so \ +" diff --git a/meta-agl-core/recipes-graphics/wayland/native-shell-client_git.bb b/meta-agl-core/recipes-graphics/wayland/native-shell-client_git.bb new file mode 100644 index 000000000..c0c31e029 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/native-shell-client_git.bb @@ -0,0 +1,16 @@ +SUMMARY = "Minimal agl-shell Wayland protocol client" + +HOMEPAGE = "https://gerrit.automotivelinux.org/gerrit/q/project:src%252Fnative-shell-client" +SECTION = "x11" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=3b90ee643ce04400848a8f0deb492a4a" + +DEPENDS = "wayland wayland-protocols wayland-native agl-compositor" + +SRC_URI = "git://gerrit.automotivelinux.org/gerrit/src/native-shell-client.git;protocol=https;branch=${AGL_BRANCH}" +SRCREV = "099e06f532eff7c56bf00eb58420f14c95a8e554" + +PV = "0.0.1+git${SRCPV}" +S = "${WORKDIR}/git" + +inherit meson pkgconfig diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf.bb b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf.bb new file mode 100644 index 000000000..f6b27a14b --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf.bb @@ -0,0 +1,139 @@ +SUMMARY = "Configuration file for the Weston and AGL Wayland compositors" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +SRC_URI = " \ + file://core.cfg \ + file://shell.cfg \ + file://hdmi-a-1-0.cfg \ + file://hdmi-a-1-90.cfg \ + file://hdmi-a-1-180.cfg \ + file://hdmi-a-1-270.cfg \ + file://hdmi-a-2-0.cfg \ + file://hdmi-a-2-90.cfg \ + file://hdmi-a-2-180.cfg \ + file://hdmi-a-2-270.cfg \ + file://virtual-0.cfg \ + file://virtual-90.cfg \ + file://virtual-180.cfg \ + file://virtual-270.cfg \ + file://grpc-proxy.cfg \ +" + +S = "${WORKDIR}" + +inherit update-alternatives + +# Default primary display/orientation fragment +WESTON_DISPLAYS ?= "hdmi-a-1-90" + +# Configuration fragments to use in weston.ini.* +# Note that some may be replaced/removed when building the landscape +# configuration. +WESTON_FRAGMENTS_BASE = "core shell" +WESTON_FRAGMENTS = "${WESTON_FRAGMENTS_BASE} ${WESTON_DISPLAYS}" + +# On-target weston.ini directory +weston_ini_dir = "${sysconfdir}/xdg/weston" + +do_compile() { + # Put all of our cfg files together for a default portrait + # orientation configuration + rm -f ${WORKDIR}/weston.ini.default + for F in ${WESTON_FRAGMENTS}; do + cat ${WORKDIR}/${F}.cfg >> ${WORKDIR}/weston.ini.default + echo >> ${WORKDIR}/weston.ini.default + done + sed -i -e '$ d' ${WORKDIR}/weston.ini.default + + cat ${WORKDIR}/weston.ini.default > ${WORKDIR}/weston.ini.default-no-activate + + # Do it again, but filter fragments to configure for landscape + # and a corresponding landscape-inverted that is 180 degrees + # rotated. + rm -f ${WORKDIR}/weston.ini.landscape + rm -f ${WORKDIR}/weston.ini.landscape-inverted + for F in ${WESTON_FRAGMENTS}; do + INVF=$F + if echo $F | grep '^hdmi-a-1-\(90\|270\)$'; then + F="hdmi-a-1-0" + INVF="hdmi-a-1-180" + elif echo $F | grep '^hdmi-a-2-\(90\|270\)$'; then + F="hdmi-a-2-0" + INVF="hdmi-a-2-180" + elif echo $F | grep '^virtual-90$'; then + F="virtual-0" + INVF="virtual-180" + fi + cat ${WORKDIR}/${F}.cfg >> ${WORKDIR}/weston.ini.landscape + cat ${WORKDIR}/${INVF}.cfg >> ${WORKDIR}/weston.ini.landscape-inverted + echo >> ${WORKDIR}/weston.ini.landscape + echo >> ${WORKDIR}/weston.ini.landscape-inverted + done + sed -i -e '$ d' ${WORKDIR}/weston.ini.landscape + sed -i -e '$ d' ${WORKDIR}/weston.ini.landscape-inverted + + cat ${WORKDIR}/weston.ini.landscape > ${WORKDIR}/weston.ini.landscape-no-activate +} + +do_install:append() { + install -d ${D}${weston_ini_dir} + install -m 0644 ${WORKDIR}/weston.ini.default ${D}${weston_ini_dir}/ + install -m 0644 ${WORKDIR}/weston.ini.default-no-activate ${D}${weston_ini_dir}/ + install -m 0644 ${WORKDIR}/weston.ini.landscape-no-activate ${D}${weston_ini_dir}/ + install -m 0644 ${WORKDIR}/weston.ini.landscape ${D}${weston_ini_dir}/ + install -m 0644 ${WORKDIR}/weston.ini.landscape-inverted ${D}${weston_ini_dir}/ +} + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# Use the alternative mechanism to handle multiple packages providing +# weston.ini. This seems simpler than other possible approaches. +# Note that for now the generated packages are being marked as +# incompatible with each other for simplicity, that can be changed if +# a usecase where switching between alternatives at runtime is desirable +# appears. + +ALTERNATIVE_LINK_NAME[weston.ini] = "${weston_ini_dir}/weston.ini" + +RPROVIDES:${PN} = "weston-ini" +ALTERNATIVE:${PN} = "weston.ini" +ALTERNATIVE_TARGET_${PN} = "${weston_ini_dir}/weston.ini.default" + +# landscape + +PACKAGE_BEFORE_PN += "${PN}-landscape" +FILES:${PN}-landscape = "${weston_ini_dir}/weston.ini.landscape" +RPROVIDES:${PN}-landscape = "weston-ini" +ALTERNATIVE:${PN}-landscape = "weston.ini" +ALTERNATIVE_TARGET_${PN}-landscape = "${weston_ini_dir}/weston.ini.landscape" +ALTERNATIVE_PRIORITY_${PN}-landscape = "20" + +# landscape-inverted + +PACKAGE_BEFORE_PN += "${PN}-landscape-inverted" +FILES:${PN}-landscape-inverted = "${weston_ini_dir}/weston.ini.landscape-inverted" +RPROVIDES:${PN}-landscape-inverted = "weston-ini" +ALTERNATIVE:${PN}-landscape-inverted = "weston.ini" +ALTERNATIVE_TARGET_${PN}-landscape-inverted = "${weston_ini_dir}/weston.ini.landscape-inverted" +ALTERNATIVE_PRIORITY_${PN}-landscape-inverted = "25" + +# no-activate, no activation by default +PACKAGE_BEFORE_PN += "${PN}-no-activate" +FILES:${PN}-no-activate = "${weston_ini_dir}/weston.ini.default-no-activate" +RPROVIDES:${PN}-no-activate = "weston-ini" +ALTERNATIVE:${PN}-no-activate = "weston.ini" +ALTERNATIVE_TARGET_${PN}-no-activate = "${weston_ini_dir}/weston.ini.default-no-activate" +ALTERNATIVE_PRIORITY_${PN}-no-activate = "21" + +# landscape-no-activate, no activation by default +PACKAGE_BEFORE_PN += "${PN}-landscape-no-activate" +FILES:${PN}-landscape-no-activate = "${weston_ini_dir}/weston.ini.landscape-no-activate" +RPROVIDES:${PN}-landscape-no-activate = "weston-ini" +ALTERNATIVE:${PN}-landscape-no-activate = "weston.ini" +ALTERNATIVE_TARGET_${PN}-landscape-no-activate = "${weston_ini_dir}/weston.ini.landscape-no-activate" +ALTERNATIVE_PRIORITY_${PN}-landscape-no-activate = "26" + +# This is a settings-only package, we do not need a development package +# (and its fixed dependency to ${PN} being installed) +PACKAGES:remove = "${PN}-dev ${PN}-staticdev" diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf.bbappend new file mode 100644 index 000000000..b6095f2fa --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf.bbappend @@ -0,0 +1,10 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +# For virtual machines and intel-corei7-64 we want to support both the HDMI-A-1 +# and Virtual-1 outputs. This allows us to run virtual images on real hardware +# and vice versa. +WESTON_DISPLAYS:append:qemuall = " virtual-90" +WESTON_DISPLAYS:append:intel-corei7-64 = " virtual-90" +WESTON_DISPLAYS:append:virtio-aarch64 = " virtual-90" diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/core.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/core.cfg new file mode 100644 index 000000000..28f90752d --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/core.cfg @@ -0,0 +1,6 @@ +[core] +backend=drm-backend.so +require-input=false +idle-time=0 +modules=systemd-notify.so +activate-by-default=false diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/grpc-proxy.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/grpc-proxy.cfg new file mode 100644 index 000000000..14805b969 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/grpc-proxy.cfg @@ -0,0 +1,4 @@ + +[shell-client-ext] +command=/usr/lib/agl-compositor/agl-shell-grpc-server + diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-0.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-0.cfg new file mode 100644 index 000000000..f82570790 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-0.cfg @@ -0,0 +1,3 @@ +# A display is connected to HDMI-A-1 +[output] +name=HDMI-A-1 diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-180.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-180.cfg new file mode 100644 index 000000000..b6f4329ef --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-180.cfg @@ -0,0 +1,4 @@ +# A display is connected to HDMI-A-1 +[output] +name=HDMI-A-1 +transform=rotate-180 diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270.cfg new file mode 100644 index 000000000..187f2c7bd --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-270.cfg @@ -0,0 +1,6 @@ +# A display is connected to HDMI-A-1 and needs to be rotated 270 degrees +# to have a proper orientation of the homescreen. For example the various sizes +# of the GeChic display or the Dell display. +[output] +name=HDMI-A-1 +transform=rotate-270 diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-90.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-90.cfg new file mode 100644 index 000000000..5ee9c1904 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-1-90.cfg @@ -0,0 +1,6 @@ +# A display is connected to HDMI-A-1 and needs to be rotated 90 degrees +# to have a proper orientation of the homescreen. For example, the 'eGalax' +# display used in some instances. +[output] +name=HDMI-A-1 +transform=rotate-90 diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-0.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-0.cfg new file mode 100644 index 000000000..4d5d51c03 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-0.cfg @@ -0,0 +1,5 @@ +# A display is connected to HDMI-A-1 and needs to be rotated 90 degrees +# to have a proper orientation of the homescreen. For example, the 'eGalax' +# display used in some instances. +[output] +name=HDMI-A-2 diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-180.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-180.cfg new file mode 100644 index 000000000..ffdc5fe60 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-180.cfg @@ -0,0 +1,6 @@ +# A display is connected to HDMI-A-1 and needs to be rotated 90 degrees +# to have a proper orientation of the homescreen. For example, the 'eGalax' +# display used in some instances. +[output] +name=HDMI-A-2 +transform=rotate-180 diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-270.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-270.cfg new file mode 100644 index 000000000..76fc77acd --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-270.cfg @@ -0,0 +1,6 @@ +# A display is connected to HDMI-A-1 and needs to be rotated 90 degrees +# to have a proper orientation of the homescreen. For example, the 'eGalax' +# display used in some instances. +[output] +name=HDMI-A-2 +transform=rotate-270 diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-90.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-90.cfg new file mode 100644 index 000000000..9172a1c6a --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/hdmi-a-2-90.cfg @@ -0,0 +1,6 @@ +# A display is connected to HDMI-A-1 and needs to be rotated 90 degrees +# to have a proper orientation of the homescreen. For example, the 'eGalax' +# display used in some instances. +[output] +name=HDMI-A-2 +transform=rotate-90 diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/shell.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/shell.cfg new file mode 100644 index 000000000..8d16ba5d7 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/shell.cfg @@ -0,0 +1,3 @@ +[shell] +locking=false +panel-position=none diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-0.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-0.cfg new file mode 100644 index 000000000..d69253639 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-0.cfg @@ -0,0 +1,3 @@ +[output] +name=Virtual-1 +mode=1920x1080 diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-180.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-180.cfg new file mode 100644 index 000000000..0363b6339 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-180.cfg @@ -0,0 +1,4 @@ +[output] +name=Virtual-1 +mode=1920x1080 +transform=rotate-180 diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-270.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-270.cfg new file mode 100644 index 000000000..c3f72f495 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-270.cfg @@ -0,0 +1,4 @@ +[output] +name=Virtual-1 +mode=1920x1080 +transform=rotate-270 diff --git a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-90.cfg b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-90.cfg new file mode 100644 index 000000000..96d9c3a04 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/virtual-90.cfg @@ -0,0 +1,4 @@ +[output] +name=Virtual-1 +mode=1920x1080 +transform=rotate-90 diff --git a/meta-agl-core/recipes-graphics/wayland/weston-init.bbappend b/meta-agl-core/recipes-graphics/wayland/weston-init.bbappend new file mode 100644 index 000000000..c09d7ccd3 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-init.bbappend @@ -0,0 +1 @@ +require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'weston-init_aglcore.inc', '', d)} diff --git a/meta-agl-core/recipes-graphics/wayland/weston-init_aglcore.inc b/meta-agl-core/recipes-graphics/wayland/weston-init_aglcore.inc new file mode 100644 index 000000000..896f1eafb --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston-init_aglcore.inc @@ -0,0 +1,8 @@ +SYSTEMD_AUTO_ENABLE = "enable" + +do_install:append() { + # Remove upstream weston.ini to avoid conflict with weston-ini-conf package + rm -f ${D}${sysconfdir}/xdg/weston/weston.ini +} + +RDEPENDS:${PN} += "weston-ini" diff --git a/meta-agl-core/recipes-graphics/wayland/weston/0001-backend-drm-don-t-leak-gem_handle_refcnt-in-drm_dest.patch b/meta-agl-core/recipes-graphics/wayland/weston/0001-backend-drm-don-t-leak-gem_handle_refcnt-in-drm_dest.patch new file mode 100644 index 000000000..0e3ab7613 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston/0001-backend-drm-don-t-leak-gem_handle_refcnt-in-drm_dest.patch @@ -0,0 +1,27 @@ +From fb60f9c16ce8865fbdcd181419f44b72af1aa3c2 Mon Sep 17 00:00:00 2001 +From: Ray Smith <rsmith@brightsign.biz> +Date: Tue, 19 Dec 2023 11:43:55 +0000 +Subject: [PATCH 1/2] backend-drm: don't leak gem_handle_refcnt in drm_destroy + +Signed-off-by: Ray Smith <rsmith@brightsign.biz> +--- + libweston/backend-drm/drm.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c +index 8092789..fcececb 100644 +--- a/libweston/backend-drm/drm.c ++++ b/libweston/backend-drm/drm.c +@@ -3364,6 +3364,9 @@ drm_destroy(struct weston_backend *backend) + weston_launcher_close(ec->launcher, device->drm.fd); + weston_launcher_destroy(ec->launcher); + ++ if (device->gem_handle_refcnt) ++ hash_table_destroy(device->gem_handle_refcnt); ++ + free(device->drm.filename); + free(device); + free(b); +-- +2.43.0 + diff --git a/meta-agl-core/recipes-graphics/wayland/weston/0001-clients-Handle-missing-pointer_surface-is-there-s-no.patch b/meta-agl-core/recipes-graphics/wayland/weston/0001-clients-Handle-missing-pointer_surface-is-there-s-no.patch new file mode 100644 index 000000000..202333a5e --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston/0001-clients-Handle-missing-pointer_surface-is-there-s-no.patch @@ -0,0 +1,30 @@ +From 6a847464de9e773f6d1490916d0df48a0f90eeba Mon Sep 17 00:00:00 2001 +From: Marius Vlad <marius.vlad@collabora.com> +Date: Thu, 5 Oct 2023 16:27:34 +0300 +Subject: [PATCH] clients: Handle missing pointer_surface is there's no pointer + event + +Upstream-Status: Pending + +Bug-AGL: SPEC-4916 +Signed-off-by: Marius Vlad <marius.vlad@collabora.com> +--- + clients/window.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/clients/window.c b/clients/window.c +index 30f6410..882e9d5 100644 +--- a/clients/window.c ++++ b/clients/window.c +@@ -3818,7 +3818,7 @@ pointer_surface_frame_callback(void *data, struct wl_callback *callback, + force_frame = false; + } + +- if (!input->pointer) ++ if (!input->pointer || !input->pointer_surface) + return; + + if (input_set_pointer_special(input)) +-- +2.35.1 + diff --git a/meta-agl-core/recipes-graphics/wayland/weston/0002-backend-drm-always-create-gem_handle_refcnt-hash-tab.patch b/meta-agl-core/recipes-graphics/wayland/weston/0002-backend-drm-always-create-gem_handle_refcnt-hash-tab.patch new file mode 100644 index 000000000..0ae82088a --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston/0002-backend-drm-always-create-gem_handle_refcnt-hash-tab.patch @@ -0,0 +1,56 @@ +From 10fcfd66069c774e28f67b18afd329e4bcf9f5b3 Mon Sep 17 00:00:00 2001 +From: Ray Smith <rsmith@brightsign.biz> +Date: Tue, 19 Dec 2023 11:45:45 +0000 +Subject: [PATCH 2/2] backend-drm: always create gem_handle_refcnt hash table + +Devices created via drm_device_create have this hash table, but those +created via drm_backend_create don't. + +Signed-off-by: Ray Smith <rsmith@brightsign.biz> +--- + libweston/backend-drm/drm.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c +index fcececb..9d6a9cf 100644 +--- a/libweston/backend-drm/drm.c ++++ b/libweston/backend-drm/drm.c +@@ -3364,8 +3364,7 @@ drm_destroy(struct weston_backend *backend) + weston_launcher_close(ec->launcher, device->drm.fd); + weston_launcher_destroy(ec->launcher); + +- if (device->gem_handle_refcnt) +- hash_table_destroy(device->gem_handle_refcnt); ++ hash_table_destroy(device->gem_handle_refcnt); + + free(device->drm.filename); + free(device); +@@ -3867,10 +3866,13 @@ drm_backend_create(struct weston_compositor *compositor, + + device = zalloc(sizeof *device); + if (device == NULL) +- return NULL; ++ goto err_backend; + device->state_invalid = true; + device->drm.fd = -1; + device->backend = b; ++ device->gem_handle_refcnt = hash_table_create(); ++ if (!device->gem_handle_refcnt) ++ goto err_device; + + b->drm = device; + wl_list_init(&b->kms_list); +@@ -4108,6 +4110,10 @@ err_compositor: + if (b->gbm) + gbm_device_destroy(b->gbm); + #endif ++ hash_table_destroy(device->gem_handle_refcnt); ++err_device: ++ free(device); ++err_backend: + free(b); + return NULL; + } +-- +2.43.0 + diff --git a/meta-agl-core/recipes-graphics/wayland/weston_13.0.%.bbappend b/meta-agl-core/recipes-graphics/wayland/weston_13.0.%.bbappend new file mode 100644 index 000000000..87cad12a0 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston_13.0.%.bbappend @@ -0,0 +1 @@ +require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'weston_13.0_aglcore.inc', '', d)} diff --git a/meta-agl-core/recipes-graphics/wayland/weston_13.0_aglcore.inc b/meta-agl-core/recipes-graphics/wayland/weston_13.0_aglcore.inc new file mode 100644 index 000000000..0b5dae715 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston_13.0_aglcore.inc @@ -0,0 +1,30 @@ +FILESEXTRAPATHS:append := ":${THISDIR}/weston" + +PACKAGECONFIG:append = "${@bb.utils.contains('DISTRO_FEATURES', 'weston-remoting', ' remoting', '', d)}" + +SRC_URI:append = " \ + file://0001-clients-Handle-missing-pointer_surface-is-there-s-no.patch \ + file://0001-backend-drm-don-t-leak-gem_handle_refcnt-in-drm_dest.patch \ + file://0002-backend-drm-always-create-gem_handle_refcnt-hash-tab.patch \ +" + + +# Split weston-terminal out of the main package to allow installing it +# separately for use with other compositors. The icons, etc. that end +# up in /usr/share/weston are also split out into a separate package +# since they are required for weston-terminal and some of the programs +# packaged in weston-examples in addition to ivi-shell in the main +# package. + +PACKAGE_BEFORE_PN += "${PN}-data ${PN}-terminal" + +FILES:${PN}-data = "${datadir}/weston" + +FILES:${PN}-terminal = "${bindir}/weston-terminal" +RDEPENDS:${PN}-terminal += "weston-data liberation-fonts" + +RDEPENDS:${PN}-examples += "weston-data" + +FILES:${PN}:remove = "weston-terminal" +RDEPENDS:${PN}:remove = "liberation-fonts" +RDEPENDS:${PN} += "weston-data weston-terminal" |