From 9bbcfdfd0d2f69b5bd487f51463332a84e923aaf Mon Sep 17 00:00:00 2001 From: Andrii Chepurnyi Date: Fri, 20 Sep 2024 13:22:29 +0300 Subject: [PATCH 1/3] dom0: do not build qemu In most products dom0 used as a control domain and not as backend domain. Signed-off-by: Andrii Chepurnyi --- .../recipes-core/meta/meta-extsdk-toolchain.bbappend | 3 +++ .../packagegroups/nativesdk-packagegroup-sdk-host.bbappend | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 meta-xt-control-domain/recipes-core/meta/meta-extsdk-toolchain.bbappend create mode 100644 meta-xt-control-domain/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend diff --git a/meta-xt-control-domain/recipes-core/meta/meta-extsdk-toolchain.bbappend b/meta-xt-control-domain/recipes-core/meta/meta-extsdk-toolchain.bbappend new file mode 100644 index 00000000..7645cbc2 --- /dev/null +++ b/meta-xt-control-domain/recipes-core/meta/meta-extsdk-toolchain.bbappend @@ -0,0 +1,3 @@ + +DEPENDS:remove = " qemu-native qemu-helper-native" + diff --git a/meta-xt-control-domain/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend b/meta-xt-control-domain/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend new file mode 100644 index 00000000..65d8c511 --- /dev/null +++ b/meta-xt-control-domain/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bbappend @@ -0,0 +1,3 @@ + +RDEPENDS:${PN}:remove = " nativesdk-qemu nativesdk-qemu-helper" + From 1451508b7928ffa2067756c20b8a74c77ab923ea Mon Sep 17 00:00:00 2001 From: Andrii Chepurnyi Date: Wed, 18 Sep 2024 14:34:51 +0300 Subject: [PATCH 2/3] domd: use drmkms in non weston build for libsdl2 In our configuration, QEMU uses libsdl2 as a backend for display. At the same time, in weston build, libsdl2 uses weston window for display output. In non weston build it is proposed to use drmkms for the display output. Signed-off-by: Andrii Chepurnyi --- .../recipes-core/systemd/files/sdl-env-kmsdrm.conf | 2 ++ .../files/{sdl-env.conf => sdl-env-wayland.conf} | 0 .../recipes-core/systemd/systemd_%.bbappend | 10 ++++++++-- .../recipes-graphics/libsdl2/libsdl2_2.0.20.bbappend | 2 ++ 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 meta-xt-driver-domain/recipes-core/systemd/files/sdl-env-kmsdrm.conf rename meta-xt-driver-domain/recipes-core/systemd/files/{sdl-env.conf => sdl-env-wayland.conf} (100%) create mode 100644 meta-xt-driver-domain/recipes-graphics/libsdl2/libsdl2_2.0.20.bbappend diff --git a/meta-xt-driver-domain/recipes-core/systemd/files/sdl-env-kmsdrm.conf b/meta-xt-driver-domain/recipes-core/systemd/files/sdl-env-kmsdrm.conf new file mode 100644 index 00000000..890522f1 --- /dev/null +++ b/meta-xt-driver-domain/recipes-core/systemd/files/sdl-env-kmsdrm.conf @@ -0,0 +1,2 @@ +[Manager] +DefaultEnvironment="SDL_VIDEODRIVER=kmsdrm" diff --git a/meta-xt-driver-domain/recipes-core/systemd/files/sdl-env.conf b/meta-xt-driver-domain/recipes-core/systemd/files/sdl-env-wayland.conf similarity index 100% rename from meta-xt-driver-domain/recipes-core/systemd/files/sdl-env.conf rename to meta-xt-driver-domain/recipes-core/systemd/files/sdl-env-wayland.conf diff --git a/meta-xt-driver-domain/recipes-core/systemd/systemd_%.bbappend b/meta-xt-driver-domain/recipes-core/systemd/systemd_%.bbappend index 7049c7c6..6cceb6f1 100644 --- a/meta-xt-driver-domain/recipes-core/systemd/systemd_%.bbappend +++ b/meta-xt-driver-domain/recipes-core/systemd/systemd_%.bbappend @@ -2,7 +2,8 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/files:" SRC_URI:append = " \ file://ip_forward.conf \ - file://sdl-env.conf \ + file://sdl-env-wayland.conf \ + file://sdl-env-kmsdrm.conf \ " PACKAGECONFIG:append = " networkd" @@ -14,5 +15,10 @@ USERADD_ERROR_DYNAMIC = "warn" do_install:append() { install -m 0644 ${WORKDIR}/ip_forward.conf ${D}${sysconfdir}/tmpfiles.d/ install -d ${D}${sysconfdir}/systemd/system.conf.d/ - install -m 0644 ${WORKDIR}/sdl-env.conf ${D}${sysconfdir}/systemd/system.conf.d/ + # Check if 'weston' is included in the DISTRO_FEATURES or PACKAGECONFIG + if ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'true', 'false', d)}; then + install -m 0644 ${WORKDIR}/sdl-env-wayland.conf ${D}${sysconfdir}/systemd/system.conf.d/sdl-env.conf + else + install -m 0644 ${WORKDIR}/sdl-env-kmsdrm.conf ${D}${sysconfdir}/systemd/system.conf.d/sdl-env.conf + fi } diff --git a/meta-xt-driver-domain/recipes-graphics/libsdl2/libsdl2_2.0.20.bbappend b/meta-xt-driver-domain/recipes-graphics/libsdl2/libsdl2_2.0.20.bbappend new file mode 100644 index 00000000..6058904f --- /dev/null +++ b/meta-xt-driver-domain/recipes-graphics/libsdl2/libsdl2_2.0.20.bbappend @@ -0,0 +1,2 @@ + +PACKAGECONFIG:append = "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '', ' kmsdrm gles2 ', d)}" From 64ec20604f772fe13fa6fff6d48583c5fa0c32e7 Mon Sep 17 00:00:00 2001 From: Andrii Chepurnyi Date: Wed, 2 Oct 2024 23:24:14 +0300 Subject: [PATCH 3/3] dom0: reorganize doma/domu prerequestetives Introduce new property XT_DOMD_DISPLAY_SYSTEM, which will hint display system in DomD to chose appropriate domain dependancies for start. I.e. if weston used - we assume that prior guest start, weston should be ready and running to give possibility for gues draw into window. Signed-off-by: Andrii Chepurnyi --- .../recipes-guest/doma/doma.bbappend | 13 +++++++++++++ .../recipes-guest/doma/files/virtio-env-weston.conf | 3 +++ .../recipes-guest/doma/files/virtio-env.conf | 4 ---- .../recipes-guest/domu/domu.bbappend | 12 +++++++----- 4 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env-weston.conf diff --git a/meta-xt-control-domain-virtio/recipes-guest/doma/doma.bbappend b/meta-xt-control-domain-virtio/recipes-guest/doma/doma.bbappend index da3fc830..fe32471f 100644 --- a/meta-xt-control-domain-virtio/recipes-guest/doma/doma.bbappend +++ b/meta-xt-control-domain-virtio/recipes-guest/doma/doma.bbappend @@ -1,7 +1,13 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/files:" +# virtio-env-weston.conf whould be used if we have the weston compositor in domd +# the product should redefine variable. + +XT_DOMD_DISPLAY_SYSTEM ??= "weston" + SRC_URI += "\ file://virtio-env.conf \ + file://virtio-env-weston.conf \ " RDEPENDS:${PN} += " \ @@ -10,9 +16,16 @@ RDEPENDS:${PN} += " \ FILES:${PN} += " \ ${sysconfdir}/systemd/system/doma.service.d/virtio-env.conf \ + ${@bb.utils.contains('XT_DOMD_DISPLAY_SYSTEM', 'weston', \ + '${sysconfdir}/systemd/system/doma.service.d/virtio-env-weston.conf', \ + '', d)} \ " do_install:append() { install -d ${D}${sysconfdir}/systemd/system/doma.service.d install -m 0644 ${WORKDIR}/virtio-env.conf ${D}${sysconfdir}/systemd/system/doma.service.d + + if ${@bb.utils.contains('XT_DOMD_DISPLAY_SYSTEM', 'weston', 'true', 'false', d)}; then + install -m 0644 ${WORKDIR}/virtio-env-weston.conf ${D}${sysconfdir}/systemd/system/doma.service.d + fi } diff --git a/meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env-weston.conf b/meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env-weston.conf new file mode 100644 index 00000000..5d0b08fe --- /dev/null +++ b/meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env-weston.conf @@ -0,0 +1,3 @@ +[Unit] +Requires=backend-ready@weston-up.service +After=backend-ready@weston-up.service diff --git a/meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env.conf b/meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env.conf index 3fd2939d..98ddeb7e 100644 --- a/meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env.conf +++ b/meta-xt-control-domain-virtio/recipes-guest/doma/files/virtio-env.conf @@ -1,7 +1,3 @@ -[Unit] -Requires=backend-ready@weston-up.service -After=backend-ready@weston-up.service - [Service] Type=simple ExecStart= diff --git a/meta-xt-control-domain-virtio/recipes-guest/domu/domu.bbappend b/meta-xt-control-domain-virtio/recipes-guest/domu/domu.bbappend index bb6d6d27..c22baca0 100644 --- a/meta-xt-control-domain-virtio/recipes-guest/domu/domu.bbappend +++ b/meta-xt-control-domain-virtio/recipes-guest/domu/domu.bbappend @@ -1,5 +1,10 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/files:" +# virtio-env-weston.conf whould be used if we have the weston compositor in domd +# the product should redefine variable. + +XT_DOMD_DISPLAY_SYSTEM ??= "weston" + SRC_URI += "\ file://virtio-env.conf \ file://virtio-env-weston.conf \ @@ -12,7 +17,7 @@ RDEPENDS:${PN} += " \ FILES:${PN} += " \ ${sysconfdir}/systemd/system/domu.service.d/virtio-env.conf \ - ${@bb.utils.contains('MACHINE_FEATURES', 'gsx', \ + ${@bb.utils.contains('XT_DOMD_DISPLAY_SYSTEM', 'weston', \ '${sysconfdir}/systemd/system/domu.service.d/virtio-env-weston.conf', \ '${sysconfdir}/systemd/system/domu.service.d/virtio-env-no-weston.conf', d)} \ " @@ -21,10 +26,7 @@ do_install:append() { install -d ${D}${sysconfdir}/systemd/system/domu.service.d install -m 0644 ${WORKDIR}/virtio-env.conf ${D}${sysconfdir}/systemd/system/domu.service.d - # this virtio-env-weston.conf whould be used if we have the 'wayland' - # distro feature inside DomU. But to avoid introducing new variable - # we can look on presence of GSX on the board. - if ${@bb.utils.contains('MACHINE_FEATURES', 'gsx', 'true', 'false', d)}; then + if ${@bb.utils.contains('XT_DOMD_DISPLAY_SYSTEM', 'weston', 'true', 'false', d)}; then install -m 0644 ${WORKDIR}/virtio-env-weston.conf ${D}${sysconfdir}/systemd/system/domu.service.d else install -m 0644 ${WORKDIR}/virtio-env-no-weston.conf ${D}${sysconfdir}/systemd/system/domu.service.d