From 435dcaecc8aab815dfdfe22d77ab6ac9723e7c30 Mon Sep 17 00:00:00 2001 From: casept Date: Tue, 13 Feb 2024 18:10:18 +0100 Subject: [PATCH] emulator: Move qemux86-specific changes into separate machine meta layer Previously, qemux86-related changes were strewn all over meta-asteroid, which went against the way all other machines are handled. This change creates a new "smartwatch" machine, called emulator. It inherits most machine configuration from openembedded's qemux86 machine. The patches, configs etc. are basically the same as they were in meta-asteroid, the interesting change is the creation of a dedicated machine.conf. --- meta-emulator/conf/layer.conf | 7 ++++ meta-emulator/conf/machine/emulator.conf | 23 ++++++++++++ .../asteroid-launcher-configs/kms-qemu.json | 6 +++ .../asteroid-launcher-configs/qemu.conf | 4 ++ .../asteroid-launcher-configs_%.bbappend | 8 ++++ ...-shaders-which-cause-all-sorts-of-pr.patch | 37 +++++++++++++++++++ .../qml-asteroid/qml-asteroid_%.bbappend | 2 + .../recipes-graphics/mesa/mesa_%.bbappend | 2 + .../linux/linux-yocto/drm-virtio-gpu.cfg | 1 + .../linux/linux-yocto_%.bbappend | 5 +++ ...eep-screen-on-by-default-on-emulator.patch | 22 +++++++++++ .../recipes-nemomobile/mce/mce_%.bbappend | 2 + 12 files changed, 119 insertions(+) create mode 100644 meta-emulator/conf/layer.conf create mode 100644 meta-emulator/conf/machine/emulator.conf create mode 100644 meta-emulator/recipes-asteroid/asteroid-launcher/asteroid-launcher-configs/kms-qemu.json create mode 100644 meta-emulator/recipes-asteroid/asteroid-launcher/asteroid-launcher-configs/qemu.conf create mode 100644 meta-emulator/recipes-asteroid/asteroid-launcher/asteroid-launcher-configs_%.bbappend create mode 100644 meta-emulator/recipes-asteroid/qml-asteroid/qml-asteroid/0001-Spinners-Disable-shaders-which-cause-all-sorts-of-pr.patch create mode 100644 meta-emulator/recipes-asteroid/qml-asteroid/qml-asteroid_%.bbappend create mode 100644 meta-emulator/recipes-graphics/mesa/mesa_%.bbappend create mode 100644 meta-emulator/recipes-kernel/linux/linux-yocto/drm-virtio-gpu.cfg create mode 100644 meta-emulator/recipes-kernel/linux/linux-yocto_%.bbappend create mode 100644 meta-emulator/recipes-nemomobile/mce/mce/0001-Keep-screen-on-by-default-on-emulator.patch create mode 100644 meta-emulator/recipes-nemomobile/mce/mce_%.bbappend diff --git a/meta-emulator/conf/layer.conf b/meta-emulator/conf/layer.conf new file mode 100644 index 00000000..2cd164f6 --- /dev/null +++ b/meta-emulator/conf/layer.conf @@ -0,0 +1,7 @@ +BBPATH .= ":${LAYERDIR}" +BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend" +BBFILES += "${LAYERDIR}/recipes*/*/*/*.bb ${LAYERDIR}/recipes*/*/*/*.bbappend" +BBFILE_COLLECTIONS += "emulator-layer" +BBFILE_PATTERN_emulator-layer := "^${LAYERDIR}/" +BBFILE_PRIORITY_emulator-layer = "8" +LAYERSERIES_COMPAT_emulator-layer = "mickledore" diff --git a/meta-emulator/conf/machine/emulator.conf b/meta-emulator/conf/machine/emulator.conf new file mode 100644 index 00000000..1bef0c5b --- /dev/null +++ b/meta-emulator/conf/machine/emulator.conf @@ -0,0 +1,23 @@ + +#@TYPE: Machine +#@NAME: emulator +#@DESCRIPTION: Machine configuration for the Qemu-based emulator. + +require conf/machine/qemux86.conf +# So we can re-use any qemux86-specific overrides in openembedded layers +MACHINEOVERRIDES:append = " qemuall: qemux86:" + +MACHINE_FEATURES:append = " alsa ext2 " + +IMAGE_FSTYPES:append = " ext4 " +IMAGE_ROOTFS_ALIGNMENT = "4" + +MACHINE_DISPLAY_ROUND = "false" +MACHINE_HAS_WLAN = "false" +MACHINE_HAS_SPEAKER = "true" +MACHINE_HAS_MICROPHONE = "false" + +KMACHINE = "qemux86" +PREFERRED_PROVIDER_virtual/kernel = "linux-yocto" +MACHINE_ESSENTIAL_EXTRA_RDEPENDS:append = " kernel-modules " +MACHINE_ESSENTIAL_EXTRA_RECOMMENDS:append = " kernel-modules " diff --git a/meta-emulator/recipes-asteroid/asteroid-launcher/asteroid-launcher-configs/kms-qemu.json b/meta-emulator/recipes-asteroid/asteroid-launcher/asteroid-launcher-configs/kms-qemu.json new file mode 100644 index 00000000..e7797146 --- /dev/null +++ b/meta-emulator/recipes-asteroid/asteroid-launcher/asteroid-launcher-configs/kms-qemu.json @@ -0,0 +1,6 @@ +{ + "device": "/dev/dri/card0", + "outputs": [ + { "name": "Virtual1", "mode": "800x800" } + ] +} diff --git a/meta-emulator/recipes-asteroid/asteroid-launcher/asteroid-launcher-configs/qemu.conf b/meta-emulator/recipes-asteroid/asteroid-launcher/asteroid-launcher-configs/qemu.conf new file mode 100644 index 00000000..21af44ff --- /dev/null +++ b/meta-emulator/recipes-asteroid/asteroid-launcher/asteroid-launcher-configs/qemu.conf @@ -0,0 +1,4 @@ +QT_QPA_PLATFORM=eglfs +QT_QPA_EGLFS_INTEGRATION=eglfs_kms +QT_IM_MODULE=qtvirtualkeyboard +QT_QPA_EGLFS_KMS_CONFIG=/var/lib/environment/compositor/kms-qemu.json diff --git a/meta-emulator/recipes-asteroid/asteroid-launcher/asteroid-launcher-configs_%.bbappend b/meta-emulator/recipes-asteroid/asteroid-launcher/asteroid-launcher-configs_%.bbappend new file mode 100644 index 00000000..ad2662b9 --- /dev/null +++ b/meta-emulator/recipes-asteroid/asteroid-launcher/asteroid-launcher-configs_%.bbappend @@ -0,0 +1,8 @@ +FILESEXTRAPATHS:prepend:emulator := "${THISDIR}/asteroid-launcher-configs:" +SRC_URI:append:emulator = " file://qemu.conf file://kms-qemu.json" + +do_install:append:emulator() { + # Overwrite the default config. + install -m 0644 ${WORKDIR}/qemu.conf ${D}/var/lib/environment/compositor/default.conf + install -m 0644 ${WORKDIR}/kms-qemu.json ${D}/var/lib/environment/compositor/ +} diff --git a/meta-emulator/recipes-asteroid/qml-asteroid/qml-asteroid/0001-Spinners-Disable-shaders-which-cause-all-sorts-of-pr.patch b/meta-emulator/recipes-asteroid/qml-asteroid/qml-asteroid/0001-Spinners-Disable-shaders-which-cause-all-sorts-of-pr.patch new file mode 100644 index 00000000..0e626957 --- /dev/null +++ b/meta-emulator/recipes-asteroid/qml-asteroid/qml-asteroid/0001-Spinners-Disable-shaders-which-cause-all-sorts-of-pr.patch @@ -0,0 +1,37 @@ +From 72ce1af1dda062594003083494e0c99111649234 Mon Sep 17 00:00:00 2001 +From: Florent Revest +Date: Sun, 3 Dec 2017 00:37:37 +0100 +Subject: [PATCH] Spinners: Disable shaders which cause all sorts of problems + on tetra + +--- + src/controls/qml/CircularSpinner.qml | 2 +- + src/controls/qml/Spinner.qml | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/controls/qml/CircularSpinner.qml b/src/controls/qml/CircularSpinner.qml +index 2dc3c6b..db19f83 100644 +--- a/src/controls/qml/CircularSpinner.qml ++++ b/src/controls/qml/CircularSpinner.qml +@@ -45,7 +45,7 @@ PathView { + visible: false + } + +- layer.enabled: true ++ layer.enabled: false + layer.effect: ShaderEffect { + fragmentShader: " + precision mediump float; +diff --git a/src/controls/qml/Spinner.qml b/src/controls/qml/Spinner.qml +index b7cd76b..62be3ec 100644 +--- a/src/controls/qml/Spinner.qml ++++ b/src/controls/qml/Spinner.qml +@@ -40,7 +40,7 @@ ListView { + visible: false + } + +- layer.enabled: true ++ layer.enabled: false + layer.effect: ShaderEffect { + fragmentShader: " + precision mediump float; diff --git a/meta-emulator/recipes-asteroid/qml-asteroid/qml-asteroid_%.bbappend b/meta-emulator/recipes-asteroid/qml-asteroid/qml-asteroid_%.bbappend new file mode 100644 index 00000000..61b31f46 --- /dev/null +++ b/meta-emulator/recipes-asteroid/qml-asteroid/qml-asteroid_%.bbappend @@ -0,0 +1,2 @@ +FILESEXTRAPATHS:prepend:emulator := "${THISDIR}/qml-asteroid:" +SRC_URI:append:emulator = " file://0001-Spinners-Disable-shaders-which-cause-all-sorts-of-pr.patch" diff --git a/meta-emulator/recipes-graphics/mesa/mesa_%.bbappend b/meta-emulator/recipes-graphics/mesa/mesa_%.bbappend new file mode 100644 index 00000000..45552899 --- /dev/null +++ b/meta-emulator/recipes-graphics/mesa/mesa_%.bbappend @@ -0,0 +1,2 @@ +PACKAGECONFIG:append:emulator = " gallium" +GALLIUMDRIVERS:append:emulator = ",virgl" diff --git a/meta-emulator/recipes-kernel/linux/linux-yocto/drm-virtio-gpu.cfg b/meta-emulator/recipes-kernel/linux/linux-yocto/drm-virtio-gpu.cfg new file mode 100644 index 00000000..5db61502 --- /dev/null +++ b/meta-emulator/recipes-kernel/linux/linux-yocto/drm-virtio-gpu.cfg @@ -0,0 +1 @@ +CONFIG_DRM_VIRTIO_GPU=y diff --git a/meta-emulator/recipes-kernel/linux/linux-yocto_%.bbappend b/meta-emulator/recipes-kernel/linux/linux-yocto_%.bbappend new file mode 100644 index 00000000..da60766d --- /dev/null +++ b/meta-emulator/recipes-kernel/linux/linux-yocto_%.bbappend @@ -0,0 +1,5 @@ +FILESEXTRAPATHS:prepend:emulator := "${THISDIR}/linux-yocto:" +SRC_URI:append:emulator = " file://drm-virtio-gpu.cfg " + +KERNEL_CONFIG_FRAGMENTS:append:emulator = " ${WORKDIR}/drm-virtio-gpu.cfg " +COMPATIBLE_MACHINE = "emulator" diff --git a/meta-emulator/recipes-nemomobile/mce/mce/0001-Keep-screen-on-by-default-on-emulator.patch b/meta-emulator/recipes-nemomobile/mce/mce/0001-Keep-screen-on-by-default-on-emulator.patch new file mode 100644 index 00000000..50bf36e0 --- /dev/null +++ b/meta-emulator/recipes-nemomobile/mce/mce/0001-Keep-screen-on-by-default-on-emulator.patch @@ -0,0 +1,22 @@ +From fb115fc533b8e1072d1b9c5b06e5f926ec99dac1 Mon Sep 17 00:00:00 2001 +From: Florent Revest +Date: Wed, 21 Feb 2018 15:54:02 +0100 +Subject: [PATCH] Keep screen on by default on emulator + +--- + modules/display.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/modules/display.h b/modules/display.h +index 8bd4513..43a0ae5 100644 +--- a/modules/display.h ++++ b/modules/display.h +@@ -434,7 +434,7 @@ typedef enum { + * logic without modifying the timeout values. + */ + # define MCE_SETTING_BLANKING_INHIBIT_MODE MCE_SETTING_DISPLAY_PATH "/inhibit_blank_mode" +-# define MCE_DEFAULT_BLANKING_INHIBIT_MODE 0 // = INHIBIT_OFF ++# define MCE_DEFAULT_BLANKING_INHIBIT_MODE 1 // = INHIBIT_ON + + /** Kbd slide inhibit type */ + typedef enum { diff --git a/meta-emulator/recipes-nemomobile/mce/mce_%.bbappend b/meta-emulator/recipes-nemomobile/mce/mce_%.bbappend new file mode 100644 index 00000000..0569f9a9 --- /dev/null +++ b/meta-emulator/recipes-nemomobile/mce/mce_%.bbappend @@ -0,0 +1,2 @@ +FILESEXTRAPATHS:prepend:emulator := "${THISDIR}/mce:" +SRC_URI:append:emulator = " file://0001-Keep-screen-on-by-default-on-emulator.patch "