Message ID | 20240627193335.4069574-2-aperez@igalia.com |
---|---|
State | Changes Requested |
Headers | show |
Series | [v2,1/4] package/wpebackend-rdk: new package | expand |
Hello Adrian, On Thu, 27 Jun 2024 22:33:29 +0300 Adrian Perez de Castro <aperez@igalia.com> wrote: > The wpebackend-rdk can be used as an alternative to wpebackend-fdo in > some cases, and also supports a few additional configurations. For now > only the Wayland-EGL and Broadcom RaspberryPi userland implementations > can be enabled. The former is useful for testing, and the latter allows > using WPE WebKit directly on top of Dispmanx in combination with the > rpi-userland package in supported RaspberryPi models. > > This only adds the new package, follow-up commits will un-hardcode the > usage of wpebackend-fdo and allow selecting either which of both to > build. > > Signed-off-by: Adrian Perez de Castro <aperez@igalia.com> I wanted to merge this, but unfortunately: BR2_arm=y BR2_cortex_a9=y BR2_ARM_ENABLE_VFP=y BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y BR2_INIT_NONE=y BR2_SYSTEM_BIN_SH_NONE=y # BR2_PACKAGE_BUSYBOX is not set BR2_PACKAGE_RPI_USERLAND=y BR2_PACKAGE_WPEBACKEND_RDK=y # BR2_TARGET_ROOTFS_TAR is not set fails to build with: In file included from /home/thomas/projets/buildroot/output/build/wpebackend-rdk-4.4.1/src/bcm-rpi/view-backend.cpp:30: /home/thomas/projets/buildroot/output/build/wpebackend-rdk-4.4.1/src/input/Libinput/LibinputServer.h:37:10: fatal error: libudev.h: No such file or directory 37 | #include <libudev.h> | ^~~~~~~~~~~ compilation terminated. as far as I can see, LibinputServer.h includes <libinput.h> and <libudev.h>: #ifndef KEY_INPUT_HANDLING_VIRTUAL #include <libudev.h> #include <libinput.h> #else #include <virtualinput.h> #endif whenever KEY_INPUT_HANDLING_VIRTUAL is *NOT* defined. And KEY_INPUT_HANDLING_VIRTUAL is only defined when USE_VIRTUAL_KEYBOARD=ON. I believe you should also properly use the USE_INPUT_UDEV and USE_INPUT_WAYLAND options. find_package(Libxkbcommon REQUIRED) libxkbcommon is also a mandatory dependency. Even though it is indirectly pulled in by libwpe, it should be expressed as a direct dependency of wpebackend-rdk. > --- > package/Config.in | 1 + > package/wpebackend-rdk/Config.in | 57 ++++++++++++++++++++++ > package/wpebackend-rdk/wpebackend-rdk.hash | 5 ++ > package/wpebackend-rdk/wpebackend-rdk.mk | 43 ++++++++++++++++ > 4 files changed, 106 insertions(+) Please add yourself in the DEVELOPERS file for this package. > diff --git a/package/wpebackend-rdk/Config.in b/package/wpebackend-rdk/Config.in > new file mode 100644 > index 00000000000..6125911bec9 > --- /dev/null > +++ b/package/wpebackend-rdk/Config.in > @@ -0,0 +1,57 @@ > +comment "wpebackend-rdk needs a toolchain w/ C++, wchar, threads, dynamic library, and rpi-userland or an OpenGL-capable Wayland backend" > + depends on !(BR2_PACKAGE_RPI_USERLAND || BR2_PACKAGE_HAS_LIBEGL_WAYLAND) \ > + || !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR \ > + || !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS Please split this into two comments, one for the toolchain things, one for the rpi-userland || wayland EGL. Also, the option BR2_PACKAGE_HAS_LIBEGL_WAYLAND is gone, see commit 4fad6b3c58abd20c533b67b85658bc66d015110b. You can use BR2_PACKAGE_HAS_LIBEGL && BR2_PACKAGE_WAYLAND instead. This needs to be fixed globally. > +config BR2_PACKAGE_WPEBACKEND_RDK > + bool "wpebackend-rdk" > + depends on !BR2_STATIC_LIBS # wayland > + depends on BR2_INSTALL_LIBSTDCPP > + depends on BR2_TOOLCHAIN_HAS_THREADS # wayland, libglib2 > + depends on BR2_USE_WCHAR # libglib2 > + depends on BR2_USE_MMU # libglib2 > + depends on BR2_PACKAGE_RPI_USERLAND || BR2_PACKAGE_HAS_LIBEGL_WAYLAND > + select BR2_PACKAGE_LIBGLIB2 > + select BR2_PACKAGE_LIBWPE > + help > + WPEBackend interface supporting a number of configurations. Would be nice to have a slightly extended explanation for the poor souls like that are very confused by libwpe vs. wpebackend-fdo vs. wpebackend-rdk vs. wpewebkit vs. webkitgtk. > +if BR2_PACKAGE_WPEBACKEND_RDK > + > +choice > + prompt Implementation Double quotes around "Implementation". Maybe it should be "Backend" instead of "Implementation"? > + default BR2_PACKAGE_WPEBACKEND_RDK_IMPL_BRCM_RPI if BR2_PACKAGE_RPI_USERLAND > + default BR2_PACKAGE_WPEBACKEND_RDK_IMPL_WAYLAND_EGL if BR2_PACKAGE_HAS_LIBEGL_WAYLAND > + > +comment "brcm-rpi needs rpi-userland" > + depends on !BR2_PACKAGE_RPI_USERLAND || !BR2_arm better expressed as: depends on BR2_arm depends on !BR2_PACKAGE_RPI_USERLAND > + > +config BR2_PACKAGE_WPEBACKEND_RDK_IMPL_BRCM_RPI > + bool "brcm-rpi" > + depends on BR2_arm > + depends on BR2_PACKAGE_RPI_USERLAND > + help > + Build RaspberryPi support using Broadcom's rpi-userland. > + > +comment "wayland-egl needs an EGL capable Wayland implementation" > + depends on !BR2_PACKAGE_HAS_LIBEGL_WAYLAND > + > +config BR2_PACKAGE_WPEBACKEND_RDK_IMPL_WAYLAND_EGL > + bool "wayland-egl" > + depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND > + help > + Build Wayland-EGL support. > + > +endchoice > + > +if BR2_PACKAGE_WPEBACKEND_RDK_IMPL_BRCM_RPI > + > +config BR2_PACKAGE_WPEBACKEND_RDK_LIBINPUT > + bool "libinput support" > + select BR2_PACKAGE_LIBINPUT > + help > + Support keyboard and mouse input through libinput Why is the keyboard/mouse support with libinput only available with the brcm-rpi backend? Reading the CMakeLists.txt, I don't really see any relationship. Could you fix up those different issues and submit a v3 ? Thanks a lot! Thomas Petazzoni
Hi! On Fri, 02 Aug 2024 23:00:13 +0200 Thomas Petazzoni via buildroot <buildroot@buildroot.org> wrote: > On Thu, 27 Jun 2024 22:33:29 +0300 > Adrian Perez de Castro <aperez@igalia.com> wrote: > > > The wpebackend-rdk can be used as an alternative to wpebackend-fdo in > > some cases, and also supports a few additional configurations. For now > > only the Wayland-EGL and Broadcom RaspberryPi userland implementations > > can be enabled. The former is useful for testing, and the latter allows > > using WPE WebKit directly on top of Dispmanx in combination with the > > rpi-userland package in supported RaspberryPi models. > > > > This only adds the new package, follow-up commits will un-hardcode the > > usage of wpebackend-fdo and allow selecting either which of both to > > build. > > > > Signed-off-by: Adrian Perez de Castro <aperez@igalia.com> > > I wanted to merge this, but unfortunately: > > BR2_arm=y > BR2_cortex_a9=y > BR2_ARM_ENABLE_VFP=y > BR2_TOOLCHAIN_EXTERNAL=y > BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y > BR2_INIT_NONE=y > BR2_SYSTEM_BIN_SH_NONE=y > # BR2_PACKAGE_BUSYBOX is not set > BR2_PACKAGE_RPI_USERLAND=y > BR2_PACKAGE_WPEBACKEND_RDK=y > # BR2_TARGET_ROOTFS_TAR is not set > > fails to build with: > > In file included from /home/thomas/projets/buildroot/output/build/wpebackend-rdk-4.4.1/src/bcm-rpi/view-backend.cpp:30: > /home/thomas/projets/buildroot/output/build/wpebackend-rdk-4.4.1/src/input/Libinput/LibinputServer.h:37:10: fatal error: libudev.h: No such file or directory > 37 | #include <libudev.h> > | ^~~~~~~~~~~ > compilation terminated. > > as far as I can see, LibinputServer.h includes <libinput.h> and > <libudev.h>: > > #ifndef KEY_INPUT_HANDLING_VIRTUAL > #include <libudev.h> > #include <libinput.h> > #else > #include <virtualinput.h> > #endif > > whenever KEY_INPUT_HANDLING_VIRTUAL is *NOT* defined. And > KEY_INPUT_HANDLING_VIRTUAL is only defined when USE_VIRTUAL_KEYBOARD=ON. > > I believe you should also properly use the USE_INPUT_UDEV and > USE_INPUT_WAYLAND options. > > find_package(Libxkbcommon REQUIRED) > > libxkbcommon is also a mandatory dependency. Even though it is > indirectly pulled in by libwpe, it should be expressed as a direct > dependency of wpebackend-rdk. Aye, will fix. It seems I was a bit hasty checking the CMake build system for the package O:-) > > --- > > package/Config.in | 1 + > > package/wpebackend-rdk/Config.in | 57 ++++++++++++++++++++++ > > package/wpebackend-rdk/wpebackend-rdk.hash | 5 ++ > > package/wpebackend-rdk/wpebackend-rdk.mk | 43 ++++++++++++++++ > > 4 files changed, 106 insertions(+) > > Please add yourself in the DEVELOPERS file for this package. Will do. > > diff --git a/package/wpebackend-rdk/Config.in b/package/wpebackend-rdk/Config.in > > new file mode 100644 > > index 00000000000..6125911bec9 > > --- /dev/null > > +++ b/package/wpebackend-rdk/Config.in > > @@ -0,0 +1,57 @@ > > +comment "wpebackend-rdk needs a toolchain w/ C++, wchar, threads, dynamic library, and rpi-userland or an OpenGL-capable Wayland backend" > > + depends on !(BR2_PACKAGE_RPI_USERLAND || BR2_PACKAGE_HAS_LIBEGL_WAYLAND) \ > > + || !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR \ > > + || !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS > > Please split this into two comments, one for the toolchain things, one > for the rpi-userland || wayland EGL. > > Also, the option BR2_PACKAGE_HAS_LIBEGL_WAYLAND is gone, see commit > 4fad6b3c58abd20c533b67b85658bc66d015110b. You can use > BR2_PACKAGE_HAS_LIBEGL && BR2_PACKAGE_WAYLAND instead. This needs to be > fixed globally. Ok. > > +config BR2_PACKAGE_WPEBACKEND_RDK > > + bool "wpebackend-rdk" > > + depends on !BR2_STATIC_LIBS # wayland > > + depends on BR2_INSTALL_LIBSTDCPP > > + depends on BR2_TOOLCHAIN_HAS_THREADS # wayland, libglib2 > > + depends on BR2_USE_WCHAR # libglib2 > > + depends on BR2_USE_MMU # libglib2 > > + depends on BR2_PACKAGE_RPI_USERLAND || BR2_PACKAGE_HAS_LIBEGL_WAYLAND > > + select BR2_PACKAGE_LIBGLIB2 > > + select BR2_PACKAGE_LIBWPE > > + help > > + WPEBackend interface supporting a number of configurations. > > Would be nice to have a slightly extended explanation for the poor > souls like that are very confused by libwpe vs. wpebackend-fdo vs. > wpebackend-rdk vs. wpewebkit vs. webkitgtk. Wait for it... Things are gonna get even more complicated, probably in WPE WebKit 2.48.x we are introducing a new WPEPlatform library (which will be built part of the wpewebkit package) that will allow removing the need for libwpe+wpebackend-foo. So, here goes a quick bullet-points explanation, also for myself to help later write the package descriptions when I re-spin this into an updated v3 patchset: - WPE WebKit is, to a certain degree, independent from the mechanisms used to allocate graphics buffers and receiving user input. - To achieve that independence, it uses interfaces defined by libwpe. - In turn libwpe will dynamically load a WPE backend plug-in that provides a concrete implementation (wpebackend-fdo, wpebackend-rdk). - wpebackend-fdo provides API for applications to obtain the rendered content as a series of EGLImages, and in that sense it is "generic" but applications are then responsible for arranging how to display things (this is what Cog's "platform plug-ins" do). - wpebackend-rdk, on the other hand, handles displaying rendered content itself, which can be more performant in some scenarios, but at the cost of reduced flexibility and only being able to use one single WebKitWebView in your application. > > +if BR2_PACKAGE_WPEBACKEND_RDK > > + > > +choice > > + prompt Implementation > > Double quotes around "Implementation". Maybe it should be "Backend" > instead of "Implementation"? I wanted to use a term different from "backend" to make it different from the "WPE backend": wpebackend-rdk is a WPE backend, which has different "implementations" (one for Wayland-EGL, one for RPi/dispmanx, etc.). The issue here is that wpebackend-rdk can be built with different compile-time options to support different hardware/configurations, when in theory each one of those configurations should be a different wpebackend-$foobar. My understanding is that wpebackend-rdk ended up the way it is was to reuse common parts when building the different configurations :-S Using "backend" for both can quickly get confusing, as in: "wpebackend-rdk is a WPE backend that has a Wayland-EGL backend". Compare with: "wpebackend-rdk is a WPE backend that has a Wayland-EGL implementation". Still a mouthful, but I think one can get what I am trying to avoid. Maybe using "Configuration" instead? Suggestions for better wording are more than welcome, too. > > + default BR2_PACKAGE_WPEBACKEND_RDK_IMPL_BRCM_RPI if BR2_PACKAGE_RPI_USERLAND > > + default BR2_PACKAGE_WPEBACKEND_RDK_IMPL_WAYLAND_EGL if BR2_PACKAGE_HAS_LIBEGL_WAYLAND > > + > > +comment "brcm-rpi needs rpi-userland" > > + depends on !BR2_PACKAGE_RPI_USERLAND || !BR2_arm > > better expressed as: > > depends on BR2_arm > depends on !BR2_PACKAGE_RPI_USERLAND Ok. > > + > > +config BR2_PACKAGE_WPEBACKEND_RDK_IMPL_BRCM_RPI > > + bool "brcm-rpi" > > + depends on BR2_arm > > + depends on BR2_PACKAGE_RPI_USERLAND > > + help > > + Build RaspberryPi support using Broadcom's rpi-userland. > > + > > +comment "wayland-egl needs an EGL capable Wayland implementation" > > + depends on !BR2_PACKAGE_HAS_LIBEGL_WAYLAND > > + > > +config BR2_PACKAGE_WPEBACKEND_RDK_IMPL_WAYLAND_EGL > > + bool "wayland-egl" > > + depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND > > + help > > + Build Wayland-EGL support. > > + > > +endchoice > > + > > +if BR2_PACKAGE_WPEBACKEND_RDK_IMPL_BRCM_RPI > > + > > +config BR2_PACKAGE_WPEBACKEND_RDK_LIBINPUT > > + bool "libinput support" > > + select BR2_PACKAGE_LIBINPUT > > + help > > + Support keyboard and mouse input through libinput > > Why is the keyboard/mouse support with libinput only available with the > brcm-rpi backend? Reading the CMakeLists.txt, I don't really see any > relationship. When building wpebackend-rdk for Wayland-EGL then events coming from the Wayland compositor are used (wl_seat, wl_pointer, and so on) and there is no need for libinput there. And for the brcm-rpi configuration is optional to use e.g. in kiosk or signage deployments. > Could you fix up those different issues and submit a v3 ? May take a little while, but I will indeed submit a new version of the patch set at some point. Thanks for all the review comments! Cheers, —Adrián
diff --git a/package/Config.in b/package/Config.in index 550fdc1f411..5dab5de59c1 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1734,6 +1734,7 @@ menu "Graphics" source "package/wlroots/Config.in" source "package/woff2/Config.in" source "package/wpebackend-fdo/Config.in" + source "package/wpebackend-rdk/Config.in" source "package/wpewebkit/Config.in" source "package/zbar/Config.in" source "package/zxing-cpp/Config.in" diff --git a/package/wpebackend-rdk/Config.in b/package/wpebackend-rdk/Config.in new file mode 100644 index 00000000000..6125911bec9 --- /dev/null +++ b/package/wpebackend-rdk/Config.in @@ -0,0 +1,57 @@ +comment "wpebackend-rdk needs a toolchain w/ C++, wchar, threads, dynamic library, and rpi-userland or an OpenGL-capable Wayland backend" + depends on !(BR2_PACKAGE_RPI_USERLAND || BR2_PACKAGE_HAS_LIBEGL_WAYLAND) \ + || !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR \ + || !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS + +config BR2_PACKAGE_WPEBACKEND_RDK + bool "wpebackend-rdk" + depends on !BR2_STATIC_LIBS # wayland + depends on BR2_INSTALL_LIBSTDCPP + depends on BR2_TOOLCHAIN_HAS_THREADS # wayland, libglib2 + depends on BR2_USE_WCHAR # libglib2 + depends on BR2_USE_MMU # libglib2 + depends on BR2_PACKAGE_RPI_USERLAND || BR2_PACKAGE_HAS_LIBEGL_WAYLAND + select BR2_PACKAGE_LIBGLIB2 + select BR2_PACKAGE_LIBWPE + help + WPEBackend interface supporting a number of configurations. + +if BR2_PACKAGE_WPEBACKEND_RDK + +choice + prompt Implementation + default BR2_PACKAGE_WPEBACKEND_RDK_IMPL_BRCM_RPI if BR2_PACKAGE_RPI_USERLAND + default BR2_PACKAGE_WPEBACKEND_RDK_IMPL_WAYLAND_EGL if BR2_PACKAGE_HAS_LIBEGL_WAYLAND + +comment "brcm-rpi needs rpi-userland" + depends on !BR2_PACKAGE_RPI_USERLAND || !BR2_arm + +config BR2_PACKAGE_WPEBACKEND_RDK_IMPL_BRCM_RPI + bool "brcm-rpi" + depends on BR2_arm + depends on BR2_PACKAGE_RPI_USERLAND + help + Build RaspberryPi support using Broadcom's rpi-userland. + +comment "wayland-egl needs an EGL capable Wayland implementation" + depends on !BR2_PACKAGE_HAS_LIBEGL_WAYLAND + +config BR2_PACKAGE_WPEBACKEND_RDK_IMPL_WAYLAND_EGL + bool "wayland-egl" + depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND + help + Build Wayland-EGL support. + +endchoice + +if BR2_PACKAGE_WPEBACKEND_RDK_IMPL_BRCM_RPI + +config BR2_PACKAGE_WPEBACKEND_RDK_LIBINPUT + bool "libinput support" + select BR2_PACKAGE_LIBINPUT + help + Support keyboard and mouse input through libinput + +endif + +endif diff --git a/package/wpebackend-rdk/wpebackend-rdk.hash b/package/wpebackend-rdk/wpebackend-rdk.hash new file mode 100644 index 00000000000..af7dab6a365 --- /dev/null +++ b/package/wpebackend-rdk/wpebackend-rdk.hash @@ -0,0 +1,5 @@ +# Generated locally +sha256 4c6ae288cf66f0a47052a50972e3d3727617c4c3e104db20494a3c5feb262f40 wpebackend-rdk-4.4.1.tar.gz + +# License files +sha256 a5ba969938c2896411ea1a23ee7d9ccb68306a65615b6711afe738c8f6ff2153 COPYING diff --git a/package/wpebackend-rdk/wpebackend-rdk.mk b/package/wpebackend-rdk/wpebackend-rdk.mk new file mode 100644 index 00000000000..f9740eb46cd --- /dev/null +++ b/package/wpebackend-rdk/wpebackend-rdk.mk @@ -0,0 +1,43 @@ +################################################################################ +# +# wpebackend-rdk +# +################################################################################ + +WPEBACKEND_RDK_VERSION = 4.4.1 +WPEBACKEND_RDK_SITE = $(call github,WebPlatformForEmbedded,WPEBackend-rdk,R$(WPEBACKEND_RDK_VERSION)) +WPEBACKEND_RDK_INSTALL_STAGING = YES +WPEBACKEND_RDK_LICENSE = BSD-2-Clause +WPEBACKEND_RDK_LICENSE_FILES = COPYING +WPEBACKEND_RDK_DEPENDENCIES = libglib2 libwpe +WPEBACKEND_RDK_CONF_OPTS = \ + -DUSE_BACKEND_BCM_NEXUS=OFF \ + -DUSE_BACKEND_BCM_NEXUS_WAYLAND=OFF \ + -DUSE_BACKEND_INTEL_CE=OFF \ + -DUSE_BACKEND_WESTEROS=OFF \ + -DUSE_BACKEND_WPEFRAMEWORK=OFF \ + -DUSE_HOLE_PUNCH_GSTREAMER=OFF \ + -DUSE_VIRTUAL_KEYBOARD=OFF + +ifeq ($(BR2_PACKAGE_WPEBACKEND_RDK_IMPL_BRCM_RPI),y) +WPEBACKEND_RDK_CONF_OPTS += -DUSE_BACKEND_BCM_RPI=ON +WPEBACKEND_RDK_DEPENDENCIES += rpi-userland +else +WPEBACKEND_RDK_CONF_OPTS += -DUSE_BACKEND_BCM_RPI=OFF +endif + +ifeq ($(BR2_PACKAGE_WPEBACKEND_RDK_IMPL_WAYLAND_EGL),y) +WPEBACKEND_RDK_CONF_OPTS += -DUSE_BACKEND_WAYLAND_EGL=ON +WPEBACKEND_RDK_DEPENDENCIES += libegl wayland +else +WPEBACKEND_RDK_CONF_OPTS += -DUSE_BACKEND_WAYLAND_EGL=OFF +endif + +ifeq ($(BR2_PACKAGE_WPEBACKEND_RDK_LIBINPUT),y) +WPEBACKEND_RDK_CONF_OPTS += -DUSE_INPUT_LIBINPUT=ON +WPEBACKEND_RDK_DEPENDENCIES += libinput +else +WPEBACKEND_RDK_CONF_OPTS += -DUSE_INPUT_LIBINPUT=OFF +endif + +$(eval $(cmake-package))
The wpebackend-rdk can be used as an alternative to wpebackend-fdo in some cases, and also supports a few additional configurations. For now only the Wayland-EGL and Broadcom RaspberryPi userland implementations can be enabled. The former is useful for testing, and the latter allows using WPE WebKit directly on top of Dispmanx in combination with the rpi-userland package in supported RaspberryPi models. This only adds the new package, follow-up commits will un-hardcode the usage of wpebackend-fdo and allow selecting either which of both to build. Signed-off-by: Adrian Perez de Castro <aperez@igalia.com> --- package/Config.in | 1 + package/wpebackend-rdk/Config.in | 57 ++++++++++++++++++++++ package/wpebackend-rdk/wpebackend-rdk.hash | 5 ++ package/wpebackend-rdk/wpebackend-rdk.mk | 43 ++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 package/wpebackend-rdk/Config.in create mode 100644 package/wpebackend-rdk/wpebackend-rdk.hash create mode 100644 package/wpebackend-rdk/wpebackend-rdk.mk --- v1 -> v2: - Unchanged.