diff options
Diffstat (limited to 'meta-agl-core/recipes-graphics')
8 files changed, 162 insertions, 6 deletions
diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init-pipewire.bb b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init-pipewire.bb new file mode 100644 index 000000000..f1d73732a --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init-pipewire.bb @@ -0,0 +1,42 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/agl-compositor-init:" + +SUMMARY = "Startup systemd unit for the AGL Wayland compositor with starting in the same time the DRM and PipeWire backends" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +inherit systemd + +PACKAGE_ARCH = "${MACHINE_ARCH}" + +SRC_URI = "file://agl-compositor-pipewire.conf \ + file://agl-compositor-stream-pipewire.service \ +" + +S = "${WORKDIR}" + +AGL_KVM_REMOTE_OUTPUT_IP ?= "172.16.10.3" +AGL_KVM_REMOTE_OUTPUT_PORT ?= "5005" + +do_install() { + sed -i -e "s,@REMOTE_OUTPUT_IP@,${AGL_KVM_REMOTE_OUTPUT_IP},g" \ + ${WORKDIR}/agl-compositor-stream-pipewire.service + + sed -i -e "s,@REMOTE_OUTPUT_PORT@,${AGL_KVM_REMOTE_OUTPUT_PORT},g" \ + ${WORKDIR}/agl-compositor-stream-pipewire.service + + install -D -p -m0644 ${WORKDIR}/agl-compositor-stream-pipewire.service ${D}${systemd_system_unitdir}/agl-compositor-stream-pipewire.service + + install -d ${D}${systemd_system_unitdir}/agl-compositor.service.d + install -m644 ${WORKDIR}/agl-compositor-pipewire.conf ${D}/${systemd_system_unitdir}/agl-compositor.service.d/02-agl-compositor.conf +} + +FILES:${PN} += "\ + ${systemd_system_unitdir}/agl-compositor.service.d \ + ${systemd_system_unitdir}/agl-compositor.service.d/02-agl-compositor.conf \ + ${systemd_system_unitdir}/agl-compositor-stream-pipewire.service \ + " + +RDEPENDS:${PN} = "agl-compositor-init weston-ini" +RCONFLICTS:${PN} = "weston-init" + +SYSTEMD_SERVICE:${PN} = "agl-compositor-stream-pipewire.service" diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init.bb b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init.bb index d8baf91f9..dc23d4281 100644 --- a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init.bb +++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init.bb @@ -41,7 +41,7 @@ do_install() { 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 + install -m644 ${WORKDIR}/agl-compositor.conf ${D}/${systemd_system_unitdir}/agl-compositor.service.d/01-agl-compositor.conf } FILES:${PN} += "\ diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor-pipewire.conf b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor-pipewire.conf new file mode 100644 index 000000000..aba0df102 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor-pipewire.conf @@ -0,0 +1,3 @@ +[Service] +ExecStart= +ExecStart=/usr/bin/agl-compositor -Bdrm,pipewire --idle-time=0 --config /etc/xdg/weston/weston.ini diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor-stream-pipewire.service b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor-stream-pipewire.service new file mode 100644 index 000000000..a01edda22 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor-init/agl-compositor-stream-pipewire.service @@ -0,0 +1,29 @@ +[Unit] +Description=Stream PipeWire output created by AGL compositor + +Requires=agl-compositor.service +After=agl-compositor.service + +Before=graphical.target +ConditionPathExists=/usr/bin/agl-stream-pipewire-output + +[Service] +Type=simple +EnvironmentFile=-/etc/default/agl-stream-pipewire-output +# need to wait until receiver has its receiver client started; this might be a +# bit controversial but this actually decreases the preceived time when we +# start displaying frames on the receiver side. A proper solution would be +# somehow have a way to convey when it is the best time start the stream +ExecStartPre=sleep 10 +ExecStart=/usr/bin/agl-stream-pipewire-output @REMOTE_OUTPUT_IP@ @REMOTE_OUTPUT_PORT@ + +User=agl-driver +Group=agl-driver + +WorkingDirectory=/home/agl-driver + +StandardOutput=journal +StandardError=journal + +[Install] +WantedBy=graphical.target diff --git a/meta-agl-core/recipes-graphics/wayland/agl-compositor_git.bb b/meta-agl-core/recipes-graphics/wayland/agl-compositor_git.bb index 79b13df71..7a33b125d 100644 --- a/meta-agl-core/recipes-graphics/wayland/agl-compositor_git.bb +++ b/meta-agl-core/recipes-graphics/wayland/agl-compositor_git.bb @@ -11,7 +11,7 @@ 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" +SRCREV = "cea35f44d1e60ed2d67c6556eba6b7777d5f66ce" AGL_BRANCH:aglnext = "next" SRCREV:aglnext = "${AUTOREV}" @@ -24,6 +24,7 @@ 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" +PACKAGECONFIG[drm-lease] = "-Ddrm-lease=true,-Ddrm-lease=false,drm-lease-manager" inherit meson pkgconfig python3native @@ -37,6 +38,7 @@ LDFLAGS:append:riscv64 = " -Wl,--no-as-needed -latomic -Wl,--as-needed" FILES:${PN} = " \ ${bindir}/agl-compositor \ ${bindir}/agl-screenshooter \ + ${bindir}/agl-stream-pipewire-output \ ${libdir}/agl-compositor/libexec_compositor.so.0 \ ${libdir}/agl-compositor/libexec_compositor.so.${AGL_COMPOSITOR_VERSION} \ " @@ -48,6 +50,7 @@ FILES:agl-shell-grpc-server = " \ RDEPENDS:${PN} += " \ agl-compositor-init \ xkeyboard-config \ + bash \ " FILES:${PN}-dev += " \ 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 index 28f90752d..278db8956 100644 --- a/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/core.cfg +++ b/meta-agl-core/recipes-graphics/wayland/weston-ini-conf/core.cfg @@ -1,5 +1,4 @@ [core] -backend=drm-backend.so require-input=false idle-time=0 modules=systemd-notify.so diff --git a/meta-agl-core/recipes-graphics/wayland/weston/0001-backend-Add-weston_get_backend_type.patch b/meta-agl-core/recipes-graphics/wayland/weston/0001-backend-Add-weston_get_backend_type.patch new file mode 100644 index 000000000..01d5f91d6 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston/0001-backend-Add-weston_get_backend_type.patch @@ -0,0 +1,79 @@ +From fcccf1b63dc3cbf6063238c39a31197f0d32364c Mon Sep 17 00:00:00 2001 +From: Marius Vlad <marius.vlad@collabora.com> +Date: Fri, 13 Dec 2024 17:14:44 +0200 +Subject: [PATCH] backend: Add weston_get_backend_type + +Signed-off-by: Marius Vlad <marius.vlad@collabora.com> +--- + include/libweston/libweston.h | 3 +++ + libweston/backend.h | 5 +++++ + libweston/compositor.c | 19 +++++++++++++++++++ + 3 files changed, 27 insertions(+) + +diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h +index 077c16b..da6200d 100644 +--- a/include/libweston/libweston.h ++++ b/include/libweston/libweston.h +@@ -2685,6 +2685,9 @@ weston_compositor_add_screenshot_authority(struct weston_compositor *compositor, + int + weston_compositor_backends_loaded(struct weston_compositor *compositor); + ++enum weston_compositor_backend ++weston_get_backend_type(struct weston_backend *backend); ++ + #ifdef __cplusplus + } + #endif +diff --git a/libweston/backend.h b/libweston/backend.h +index 495d0a5..9b12544 100644 +--- a/libweston/backend.h ++++ b/libweston/backend.h +@@ -120,6 +120,11 @@ struct weston_backend { + */ + bool (*can_scanout_dmabuf)(struct weston_backend *backend, + struct linux_dmabuf_buffer *buffer); ++ ++ /** Identifies a particular backend_type from one ++ * defined in weston_compositor_backend. ++ */ ++ enum weston_compositor_backend backend_type; + }; + + /* weston_head */ +diff --git a/libweston/compositor.c b/libweston/compositor.c +index 41459eb..ef1932f 100644 +--- a/libweston/compositor.c ++++ b/libweston/compositor.c +@@ -9691,6 +9691,7 @@ weston_compositor_load_backend(struct weston_compositor *compositor, + return NULL; + + b = wl_container_of(compositor->backend_list.next, b, link); ++ b->backend_type = backend; + + /* Return the last loaded backend. */ + return b; +@@ -9954,3 +9955,21 @@ weston_output_finish_frame_from_timer(struct weston_output *output) + + weston_output_finish_frame(output, &ts, 0); + } ++ ++/** Retrieve the backend type of as described in enum ++ * weston_compositor_backend. ++ * ++ * Note that the backend must be loaded, with weston_compositor_load_backend ++ * ++ * \param backend weston_backend in question ++ * \returns a type of enum weston_compositor_backend ++ * ++ * \sa weston_compositor_load_backend ++ * ++ */ ++WL_EXPORT enum weston_compositor_backend ++weston_get_backend_type(struct weston_backend *backend) ++{ ++ assert(backend); ++ return backend->backend_type; ++} +-- +2.43.0 + 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 index 0b5dae715..f4f5e4c17 100644 --- a/meta-agl-core/recipes-graphics/wayland/weston_13.0_aglcore.inc +++ b/meta-agl-core/recipes-graphics/wayland/weston_13.0_aglcore.inc @@ -1,13 +1,13 @@ 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 \ + file://0001-backend-Add-weston_get_backend_type.patch \ " +WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}" # Split weston-terminal out of the main package to allow installing it # separately for use with other compositors. The icons, etc. that end @@ -16,8 +16,9 @@ SRC_URI:append = " \ # packaged in weston-examples in addition to ivi-shell in the main # package. -PACKAGE_BEFORE_PN += "${PN}-data ${PN}-terminal" +PACKAGE_BEFORE_PN += "${PN}-data ${PN}-terminal ${PN}-pipewire" +FILES:${PN}-pipewire = "${libdir}/libweston-${WESTON_MAJOR_VERSION}/pipewire-backend.so" FILES:${PN}-data = "${datadir}/weston" FILES:${PN}-terminal = "${bindir}/weston-terminal" |