Skip to contentSkip to conversation

Initial wayland integration

PATCH In review Alex DAMIAN 3 participants 9 messages Dec 24, 2012 – Jan 4, 2013

lore
Share & tools
lore
#0 lore raw

cover Initial wayland integration

From: Alexandru DAMIAN <[email protected]>

Hi,

This is a set of patches that integrate Wayland/Weston 1.0.3 into mainline.

All library dependencies are satisfied, and Weston works under X11 and DRM.

A user must install separately (no hard dependency) the hardware DRM drivers to be able to run weston on barebone hardware. Hardware drivers built-in are the swrast, i915 and i965 (i965 is tested on real hardware).

There is no default integration in any distro, the packages may be installed through the package manager.

Further improvements will include a wrapper script for weston and integration in the distro features.

Documentation will be available on wiki, and announced here.

The following changes since commit 90c0eb29f0b41e4ac2d3d17ebad7295c2ebdc02a:

rootfs_rpm.bbclass: remove debug code (2012-12-19 21:43:55 +0000)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib adamian/wayland/upstream.4
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=adamian/wayland/upstream.4

Alexandru DAMIAN (3):
Wayland userspace library initial 1.0.3
Prepare mesa-dri for weston compatibility
Initial commit for wayland/weston 1.0.3

 meta/recipes-graphics/mesa/mesa-common.inc     |   10 +++++++-
 meta/recipes-graphics/mesa/mesa-dri.inc        |    1 +
 meta/recipes-graphics/wayland/wayland.inc      |   32 ++++++++++++++++++++++++
 meta/recipes-graphics/wayland/wayland_1.0.3.bb |    7 ++++++
 meta/recipes-graphics/wayland/weston.inc       |   23 +++++++++++++++++
 meta/recipes-graphics/wayland/weston_1.0.3.bb  |    9 +++++++
 6 files changed, 81 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-graphics/wayland/wayland.inc
 create mode 100644 meta/recipes-graphics/wayland/wayland_1.0.3.bb
 create mode 100644 meta/recipes-graphics/wayland/weston.inc
 create mode 100644 meta/recipes-graphics/wayland/weston_1.0.3.bb
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/3 Wayland userspace library initial 1.0.3

From: Alexandru DAMIAN <[email protected]>

Wayland is a new protocol a protocol for a client application to display user interface windows through the use of a compositing window manager. This package include the specific set of server-side and client-side C libraries that implement the protocol.

Wayland is hosted on http://wayland.freedesktop.org/

---
 meta/recipes-graphics/wayland/wayland.inc      |   32 ++++++++++++++++++++++++
 meta/recipes-graphics/wayland/wayland_1.0.3.bb |    7 ++++++
 2 files changed, 39 insertions(+)
 create mode 100644 meta/recipes-graphics/wayland/wayland.inc
 create mode 100644 meta/recipes-graphics/wayland/wayland_1.0.3.bb
meta/recipes-graphics/wayland/wayland.inc new file +32 -0
new file mode 100644
index 0000000..4f3ffa9
@@ -0,0 +1,32 @@
+inherit autotools pkgconfig
+
+SUMMARY = "Wayland, a protocol between a compositor and clients"
+
+DESCRIPTION = "Wayland is a protocol for a compositor to talk to its clients \
+as well as a C library implementation of that protocol. The compositor can be \
+a standalone display server running on Linux kernel modesetting and evdev \
+input devices, an X application, or a wayland client itself. The clients can \
+be traditional applications, X servers (rootless or fullscreen) or other \
+display servers."
+
+HOMEPAGE = "http://wayland.freedesktop.org"
+SECTION = "wayland/base"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1d4476a7d98dd5691c53d4d43a510c72"
+
+# needs wayland-native for the wayland-scanner utility
+BBCLASSEXTEND = "native"
+
+DEPENDS_virtclass-native = "expat-native"
+DEPENDS = "expat wayland-native"
+
+EXTRA_OECONF_virtclass-native = "--disable-documentation"
+EXTRA_OECONF = "--disable-documentation --disable-scanner"
+
+# wayland installs a m4 macro for other projects to use. This m4 macro
+# includes a path to a makefile fragment to get the rules to generate
+# stubs from protocol description files.
+do_install_append() {
+  sed -i -e '4,10s,prefix=.*$,prefix=${D}/${prefix},;4,10s,exec_prefix=,exec_prefix=${D}/${exec_prefix},' \
+    ${D}/${datadir}/aclocal/wayland-scanner.m4
+}
meta/recipes-graphics/wayland/wayland_1.0.3.bb new file +7 -0
new file mode 100644
index 0000000..28dd49b
@@ -0,0 +1,7 @@
+require wayland.inc
+
+SRC_URI = "http://wayland.freedesktop.org/releases/wayland-1.0.3.tar.xz"
+SRC_URI[md5sum] = "eebe23571fd4f9ceacc583238e5a8ae9"
+SRC_URI[sha256sum] = "f6be5ee11ba534baaa116350b5efb874bf9963bf3fb18bcf40130317e83a5913"
+
+PR = "r0"
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 2/3 Prepare mesa-dri for weston compatibility

From: Alexandru DAMIAN <[email protected]>

This patch enables mesa-git to build wayland-compatible packages for usage with weston.

It adds wayland platform support, packs the wayland-egl files.

---
 meta/recipes-graphics/mesa/mesa-common.inc |   10 +++++++++-
 meta/recipes-graphics/mesa/mesa-dri.inc    |    1 +
 2 files changed, 10 insertions(+), 1 deletion(-)
meta/recipes-graphics/mesa/mesa-common.inc +9 -1
index 70957eb..cf6e610 100644
@@ -29,10 +29,15 @@ EXTRA_OECONF = "--disable-glu \
                 --disable-glut \
                 --enable-shared-glapi"
 
-PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} egl gles"
+PACKAGECONFIG ??= "egl gles \
+		${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}\
+		${@base_contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}\
+		"
 
 X11_DEPS = "xf86driproto glproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes"
 PACKAGECONFIG[x11] = "--enable-glx-tls,--disable-glx,${X11_DEPS}"
+PACKAGECONFIG[wayland] = ",,wayland"
+
 
 # Multiple virtual/gl providers being built breaks staging
 EXCLUDE_FROM_WORLD = "1"
@@ -49,6 +54,7 @@ PACKAGES =+ "libegl-mesa libegl-mesa-dev \
              libgles1-mesa libgles1-mesa-dev \
              libgles2-mesa libgles2-mesa-dev \
              libgles3-mesa libgles3-mesa-dev \
+             wayland-egl wayland-egl-dev \
             "
 
 do_install_append () {
@@ -90,8 +96,10 @@ FILES_libgles2-mesa = "${libdir}/libGLESv2.so.*"
 FILES_libgl-mesa = "${libdir}/libGL.so.*"
 FILES_libglapi = "${libdir}/libglapi.so.*"
 FILES_libosmesa = "${libdir}/libOSMesa.so.*"
+FILES_wayland-egl = "${libdir}/libwayland-egl.so.*"
 
 FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc"
+FILES_wayland-egl-dev = "${libdir}/pkgconfig/wayland-egl.pc ${libdir}/libwayland-egl.*"
 FILES_libdricore-dev = "${libdir}/libdricore*.*"
 FILES_libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
 FILES_libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h"
meta/recipes-graphics/mesa/mesa-dri.inc +1 -0
index 07544ab..1f6ec78 100644
@@ -13,6 +13,7 @@ PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-
 
 EGL_PLATFORMS  = "drm"
 EGL_PLATFORMS .="${@base_contains('DISTRO_FEATURES', 'x11', ',x11', '', d)}"
+EGL_PLATFORMS .="${@base_contains('DISTRO_FEATURES', 'wayland', ',wayland', '', d)}"
 PACKAGECONFIG[egl] = "--enable-egl --with-egl-platforms=${EGL_PLATFORMS}, --disable-egl"
 
 python populate_packages_prepend() {
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH 3/3 Initial commit for wayland/weston 1.0.3

In reply to Alex DAMIAN

From: Alexandru DAMIAN <[email protected]>

This patch adds the Weston reference compositing
manager from Wayland.

We add version 1.0.3 which is the latest stable release in Dec 2012. See the upstream at:

http://wayland.freedesktop.org/releases.html

---
 meta/recipes-graphics/wayland/weston.inc      |   23 +++++++++++++++++++++++
 meta/recipes-graphics/wayland/weston_1.0.3.bb |    9 +++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 meta/recipes-graphics/wayland/weston.inc
 create mode 100644 meta/recipes-graphics/wayland/weston_1.0.3.bb
meta/recipes-graphics/wayland/weston.inc new file +23 -0
new file mode 100644
index 0000000..7d26f7f
@@ -0,0 +1,23 @@
+inherit autotools pkgconfig
+
+SUMMARY = "Weston, a Wayland compositor"
+DESCRIPTION = "Weston is the reference implementation of a Wayland compositor"
+HOMEPAGE = "http://wayland.freedesktop.org"
+SECTION = "wayland/base"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=275efac2559a224527bd4fd593d38466"
+
+DEPENDS = "wayland libxkbcommon gdk-pixbuf pixman cairo glib-2.0 mtdev jpeg"
+DEPENDS += "virtual/egl"
+
+EXTRA_OECONF  = "--enable-wayland-compositor --disable-android-compositor"
+EXTRA_OECONF += "--enable-setuid-install --enable-simple-clients"
+EXTRA_OECONF += "--enable-clients --disable-xwayland"
+
+PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'wayland', 'kms', '', d)} \
+                   ${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
+                   ${@base_contains('DISTRO_FEATURES', 'opengles2', 'gles', '', d)} \
+                  "
+PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm libgbm libglapi udev wayland-egl libpam"
+PACKAGECONFIG[x11] = "--enable-x11-compositor,--disable-x11-compositor,virtual/libx11 libxcb libxcb libxcursor cairo"
+PACKAGECONFIG[gles] = "--with-cairo-glesv2,,virtual/libgles2"
meta/recipes-graphics/wayland/weston_1.0.3.bb new file +9 -0
new file mode 100644
index 0000000..625965b
@@ -0,0 +1,9 @@
+require weston.inc
+
+SRC_URI = "http://wayland.freedesktop.org/releases/weston-1.0.3.tar.xz \
+	  "
+SRC_URI[md5sum] = "f82ac2e013e6b6a6303ac4ba7b64c7f2"
+SRC_URI[sha256sum] = "3136a7d2f654ea3e946d4217f7e25321248ad2921f1f4e2504dda58968e04853"
+
+PR = "r0"
+
Signature · 1 line
1.7.10.4
#5 lore raw

Re: [PATCH 3/3] Initial commit for wayland/weston 1.0.3

Quoted 1 line · Alex DAMIAN

+PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm libgbm libglapi udev wayland-egl libpam"

"libgbm libglapi wayland-egl" aren't valid source recipes, just use "mesa-dri".

Ross

#6 lore raw

Re: [PATCH 3/3] Initial commit for wayland/weston 1.0.3

Quoted 4 lines · Ross
Quoted 1 line · Alex DAMIAN

+PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm libgbm libglapi udev wayland-egl libpam"

"libgbm libglapi wayland-egl" aren't valid source recipes, just use "mesa-dri".

Ignore that. They're still not valid source recipes, but I've dug into how Wayland on the PandaBoard works and we should enable that to work in meta-ti without much effort.

Their binary blob has it's own wayland-egl- and libgbm-compatible libraries. Let's create a new virtual provider virtual/wayland-egl which mesa-dri (and the TI drivers) can PROVIDE and weston can DEPEND on.

Ross

#7 lore raw

Re: [PATCH 3/3] Initial commit for wayland/weston 1.0.3

In reply to Alex DAMIAN
Quoted 26 lines · Alex DAMIAN

From: Alexandru DAMIAN <[email protected]>

This patch adds the Weston reference compositing
manager from Wayland.

We add version 1.0.3 which is the latest stable release in Dec 2012. See the upstream at:

http://wayland.freedesktop.org/releases.html

---
  meta/recipes-graphics/wayland/weston.inc      |   23 +++++++++++++++++++++++
  meta/recipes-graphics/wayland/weston_1.0.3.bb |    9 +++++++++
  2 files changed, 32 insertions(+)

create mode 100644 meta/recipes-graphics/wayland/weston.inc create mode 100644 meta/recipes-graphics/wayland/weston_1.0.3.bb

meta/recipes-graphics/wayland/weston.inc new file +2 -0
new file mode 100644
index 0000000..7d26f7f
@@ -0,0 +1,23 @@
+inherit autotools pkgconfig
+

meta/recipes-graphics/wayland/weston.inc line 12

Quoted 10 lines
meta/recipes-graphics/wayland/weston.inc new file +10 -0
+SUMMARY = "Weston, a Wayland compositor"
+DESCRIPTION = "Weston is the reference implementation of a Wayland compositor"
+HOMEPAGE = "http://wayland.freedesktop.org"
+SECTION = "wayland/base"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=275efac2559a224527bd4fd593d38466"
+
+DEPENDS = "wayland libxkbcommon gdk-pixbuf pixman cairo glib-2.0 mtdev jpeg"
+DEPENDS += "virtual/egl"
+

The Weston Build fails with the WORLD build target, not sure if we need to disable weston for world or if there is some other issue that needs to be addressed.

Quoted 11 lines
| configure:16321: $PKG_CONFIG --exists --print-errors "wayland-client wayland-egl"
| Package wayland-egl was not found in the pkg-config search path.
| Perhaps you should add the directory containing `wayland-egl.pc'
| to the PKG_CONFIG_PATH environment variable
| No package 'wayland-egl' found
| configure:16324: $? = 1
| configure:16337: result: no
| No package 'wayland-egl' found
| configure:16353: error: Package requirements (wayland-client wayland-egl) were not met:
|
| No package 'wayland-egl' found
Quoted 8 lines
|
| Consider adjusting the PKG_CONFIG_PATH environment variable if you
| installed software in a non-standard prefix.
|
| Alternatively, you may set the environment variables WAYLAND_COMPOSITOR_CFLAGS
| and WAYLAND_COMPOSITOR_LIBS to avoid the need to call pkg-config.
| See the pkg-config man page for more details.
|

Notice that it's the wayland-egl is not being found.

Sau!

Quoted 27 lines
meta/recipes-graphics/wayland/weston.inc new file +11 -0
+EXTRA_OECONF  = "--enable-wayland-compositor --disable-android-compositor"
+EXTRA_OECONF += "--enable-setuid-install --enable-simple-clients"
+EXTRA_OECONF += "--enable-clients --disable-xwayland"
+
+PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'wayland', 'kms', '', d)} \
+                   ${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
+                   ${@base_contains('DISTRO_FEATURES', 'opengles2', 'gles', '', d)} \
+                  "
+PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm libgbm libglapi udev wayland-egl libpam"
+PACKAGECONFIG[x11] = "--enable-x11-compositor,--disable-x11-compositor,virtual/libx11 libxcb libxcb libxcursor cairo"
+PACKAGECONFIG[gles] = "--with-cairo-glesv2,,virtual/libgles2"
meta/recipes-graphics/wayland/weston_1.0.3.bb new file +9 -0
new file mode 100644
index 0000000..625965b
@@ -0,0 +1,9 @@
+require weston.inc
+
+SRC_URI = "http://wayland.freedesktop.org/releases/weston-1.0.3.tar.xz \
+	  "
+SRC_URI[md5sum] = "f82ac2e013e6b6a6303ac4ba7b64c7f2"
+SRC_URI[sha256sum] = "3136a7d2f654ea3e946d4217f7e25321248ad2921f1f4e2504dda58968e04853"
+
+PR = "r0"
+
#8 lore raw

Re: [PATCH 1/3] Wayland userspace library initial 1.0.3

In reply to Alex DAMIAN

meta/recipes-graphics/wayland/wayland.inc line 32

Quoted 4 lines · Alex DAMIAN
meta/recipes-graphics/wayland/wayland.inc new file +4 -0
+do_install_append() {
+  sed -i -e '4,10s,prefix=.*$,prefix=${D}/${prefix},;4,10s,exec_prefix=,exec_prefix=${D}/${exec_prefix},' \
+    ${D}/${datadir}/aclocal/wayland-scanner.m4
+}

You can suffix this with _class-native to show/ensure that it's only intended for the native case.

The use of addresses seems fragile, would it be safer to inject the paths pre-configure when @prefix@ is easily replaceable? Thinking about it, why are the paths wrong in the first place?

Wouldn't STAGING_DIR_NATIVE be more correct than D?

Ross