Pull request for branch yem/rpi-wayland
From: "Yann E. MORIN" <[email protected]>
Hello All!
This series makes it possible to run weston on the raspberrypi.
The series:
- bumps wayland and weston (patches 1 and 2)
- installs wayland-scanner to $(HOST) (patch 3)
- fixes weston configure.ac with patches from upstream (patches 4 and 5)
- modifies weston to build more than one compositor (patch 6)
- fixes rpi-userland (patch 7)
- actualy enables the rpi compoisotor in weston (path 8)
Please pay special attention to commit logs of patches 4 and 7, they are tricky. I can add more details, or reworks them, if need be.
Changes v2 -> v3:
- drop patch 9 due to it being dead code for now (Thomas)
- fix weston build without EGL (Peter)
- fix rpi-compositor missing dependency
Changes v1 -> v2:
- drop host-wayland, isntall manually-built wayland-scanner to $(HOST) (Thomas)
- drop applied patches (Peter)
- fix typoes in commit logs
Regards,
Yann E. MORIN.
The following changes since commit 92af118d82a6031c7d9750959d6dc07a82a54ac4:
vde2: needs mmu (2013-10-09 23:40:29 +0200)
are available in the git repository at:
git://gitorious.org/buildroot/buildroot.git yem/rpi-wayland
for you to fetch changes up to 76866368cc2a600d5878de11146201ee7bc3b1a6:
package/weston: add RPi compositor (2013-10-10 21:54:43 +0200)
----------------------------------------------------------------
Yann E. MORIN (8):
package/wayland: bump version
package/weston: bump version
package/wayland: install wayland-scanner to $(HOST) package/weston: fix configure.ac to check for wayland-scanner package/weston: fix configure.ac for fbdev compositor package/weston: introduce infrastructure to select other compositors package/rpi-userland: add patch to remove faulty assert() package/weston: add RPi compositor
.../rpi-userland-002-remove-faulty-assert.patch | 21 +++++++++++++++++ package/wayland/wayland.mk | 5 +++-- package/weston/Config.in | 20 +++++++++++++++-- ...02-fix-configure.ac-check-wayland-scanner.patch | 26 ++++++++++++++++++++++ ...ompositor-fbdev-drop-dependency-on-libdrm.patch | 22 ++++++++++++++++++ package/weston/weston.mk | 21 +++++++++++++++-- 6 files changed, 109 insertions(+), 6 deletions(-) create mode 100644 package/rpi-userland/rpi-userland-002-remove-faulty-assert.patch create mode 100644 package/weston/weston-0002-fix-configure.ac-check-wayland-scanner.patch create mode 100644 package/weston/weston-0003-compositor-fbdev-drop-dependency-on-libdrm.patch
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH 1/8 package/wayland: bump version
From: "Yann E. MORIN" <[email protected]>
--- package/wayland/wayland.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/wayland/wayland.mk +1 -1
@@ -4,7 +4,7 @@ # ################################################################################ -WAYLAND_VERSION = 1.1.0 +WAYLAND_VERSION = 1.2.1 WAYLAND_SITE = http://wayland.freedesktop.org/releases/ WAYLAND_SOURCE = wayland-$(WAYLAND_VERSION).tar.xz WAYLAND_LICENSE = MIT
Signature · 1 line
1.8.1.2
PATCH 2/8 package/weston: bump version
In reply to Yann E. MORINFrom: "Yann E. MORIN" <[email protected]>
Even with EGL disabled, weston-1.2.2 still tries to build the simple EGL clients, so they need to be explicitly disabled.
--- package/weston/weston.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
package/weston/weston.mk +2 -1
@@ -4,7 +4,7 @@ # ################################################################################ -WESTON_VERSION = 1.1.0 +WESTON_VERSION = 1.2.2 WESTON_SITE = http://wayland.freedesktop.org/releases/ WESTON_SOURCE = weston-$(WESTON_VERSION).tar.xz WESTON_LICENSE = MIT
@@ -14,6 +14,7 @@ WESTON_DEPENDENCIES = host-pkgconf wayland libxkbcommon pixman libpng \ jpeg mtdev udev cairo WESTON_CONF_OPT = \ --disable-egl \ + --disable-simple-egl-clients \ --disable-xwayland \ --disable-x11-compositor \ --disable-drm-compositor \
Signature · 1 line
1.8.1.2
PATCH 3/8 package/wayland: install wayland-scanner to $(HOST)
In reply to Yann E. MORINFrom: "Yann E. MORIN" <[email protected]>
wayland-scanner is needed by weston.
--- package/wayland/wayland.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
package/wayland/wayland.mk +2 -1
@@ -22,7 +22,8 @@ WAYLAND_CONF_OPT = --disable-scanner define WAYLAND_BUILD_SCANNER (cd $(@D)/src/; \ $(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) \ - -o wayland-scanner scanner.c wayland-util.c -lexpat) + -o wayland-scanner scanner.c wayland-util.c -lexpat; \ + install -m 0755 -D wayland-scanner $(HOST_DIR)/usr/bin/wayland-scanner ) endef WAYLAND_POST_CONFIGURE_HOOKS += WAYLAND_BUILD_SCANNER
Signature · 1 line
1.8.1.2
PATCH 4/8 package/weston: fix configure.ac to check for wayland-scanner
In reply to Yann E. MORINFrom: "Yann E. MORIN" <[email protected]>
configure whines while checking for wayland-scanner.
wayland-scanner is used to generate the protocol parser C files from the protocol definition XML files.
weston has a hard-dependency on wayland-scanner, so it can regenerate its shell/mouse/keyboard/... "handlers".
Since we're using a tarball, those protocol files are already generated and up-to-date, but the check is hard-coded and unconditional. If wayland-scanner is missing, configure fails.
We could well patch away this check, but we'd have to carry and maintain it probably for ever.
Better to fix it: add a patch from upstream weston to fix configure whining.
--- ...02-fix-configure.ac-check-wayland-scanner.patch | 26 ++++++++++++++++++++++ package/weston/weston.mk | 4 ++++ 2 files changed, 30 insertions(+) create mode 100644 package/weston/weston-0002-fix-configure.ac-check-wayland-scanner.patch
package/weston/weston-0002-fix-configure.ac-check-wayland-scanner.patch new file +26 -0
@@ -0,0 +1,26 @@ +commit 9f43cb48aac9d27aa49fe955104f5cfd204703ed +Author: Quentin Glidic <[email protected]> +Date: Sat Aug 24 20:36:10 2013 +0200 + + autotools: Fix AC_PATH_PROG call + + Signed-off-by: Quentin Glidic <[email protected]> + Signed-off-by: "Yann E. MORIN" <[email protected]> + +diff --git a/configure.ac b/configure.ac +index 0129157..43e5e5c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -424,8 +424,10 @@ if test "x$have_lcms" = xyes; then + fi + AM_CONDITIONAL(HAVE_LCMS, [test "x$have_lcms" = xyes]) + +-AC_PATH_PROG([wayland_scanner], [wayland-scanner], +- [AC_MSG_ERROR("wayland-scanner is needed to compile weston")]) ++AC_PATH_PROG([wayland_scanner], [wayland-scanner]) ++if test x$wayland_scanner = x; then ++ AC_MSG_ERROR([wayland-scanner is needed to compile weston]) ++fi + + AC_CONFIG_FILES([Makefile + shared/Makefile
package/weston/weston.mk +4 -0
@@ -12,6 +12,10 @@ WESTON_LICENSE_FILES = COPYING WESTON_DEPENDENCIES = host-pkgconf wayland libxkbcommon pixman libpng \ jpeg mtdev udev cairo + +# We touch configure.ac with one of our patches +WESTON_AUTORECONF = YES + WESTON_CONF_OPT = \ --disable-egl \ --disable-simple-egl-clients \
Signature · 1 line
1.8.1.2
PATCH 5/8 package/weston: fix configure.ac for fbdev compositor
In reply to Yann E. MORINFrom: "Yann E. MORIN" <[email protected]>
Apply patch from upstream.
--- ...ompositor-fbdev-drop-dependency-on-libdrm.patch | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 package/weston/weston-0003-compositor-fbdev-drop-dependency-on-libdrm.patch
package/weston/weston-0003-compositor-fbdev-drop-dependency-on-libdrm.patch new file +22 -0
@@ -0,0 +1,22 @@ +commit 7b8e970ad1f1ef96db23b379a41edeb40ef1e8b6 +Author: Adrian Negreanu <[email protected]> +Date: Thu Sep 26 19:31:32 2013 +0300 + + compositor-fbdev: drop dependency on libdrm + + Signed-off-by: Adrian Negreanu <[email protected]> + Signed-off-by: "Yann E. MORIN" <[email protected]> + +diff --git a/configure.ac b/configure.ac +index 7c2da44..a43bf5b 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -190,7 +190,7 @@ AM_CONDITIONAL([ENABLE_FBDEV_COMPOSITOR], + [test x$enable_fbdev_compositor = xyes]) + AS_IF([test x$enable_fbdev_compositor = xyes], [ + AC_DEFINE([BUILD_FBDEV_COMPOSITOR], [1], [Build the fbdev compositor]) +- PKG_CHECK_MODULES([FBDEV_COMPOSITOR], [libudev >= 136 mtdev >= 1.1.0 libdrm >= 2.4.30]) ++ PKG_CHECK_MODULES([FBDEV_COMPOSITOR], [libudev >= 136 mtdev >= 1.1.0]) + ]) + + AC_ARG_ENABLE([rdp-compositor], [ --enable-rdp-compositor],,
Signature · 1 line
1.8.1.2
PATCH 6/8 package/weston: introduce infrastructure to select other compositors
In reply to Yann E. MORINFrom: "Yann E. MORIN" <[email protected]>
--- package/weston/Config.in | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
package/weston/Config.in +9 -2
@@ -14,8 +14,6 @@ config BR2_PACKAGE_WESTON depends on BR2_TOOLCHAIN_HAS_THREADS # wayland # Runtime dependency select BR2_PACKAGE_XKEYBOARD_CONFIG - # Make sure at least one backend is selected - select BR2_PACKAGE_WESTON_FBDEV help Weston is the reference implementation of a Wayland compositor, and a useful compositor in its own right.
@@ -26,7 +24,16 @@ config BR2_PACKAGE_WESTON if BR2_PACKAGE_WESTON +# These two options make sure at least one compositor is selected. +config BR2_PACKAGE_WESTON_HAS_COMPOSITOR + bool +config BR2_PACKAGE_WESTON_NEEDS_ONE_COMPOSITOR + def_bool y + depends on ! BR2_PACKAGE_WESTON_HAS_COMPOSITOR + select BR2_PACKAGE_WESTON_FBDEV + config BR2_PACKAGE_WESTON_FBDEV bool "fbdev compositor" + default y endif
Signature · 1 line
1.8.1.2
PATCH 7/8 package/rpi-userland: add patch to remove faulty assert()
In reply to Yann E. MORINFrom: "Yann E. MORIN" <[email protected]>
While porting wayland/weston to run on the RPi, I always tripped on this assert.
Thinking there was an issue with weston, I poked the weston guys on IRC about the issue. 'daniels' on irc.freenode.net/#wayland suggested removing the assert altogether, as that's what they had pushed upstream in their wayland pull-request:
https://github.com/raspberrypi/userland/pull/92
Turns out they forgot to include this in their pull-request, but that they were using a patched rpi-userland without that assert.
And indeed, without that assert, weston runs on the RPi. :-)
---
The weston guys will probably push this upstream soon. If not, then I'll take the burden to do it.
--- .../rpi-userland-002-remove-faulty-assert.patch | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 package/rpi-userland/rpi-userland-002-remove-faulty-assert.patch
package/rpi-userland/rpi-userland-002-remove-faulty-assert.patch new file +21 -0
@@ -0,0 +1,21 @@ +interface: remove faulty assert() to make weston happy at runtime + +This was removed after a discussion on IRC with the weston guys +('daniels' on irc.freenode.net/#wayland). + +Signed-off-by: "Yann E. MORIN" <[email protected]> +--- +Upstream status: no, will be pushed by weston guys later. +If not, I'll do it. + +diff -durN rpi-userland-77d32cd.orig/interface/vmcs_host/vc_vchi_dispmanx.c rpi-userland-77d32cd/interface/vmcs_host/vc_vchi_dispmanx.c +--- rpi-userland-77d32cd.orig/interface/vmcs_host/vc_vchi_dispmanx.c 2013-10-04 17:43:44.000000000 +0200 ++++ rpi-userland-77d32cd/interface/vmcs_host/vc_vchi_dispmanx.c 2013-10-08 22:28:51.611433539 +0200 +@@ -1187,7 +1187,6 @@ + continue; + + if(dispmanx_client.update_callback ) { +- vcos_assert( dispmanx_client.pending_update_handle == (DISPMANX_UPDATE_HANDLE_T) dispmanx_client.notify_buffer[1]); + dispmanx_client.update_callback((DISPMANX_UPDATE_HANDLE_T) dispmanx_client.notify_buffer[1], dispmanx_client.update_callback_param); + } + }
Signature · 1 line
1.8.1.2
PATCH 8/8 package/weston: add RPi compositor
In reply to Yann E. MORINFrom: "Yann E. MORIN" <[email protected]>
Procedure highly inspired by:
http://wayland.freedesktop.org/raspberrypi.html
The resulting weston works almost flawlessly, but requires a bit of love:
- /boot/config.txt must include this line: dispmanx_offline=1
- at least 128MiB of RAM must be allocated to the GPU
- after 24-or-so terminal-clients are connected, the screen turns black. Exiting a client restores the screen
It seems increasing/decreasing the amount of memory allocated to the GPU makes the clients limit to wobble above/below 24 clients at a time. YMMV, as they say...
Without dispmanx_offline=1, the limit is much below 24, at around 13. But changing the amount of memory allocated to the GPU does not change this limit in this case. YMMV, again.
Anyway, there are not many different clients available, besides the terminal client, since all other clients are EGL-based, and there is (yet) no EGL support (for weston!) on the RPi. So the tests were made only with the terminal client.
The system is rather smooth, but spwaning too many clients in a rapid-fire is sure to exhibit some lag. Resizing windows is a bit jerky, but moving them along is fine.
Note: the config option has a depends on THREADS due to rpi-userland, even though weston itself already inherits the same dependency from wayland. But better be clean and safe.
--- package/weston/Config.in | 9 +++++++++ package/weston/weston.mk | 14 +++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-)
package/weston/Config.in +9 -0
@@ -36,4 +36,13 @@ config BR2_PACKAGE_WESTON_FBDEV bool "fbdev compositor" default y +config BR2_PACKAGE_WESTON_RPI + bool "RPi compositor" + depends on BR2_arm # rpi-userland + depends on BR2_INSTALL_LIBSTDCPP # rpi-userland + depends on BR2_LARGEFILE # rpi-userland + depends on BR2_TOOLCHAIN_HAS_THREADS # rpi-userland + select BR2_PACKAGE_RPI_USERLAND + select BR2_PACKAGE_WESTON_HAS_COMPOSITOR + endif
package/weston/weston.mk +13 -1
@@ -24,8 +24,8 @@ WESTON_CONF_OPT = \ --disable-drm-compositor \ --disable-wayland-compositor \ --disable-headless-compositor \ - --disable-rpi-compositor \ --disable-weston-launch \ + --disable-colord \ --disable-libunwind ifeq ($(BR2_PACKAGE_WESTON_FBDEV),y)
@@ -34,4 +34,16 @@ else WESTON_CONF_OPT += --disable-fbdev-compositor endif +ifeq ($(BR2_PACKAGE_WESTON_RPI),y) +WESTON_DEPENDENCIES += rpi-userland +WESTON_CONF_OPT += --enable-rpi-compositor \ + --disable-resize-optimization \ + --disable-setuid-install \ + --disable-xwayland-test \ + --disable-simple-egl-clients \ + WESTON_NATIVE_BACKEND=rpi-backend.so +else +WESTON_CONF_OPT += --disable-rpi-compositor +endif # BR2_PACKAGE_WESTON_RPI + $(eval $(autotools-package))
Signature · 1 line
1.8.1.2
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
Yann> From: "Yann E. MORIN" <[email protected]> Yann> Hello All!
Yann> This series makes it possible to run weston on the raspberrypi.
Yann> The series:
Yann> - bumps wayland and weston (patches 1 and 2) Yann> - installs wayland-scanner to $(HOST) (patch 3) Yann> - fixes weston configure.ac with patches from upstream (patches 4 and 5) Yann> - modifies weston to build more than one compositor (patch 6) Yann> - fixes rpi-userland (patch 7) Yann> - actualy enables the rpi compoisotor in weston (path 8)
Yann> Please pay special attention to commit logs of patches 4 and 7, they are Yann> tricky. I can add more details, or reworks them, if need be.
Yann> Changes v2 -> v3:
Yann> - drop patch 9 due to it being dead code for now (Thomas) Yann> - fix weston build without EGL (Peter) Yann> - fix rpi-compositor missing dependency
Committed with the install -> $(INSTALL) fixup as discussed on IRC - Thanks.
Signature · 1 line
Bye, Peter Korsgaard