summaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp
AgeCommit message (Collapse)AuthorFilesLines
2019-09-26raspberrypi4: Fix BluetoothLeon Anavi1-0/+1
Include recipe pi-bluetooth in the Raspberry Pi 4 images to enable Bluetooth. This recipe provides a script that starts automatically and properly configures BT-HCI. The same script is used in Raspbian. Bug-AGL: SPEC-2656 Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> Change-Id: Id650cb2f61ee63196cbd826e4a9dd73488b298c3
2019-09-25raspberrypi4: Fix WiFiLeon Anavi2-0/+49
Apply patch from branch master of meta-raspberrypi as a bbappend to recipe linux-firmware-rpidistro to fix WiFi on Raspberry Pi 4. This is a temporary solution while AGL master is still based on Thud. As soon as AGL moves to newer release of the Yocto Project and layer meta-raspberrypi this patch will become reduntant. The change of boardflags3 value from "0x48200100" to "0x44200100" has been done already in Raspbian (2019-06-20). For more details: https://github.com/RPi-Distro/firmware-nonfree/issues/3 Bug-AGL: SPEC-2656 Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> Change-Id: Ifaafbae6ff59a43f95926e64f1ce35aefadd3cfa
2019-09-20raspberrypi4: enable v3d and dependencies in mesaJan-Simon Möller1-0/+2
To enable the gfx acceleration, enable the necessary flags in mesa. Bug-AGL: SPEC-2656 Change-Id: I8bfb2f4034679f4703ddcb4bdb4c1363eee3d9d4 Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
2019-09-19mesa: Upgrade Mesa for Raspberry Pi 4Leon Anavi16-0/+2080
Bring Mesa 19.1.6 to meta-agl-bsp/meta-raspberrypi because there are driver issues with Mesa 18.1 for Raspberry Pi 4. The recipes for this new version are coming from the master branch of layer openembedded-core. With the newer version of Mesa Weston works fine on Raspberry Pi 4 and the home screen appears as expected. Bug-AGL: SPEC-2656 Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> Change-Id: I0d4f6e6fdff3c6ac54a72d19abfc292efcea7a3f
2019-09-16[RCAR] Update BSP 3.21 driverRonan Le Martret1-2/+2
Bug-AGL: SPEC-2784 Change-Id: I55e014a08fd315d3460672240c6ace1a2f31c55d Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
2019-09-13u-boot-2019.07: Fix for Raspberry Pi 4Leon Anavi10-5/+514
Following recent changes in the BSP the recipe for u-boot 2019.07 was failing to build for Raspberry Pi 4. This fix brings existing patches from master branch of meta-raspberrypi to AGL which is still based on Yocto project release Thud. Bug-AGL: SPEC-2656 Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> Change-Id: Ic544d02032198dc05da24bc3246e8911d300c1ea Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
2019-09-11meta-agl-bsp/meta-rcar-gen3: Update asound.state to pipewireHarunobu Kurokawa1-4/+4
pipewire is used default audio card volume. Current 50% of DVC Out is laudy and 0% of DVC In is small. Update 20% of DVC Out and 10% of DVC In for R-Car. Bug-AGL: SPEC-2808 Change-Id: Iac572255977d6a0111026a6426081efb0edbf0aa Signed-off-by: Harunobu Kurokawa <harunobu.kurokawa.dn@renesas.com>
2019-09-09meta-agl-bsp: meta-rcar-gen3-adas: Rework KF radio initializationScott Murray3-0/+39
Add a systemd service unit and recipe to install it and a udev rules file so that the Kingfisher Si4689 radio will be initialized on boot if present, and the I2C device to access it will be accessible to applications with the "audio" permission. Note that an accompanying change to agl-service-radio is required to remove its now unworkable usage of the si_init script, which is replaced by this change. Bug-AGL: SPEC-2716 Change-Id: I81cf4b8c439598bdac1eb7910a0d693825141d7b Signed-off-by: Scott Murray <scott.murray@konsulko.com>
2019-09-05Add nogfx build for h3ulcbJan-Simon Moeller1-0/+10
Before we can add the h3 to CI we need a -nogfx build. v3: leave the BBMASK in the board specific file due to inc file stacking. Change-Id: Ic59784aa143e3346d2f999060214411497fc1b54 Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
2019-09-04Revert "Add nogfx build for h3ulcb"Jan-Simon Moeller3-10/+5
This seems to have broken master. Needs to be edited. Thus revert and resubmit. This reverts commit dd21b3a6e340006d2ef4036cabf33c9e9a66e9ac. Change-Id: I2423dacba83813cc6350096c89d80cf1d23e9568
2019-09-03Add nogfx build for h3ulcbJan-Simon Moeller3-5/+10
Before we can add the h3 to CI we need a -nogfx build. v2: moved common bits Signed-off-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org> Change-Id: I9d64764fbe69dc901dc91941db1deb0073e2ae9c
2019-08-30agl_raspberrypi3.inc: Set CMA for SOTALeon Anavi1-0/+2
Add CMA to the kernel arguments in uEnv.txt for U-Boot in images with enabled feature agl-sota for software-over-the-air (SOTA) updates for Raspberry Pi 3 B/B+. Bug-AGL: SPEC-2729 Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> Change-Id: Id6914de6a41ebfd3fc28ca2948a15d891c9a30b3
2019-08-26linux: add netfilter.cfg fragmentMatt Ranostay2-0/+4
Add netfilter.cfg fragment that initially enables CONFIG_NETFILTER_XT_MATCH_OWNER to allow connman's session-policy-local to route traffic based on user id. Bug-AGL: SPEC-2772 Change-Id: I7fb642790709aff9899d42250b1b15f77451361e Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
2019-08-25Fix combined dtb names to match original filebuild.automotivelinux.org1-4/+4
Make the filenames conformant to the original files. Thanks to Khouloud Touil for finding this. Good catch! Change-Id: I1e4e95dc1148ddf1a9a3a09c22ceab75d1d88115 Bug-AGL: SPEC-2721 Signed-off-by: build.automotivelinux.org <jenkins@automotivelinux.org>
2019-08-23[RCAR] update to BSP v3.19.0Ronan Le Martret1-2/+2
Bug-AGL: SPEC-2680 Change-Id: Ie397c943762c20b0231ca7c0e44323bdf6101790 Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
2019-08-23Revert "setup_mm_packages.sh: Use GFX 3.19 binaries instead of 3.15"Ronan Le Martret1-51/+0
This reverts commit 9bc6c25f56f4997e55b60e969e9f942cc1859988. Bug-AGL: SPEC-2680 Change-Id: Ice72ff5f510ac848679c7d09ed4d0bde2d0940d7 Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
2019-08-15linux: add missing CONFIG_BT_HCIUART option to usb-devices.cfgMatt Ranostay1-0/+1
To allow dependant kernel drivers to be selected enable the CONFIG_BT_HCIUART option. Bug-AGL: SPEC-2747 Change-Id: Iafda86a9909ee14b10e4be2e5070bada4dfec9b0 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
2019-08-15linux: update config option to CONFIG_WLAN_VENDOR_TIMatt Ranostay1-1/+1
Bug-AGL: SPEC-2747 Change-Id: Ideef401474d8d74daf920273eb40200d4fe4dacd Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
2019-08-15linux: remove old kernel options in extra-graphics-device.cfgMatt Ranostay1-14/+0
Remove old kernel options that no longer exist in modern kernels, and also remove unset options that were causing warnings in the do_kernel_configcheck task. Bug-AGL: SPEC-2747 Change-Id: Iea61c2e4a1341d8f77723c37619ea6c9c59365d3 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
2019-08-15linux: add CONFIG_IIO_TRIGGERED_BUFFER=m to iiodevice.cfgMatt Ranostay1-1/+2
To avoid CONFIG_IIO_TRIGGERED_BUFFER being set as a builtin by default causing a do_kernel_configcheck warning build as module. Bug-AGL: SPEC-2747 Change-Id: Ide4011c25eb781daf135690205fef1cd591ea186 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
2019-08-15linux: update options in ath9k_htc.cfgMatt Ranostay1-1/+1
Newer kernels have different configuration options names for WLAN drivers, and need to be updated. Bug-AGL: SPEC-2747 Change-Id: Ic35957172cec758a64219981a11ce155d296ca91 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
2019-08-12uEnv.txt: Modify uEnv.txt for SOTALeon Anavi2-14/+42
Modify uEnv.txt and uEnv.cma.txt according to the recent changes in layers meta-updater and meta-updater-raspberrypi to ensure that AGL image with agl-sota feature will boot properly on Raspberry Pi 3 B/B+. Bug-AGL: SPEC-2729 Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> Change-Id: Ib8fe74bcd6e12208aaddc81f608fe84eee9de601
2019-08-12u-boot_2019.07.bbappend: Apply patch for AGL SOTALeon Anavi2-0/+88
Recently we have updated u-boot to version 2019.07 to support Raspberry Pi 4 in AGL based on Yocto release Thud. Therefore a new version of the patch from meta-updater-raspberrypi branch warrior has to be applied to successfully build U-Boot when feature agl-sota is enabled. Bug-AGL: SPEC-2729 Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> Change-Id: Ie72cc9b81ff6e041cfe6edb26f383b7e0d43d8f9
2019-08-12create-combined-dtb: Check if DTB files existLeon Anavi1-8/+20
Check if files exist before creating and deploying DTB. In some cases, for example with AGL SOTA, the DTB and DTBO files might not exist and without checks the recipe will fail. Bug-AGL: SPEC-2729, SPEC-1775 Change-Id: Id96e0c56989569feead076406534334766604cfd Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
2019-08-06meta-agl-bsp: recipes-kernel: linux: Add USB host driverCorentin Labbe1-0/+3
Both qemuarm and qemuarm64 builds lack USB drivers. This patch enable basic USB drivers necessary for them. Change-Id: I35064b0b4018c0953c609cebcab102b898d04f70 Bug-AGL: SPEC-2722 Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
2019-08-02wayland-ivi-extension: disable building EGLWLMockNavigation exampleScott Murray2-18/+0
Disable building the EGLWLMockNavigation in wayland-ivi-extension to avoid needing to patch it to build for the TI platforms. This fixes the issue of meta-agl-bsp/meta-ti breaking non-graphics profile builds like the telematics profile, and seems reasonable since there are no known users inside AGL. Since it is no longer needed, also remove the offending patch from meta-agl-bsp/meta-ti. Bug-AGL: SPEC-2677 Change-Id: If87c3c238e880d01f99401ea4610616656f16185 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
2019-08-01meta-rcar-gen3-adas: improve BBFILE descriptionHarunobu Kurokawa1-1/+1
To avoid the followings warning. WARNING: No bb files matched BBFILE_PATTERN_rcar-gen3-cogent Bug-AGL: SPEC-2708 Change-Id: I4bebc3203f947834b9264b4f79b0856c908af493 Signed-off-by: Harunobu Kurokawa <harunobu.kurokawa.dn@renesas.com>
2019-07-25intel-corei7-64: Remove ttyS2 from SERIAL_CONSOLESScott Murray1-0/+2
Remove ttyS2 from SERIAL_CONSOLES in the intel-corei7-64 include file. This quiets the log spamming on Up^2 from the device not being present. The commit that added ttyS2 to SERIAL_CONSOLES in meta-intel (61634f8) does not explain what boards need it, but since neither the minnowboard or Up^2 do, not having it by default seems reasonable. Bug-AGL: SPEC-2678 Change-Id: I9afd1584dd7b92e8d15363c3119b770c592b3c52 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
2019-07-24Fix i.MX6 multiple package tuning problemScott Murray3-0/+15
Update the i.MX6 machine definition include files to disable the dynamic package architecture logic in meta-freescale, as it conflicts with AGL's setting of DEFAULTTUNE and results in a split package feed. Bug-AGL: SPEC-2665 Change-Id: I66ff03b0bc48b3b768b9ec88c907eaa95e1a2b00 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
2019-07-24bcm2835-bootfiles.bbappend: Support Raspberry Pi 4Leon Anavi1-0/+11
Use different bootfiles if the machine has been set to the new Raspberry Pi 4 and keep the old files for Raspberry Pi 3. Bug-AGL: SPEC-2656 Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> Change-Id: I3cbacc45c0f82ce2c70641c008ad2975a9e58fbd
2019-07-24rpi-config_git.bbappend: Update for Raspberry Pi 4Leon Anavi1-0/+20
Extend the deploy task to support Rasppberry Pi 4. Bug-AGL: SPEC-2656 Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> Change-Id: I3a166a873b431539e154ef6a2b1e69df02a0f2a3
2019-07-24u-boot_2019.07: Bootloader for Raspberry Pi 4Leon Anavi6-0/+457
Add U-Boot version that supports Raspberry Pi 4. Bug-AGL: SPEC-2656 Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> Change-Id: Ib550e38c7ecaf0ab2149b04666cffdcbaaf08134
2019-07-24linux-raspberrypi: Add 4.19 for Raspberry Pi 4Leon Anavi5-1/+158
Add recipe for Linux kernel 4.19 for Raspberry Pi 4 and keep 4.14 for Raspberry Pi 3. The recipe for 4.19 is backported from master branch of the upstream of meta-raspberrypi. Bug-AGL: SPEC-2656 Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> Change-Id: I93bbc5527383e26862894859bff6e44a6bc17966 Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
2019-07-24raspberrypi4.conf: Add machine definitionLeon Anavi1-0/+25
Add a new machine definition for Raspberry Pi 4 because it is not present in branch thud of meta-raspberrypi. This machine definition is taken from the master branch of the upstream of Yocto/OE layer meta-raspberrypi. Bug-AGL: SPEC-2656 Signed-off-by: Leon Anavi <leon.anavi@konsulko.com> Change-Id: I368f6c7107ca023da66ce60d2006984f8939cf00
2019-07-23linux-renesas: Add ADSP patch only for m3ulcbPierre Marzin1-1/+1
The patch are only used for the m3ulcb machine. Bug-AGL: SPEC-2564 Change-Id: Idfca2b7a48b7a53efee6dcf2f21b0f8932d7b43d Signed-off-by: Pierre Marzin <pierre.marzin@iot.bzh>
2019-07-23machine: Add new ebisu machinePierre Marzin4-1/+19
* Add ebisu dependency within renesas bootfiles * Delete rcar ADAS layers support * Add weston video output config * Add missing modules and gst plugin Bug-AGL: SPEC-2564 Change-Id: I61a44f831d0bc55210847eade2a1eacc7599fa74 Signed-off-by: Pierre Marzin <pierre.marzin@iot.bzh>
2019-07-13Revert "Fix rpi touchscreen support on master"Jan-Simon Moeller9-1120/+4
We need to reconsider this changeset. It seems to produce a regression. This reverts commit ccb667c35ffdea7a2bc1304750e6b22368cd55f7. Change-Id: I42754a899e8530f4e18a069ed227f18a8d615801
2019-06-27linux-agl: change aloop to a module instead of built-inScott Murray2-4/+4
Rename the 4a-sound.cfg fragment to the more generic sound.cfg, and change CONFIG_SND_ALOOP to module, not built-in. This still keeps it available if something ends up needing it. Bug-AGL: SPEC-2555 Change-Id: Ib0554800dc704d19b48a7e041d4f2b60a1b42192 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
2019-06-23Move the agl-service-radio to the graphical profileJan-Simon Möller1-5/+0
The agl-service-radio relies on gstreamer. Unfortunately the gstreamer recipe is currently setup to also pull-in wayland (due to a compile-flag if wayland is in DISTRO_FEATURES). To keep the distro aligned, we don't want to change the DISTRO_FEATURES between the profiles, thus we move the agl-service radio to the graphical profile where we include weston anyway by default. For now this means there is no radio service (or mediaplayer service) w/o wayland installed as well. In case we get this requirement, we'll have to work on the gstreamer recipe and its split. v2: fix bbapend in meta-agl-bsp/meta-rcar-gen3 v3: put packagegroup-agl-graphical-multimedia.bbappend in graphical profile (not the best place IMHO) This fixes the non-graphical build. Bug-AGL: SPEC-2500 Change-Id: I5ebec7d7713510f3fcd50ae425d7f8cbb6328016 Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
2019-06-21SPEC-2376: Add config for QEMU arm kernelsCorentin Labbe3-0/+11
The default yocto qemuarm machine is versatilepb which is not the right choice for AGL (ex: Max 256M of RAM). This patchs change qemuarm configs for using the virt machine. Change-Id: Ib5e0ae801ba152318a2455763b1a2f1020d1858e Bug-AGL: SPEC-2376 Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
2019-06-20meta-rcar-gen3/setup_mm_packages.sh: always clean workdirStephane Desneux1-0/+6
The script setup_mm_packages.sh setups a temp dir to extract proprietary drivers for Renesas BSP, but it's not re-entrant: the temp dir is not cleaned after execution. With the introduction of the change 9bc6c25 (hotfix for GFX issues), more cleanup is needed to avoid duplicate zips detection in the copy script located in meta-rcar-gen3/docs/sample/copyscript/copy_evaproprietary_softwares.sh This change makes some initial cleanup in the workdir (in case of transition from a previous script without this patch) and also removes the workdir at the end Bug-AGL: SPEC-2253, SPEC-2480 Change-Id: Ia95f9045d8a695d550a061710a17676088a92c0a Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
2019-06-20Add cubox-i and nitrogen6x i.MX6 machinesScott Murray3-0/+44
Add the cubox-i (covering SolidRun Cubox-i, Hummingboard Gate and Edge), and nitrogen6x (covering Nitrogen 6x and SABRE Lite) machine definitions. Note that support for the Broadcom Bluetooth chipset on the SolidRun i.MX6 SOM is currently missing, as it requires firmware that is not available in either the linux-firmware package or from the firmware packages provided by meta-freescale. Bug-AGL: SPEC-2517 Change-Id: If7bdb9f1af9bb67dba5c1ff836a6d3b04160fefd Signed-off-by: Scott Murray <scott.murray@konsulko.com>
2019-06-20meta-agl-bsp: Changes to get imx6qdlsabreauto working with etnavivScott Murray5-29/+49
Update imx6qdlsabreauto configuration to use open source etnaviv GPU driver instead of Vivante. The previously required weston-ini-conf has been removed as it is not required with etnaviv, and a bbappend has been added for the linux-fslc kernel that this configuration uses so it will pull in the AGL kernel bits. Additionally, the kernel configuration for linux-fslc is tweaked with config fragments to better match the other AGL platforms. Bug-AGL: SPEC-1674, SPEC-2502 Change-Id: Ic40d310b48405ccc7d1435f0fc9f162a129cffe9 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
2019-06-11Merge "Do not pull pulseaudio-misc if pulseaudio is not enabled"Jan-Simon Moeller1-1/+1
2019-06-11Merge "Import aglsetup templates and config for BBE"Jan-Simon Moeller1-0/+43
2019-06-12Do not pull pulseaudio-misc if pulseaudio is not enabledJan-Simon Möller1-1/+1
This fixes a build issue on ti vayu Missing or unbuildable dependency chain was: ['agl-demo-platform', 'pulseaudio-misc', 'alsa-plugins-pulseaudio-conf'] Bug-AGL: SPEC-2473 Change-Id: I9f9c85893b30a8aa98a6da1e76440a0df5076fa2 Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
2019-06-11Update weston ini file to adopt remoting pluginHarunobu Kurokawa1-7/+4
Bug-AGL : SPEC-2420 To use remoting plugin, we should use new section in weston.ini. Example) [remote-output] name=remote-1 mode=384x368@30 host=192.168.10.30 port=5005 Man) https://gitlab.freedesktop.org/wayland/weston/blob/master/man/weston-drm.man#L149 https://gitlab.freedesktop.org/wayland/weston/merge_requests/7 Change-Id: Ifc271867dd2b1f2fe1794a08af188006f7b7779b Signed-off-by: Harunobu Kurokawa <harunobu.kurokawa.dn@renesas.com>
2019-06-11Import aglsetup templates and config for BBEPaul Barker1-0/+43
The templates and config include files used with aglsetup.sh to build for the Sancloud BBE are imported from the meta-sancloud layer. This should make future maintenance easier. The templates are updated to match the new repository structure at the same time. Bug-AGL: SPEC-2507 Change-Id: I2b4717bd79d949a12b13e6bfece152e82bb8114c Signed-off-by: Paul Barker <paul.barker@sancloud.co.uk>
2019-06-10Merge "Changes to support the repo clone rework"Jan-Simon Moeller2-5/+5
2019-06-10Changes to support the repo clone reworkJan-Simon Möller2-5/+5
To be merged together with: https://gerrit.automotivelinux.org/gerrit/#/c/AGL/AGL-repo/+/21389/ v2: fix the aglsetup script v3: fix scripts to extract m3ulcb v4: use single folder for BSPs Bug-AGL: SPEC-2450 Change-Id: I3227896c68ec1413f55cf67ad8f15a7adfe87a52 Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
lass="n">errmsg) { if (errmsg != nullptr) { HMI_ERROR("wm", errmsg); return; } }); g_afb_instance->wmgr.removeClient(ctxt->name); delete ctxt; } static void createSecurityContext(afb_req req, const char* appid, const char* role) { WMClientCtxt *ctxt = (WMClientCtxt *)afb_req_context_get(req); if (!ctxt) { // Create Security Context at first time const char *new_role = g_afb_instance->wmgr.convertRoleOldToNew(role); WMClientCtxt *ctxt = new WMClientCtxt(appid, new_role); HMI_DEBUG("wm", "create session for %s", ctxt->name.c_str()); afb_req_session_set_LOA(req, 1); afb_req_context_set(req, ctxt, cbRemoveClientCtxt); } } void windowmanager_requestsurface(afb_req req) noexcept { std::lock_guard<std::mutex> guard(binding_m); #ifdef ST ST(); #endif if (g_afb_instance == nullptr) { afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?"); return; } try { const char *a_drawing_name = afb_req_value(req, "drawing_name"); if (!a_drawing_name) { afb_req_fail(req, "failed", "Need char const* argument drawing_name"); return; } const char *appid = afb_req_get_application_id(req); auto ret = g_afb_instance->wmgr.api_request_surface( appid, a_drawing_name); if (ret.is_err()) { afb_req_fail(req, "failed", ret.unwrap_err()); return; } createSecurityContext(req, appid, a_drawing_name); afb_req_success(req, json_object_new_int(ret.unwrap()), "success"); } catch (std::exception &e) { afb_req_fail_f(req, "failed", "Uncaught exception while calling requestsurface: %s", e.what()); return; } } void windowmanager_requestsurfacexdg(afb_req req) noexcept { std::lock_guard<std::mutex> guard(binding_m); #ifdef ST ST(); #endif if (g_afb_instance == nullptr) { afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?"); return; } try { json_object *jreq = afb_req_json(req); json_object *j_drawing_name = nullptr; if (!json_object_object_get_ex(jreq, "drawing_name", &j_drawing_name)) { afb_req_fail(req, "failed", "Need char const* argument drawing_name"); return; } char const *a_drawing_name = json_object_get_string(j_drawing_name); json_object *j_ivi_id = nullptr; if (!json_object_object_get_ex(jreq, "ivi_id", &j_ivi_id)) { afb_req_fail(req, "failed", "Need char const* argument ivi_id"); return; } char const *a_ivi_id = json_object_get_string(j_ivi_id); char const *appid = afb_req_get_application_id(req); auto ret = g_afb_instance->wmgr.api_request_surface( appid, a_drawing_name, a_ivi_id); if (ret != nullptr) { afb_req_fail(req, "failed", ret); return; } createSecurityContext(req, appid, a_drawing_name); afb_req_success(req, NULL, "success"); } catch (std::exception &e) { afb_req_fail_f(req, "failed", "Uncaught exception while calling requestsurfacexdg: %s", e.what()); return; } } void windowmanager_activatewindow(afb_req req) noexcept { std::lock_guard<std::mutex> guard(binding_m); #ifdef ST ST(); #endif if (g_afb_instance == nullptr) { afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?"); return; } try { const char *a_drawing_name = afb_req_value(req, "drawing_name"); if (!a_drawing_name) { afb_req_fail(req, "failed", "Need char const* argument drawing_name"); return; } const char *a_drawing_area = afb_req_value(req, "drawing_area"); if (!a_drawing_area) { afb_req_fail(req, "failed", "Need char const* argument drawing_area"); return; } g_afb_instance->wmgr.api_activate_surface( afb_req_get_application_id(req), a_drawing_name, a_drawing_area, [&req](const char *errmsg) { if (errmsg != nullptr) { HMI_ERROR("wm", errmsg); afb_req_fail(req, "failed", errmsg); return; } afb_req_success(req, NULL, "success"); }); } catch (std::exception &e) { HMI_WARNING("wm", "failed: Uncaught exception while calling activatesurface: %s", e.what()); g_afb_instance->wmgr.exceptionProcessForTransition(); return; } } void windowmanager_deactivatewindow(afb_req req) noexcept { std::lock_guard<std::mutex> guard(binding_m); #ifdef ST ST(); #endif if (g_afb_instance == nullptr) { afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?"); return; } try { const char *a_drawing_name = afb_req_value(req, "drawing_name"); if (!a_drawing_name) { afb_req_fail(req, "failed", "Need char const* argument drawing_name"); return; } g_afb_instance->wmgr.api_deactivate_surface( afb_req_get_application_id(req), a_drawing_name, [&req](const char *errmsg) { if (errmsg != nullptr) { HMI_ERROR("wm", errmsg); afb_req_fail(req, "failed", errmsg); return; } afb_req_success(req, NULL, "success"); }); } catch (std::exception &e) { HMI_WARNING("wm", "failed: Uncaught exception while calling deactivatesurface: %s", e.what()); g_afb_instance->wmgr.exceptionProcessForTransition(); return; } } void windowmanager_enddraw(afb_req req) noexcept { std::lock_guard<std::mutex> guard(binding_m); #ifdef ST ST(); #endif if (g_afb_instance == nullptr) { afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?"); return; } try { const char *a_drawing_name = afb_req_value(req, "drawing_name"); if (!a_drawing_name) { afb_req_fail(req, "failed", "Need char const* argument drawing_name"); return; } afb_req_success(req, NULL, "success"); g_afb_instance->wmgr.api_enddraw( afb_req_get_application_id(req), a_drawing_name); } catch (std::exception &e) { HMI_WARNING("wm", "failed: Uncaught exception while calling enddraw: %s", e.what()); g_afb_instance->wmgr.exceptionProcessForTransition(); return; } } void windowmanager_getdisplayinfo_thunk(afb_req req) noexcept { std::lock_guard<std::mutex> guard(binding_m); #ifdef ST ST(); #endif if (g_afb_instance == nullptr) { afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?"); return; } try { auto ret = g_afb_instance->wmgr.api_get_display_info(); if (ret.is_err()) { afb_req_fail(req, "failed", ret.unwrap_err()); return; } afb_req_success(req, ret.unwrap(), "success"); } catch (std::exception &e) { afb_req_fail_f(req, "failed", "Uncaught exception while calling getdisplayinfo: %s", e.what()); return; } } void windowmanager_getareainfo_thunk(afb_req req) noexcept { std::lock_guard<std::mutex> guard(binding_m); #ifdef ST ST(); #endif if (g_afb_instance == nullptr) { afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?"); return; } try { json_object *jreq = afb_req_json(req); json_object *j_drawing_name = nullptr; if (!json_object_object_get_ex(jreq, "drawing_name", &j_drawing_name)) { afb_req_fail(req, "failed", "Need char const* argument drawing_name"); return; } char const *a_drawing_name = json_object_get_string(j_drawing_name); auto ret = g_afb_instance->wmgr.api_get_area_info(a_drawing_name); if (ret.is_err()) { afb_req_fail(req, "failed", ret.unwrap_err()); return; } afb_req_success(req, ret.unwrap(), "success"); } catch (std::exception &e) { afb_req_fail_f(req, "failed", "Uncaught exception while calling getareainfo: %s", e.what()); return; } } void windowmanager_wm_subscribe(afb_req req) noexcept { std::lock_guard<std::mutex> guard(binding_m); #ifdef ST ST(); #endif if (g_afb_instance == nullptr) { afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?"); return; } try { json_object *jreq = afb_req_json(req); json_object *j = nullptr; if (!json_object_object_get_ex(jreq, "event", &j)) { afb_req_fail(req, "failed", "Need char const* argument event"); return; } int event_type = json_object_get_int(j); const char *event_name = g_afb_instance->wmgr.kListEventName[event_type]; struct afb_event event = g_afb_instance->wmgr.map_afb_event[event_name]; int ret = afb_req_subscribe(req, event); if (ret) { afb_req_fail(req, "failed", "Error: afb_req_subscribe()"); return; } afb_req_success(req, NULL, "success"); } catch (std::exception &e) { afb_req_fail_f(req, "failed", "Uncaught exception while calling wm_subscribe: %s", e.what()); return; } } void windowmanager_list_drawing_names(afb_req req) noexcept { std::lock_guard<std::mutex> guard(binding_m); #ifdef ST ST(); #endif if (g_afb_instance == nullptr) { afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?"); return; } try { nlohmann::json j = g_afb_instance->wmgr.id_alloc.name2id; auto ret = wm::Ok(json_tokener_parse(j.dump().c_str())); if (ret.is_err()) { afb_req_fail(req, "failed", ret.unwrap_err()); return; } afb_req_success(req, ret.unwrap(), "success"); } catch (std::exception &e) { afb_req_fail_f(req, "failed", "Uncaught exception while calling list_drawing_names: %s", e.what()); return; } } void windowmanager_ping(afb_req req) noexcept { std::lock_guard<std::mutex> guard(binding_m); #ifdef ST ST(); #endif if (g_afb_instance == nullptr) { afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?"); return; } try { g_afb_instance->wmgr.api_ping(); afb_req_success(req, NULL, "success"); } catch (std::exception &e) { afb_req_fail_f(req, "failed", "Uncaught exception while calling ping: %s", e.what()); return; } } void windowmanager_debug_status(afb_req req) noexcept { std::lock_guard<std::mutex> guard(binding_m); #ifdef ST ST(); #endif if (g_afb_instance == nullptr) { afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?"); return; } try { json_object *jr = json_object_new_object(); json_object_object_add(jr, "surfaces", to_json(g_afb_instance->wmgr.controller->sprops)); json_object_object_add(jr, "layers", to_json(g_afb_instance->wmgr.controller->lprops)); afb_req_success(req, jr, "success"); } catch (std::exception &e) { afb_req_fail_f(req, "failed", "Uncaught exception while calling debug_status: %s", e.what()); return; } } void windowmanager_debug_layers(afb_req req) noexcept { std::lock_guard<std::mutex> guard(binding_m); #ifdef ST ST(); #endif if (g_afb_instance == nullptr) { afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?"); return; } try { auto ret = wm::Ok(json_tokener_parse(g_afb_instance->wmgr.layers.to_json().dump().c_str())); afb_req_success(req, ret, "success"); } catch (std::exception &e) { afb_req_fail_f(req, "failed", "Uncaught exception while calling debug_layers: %s", e.what()); return; } } void windowmanager_debug_surfaces(afb_req req) noexcept { std::lock_guard<std::mutex> guard(binding_m); #ifdef ST ST(); #endif if (g_afb_instance == nullptr) { afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?"); return; } try { auto ret = wm::Ok(to_json(g_afb_instance->wmgr.controller->sprops)); if (ret.is_err()) { afb_req_fail(req, "failed", ret.unwrap_err()); return; } afb_req_success(req, ret.unwrap(), "success"); } catch (std::exception &e) { afb_req_fail_f(req, "failed", "Uncaught exception while calling debug_surfaces: %s", e.what()); return; } } void windowmanager_debug_terminate(afb_req req) noexcept { std::lock_guard<std::mutex> guard(binding_m); #ifdef ST ST(); #endif if (g_afb_instance == nullptr) { afb_req_fail(req, "failed", "Binding not initialized, did the compositor die?"); return; } try { if (getenv("WINMAN_DEBUG_TERMINATE") != nullptr) { raise(SIGKILL); // afb-daemon kills it's pgroup using TERM, which // doesn't play well with perf } afb_req_success(req, NULL, "success"); } catch (std::exception &e) { afb_req_fail_f(req, "failed", "Uncaught exception while calling debug_terminate: %s", e.what()); return; } } const struct afb_verb_v2 windowmanager_verbs[] = { {"requestsurface", windowmanager_requestsurface, nullptr, nullptr, AFB_SESSION_NONE}, {"requestsurfacexdg", windowmanager_requestsurfacexdg, nullptr, nullptr, AFB_SESSION_NONE}, {"activatewindow", windowmanager_activatewindow, nullptr, nullptr, AFB_SESSION_NONE}, {"deactivatewindow", windowmanager_deactivatewindow, nullptr, nullptr, AFB_SESSION_NONE}, {"enddraw", windowmanager_enddraw, nullptr, nullptr, AFB_SESSION_NONE}, {"getdisplayinfo", windowmanager_getdisplayinfo_thunk, nullptr, nullptr, AFB_SESSION_NONE}, {"getareainfo", windowmanager_getareainfo_thunk, nullptr, nullptr, AFB_SESSION_NONE}, {"wm_subscribe", windowmanager_wm_subscribe, nullptr, nullptr, AFB_SESSION_NONE}, {"list_drawing_names", windowmanager_list_drawing_names, nullptr, nullptr, AFB_SESSION_NONE}, {"ping", windowmanager_ping, nullptr, nullptr, AFB_SESSION_NONE}, {"debug_status", windowmanager_debug_status, nullptr, nullptr, AFB_SESSION_NONE}, {"debug_layers", windowmanager_debug_layers, nullptr, nullptr, AFB_SESSION_NONE}, {"debug_surfaces", windowmanager_debug_surfaces, nullptr, nullptr, AFB_SESSION_NONE}, {"debug_terminate", windowmanager_debug_terminate, nullptr, nullptr, AFB_SESSION_NONE}, {}}; extern "C" const struct afb_binding_v2 afbBindingV2 = { "windowmanager", nullptr, nullptr, windowmanager_verbs, nullptr, binding_init, nullptr, 0};