From 148920f3971de0f44ac4dd3c85c29983862c5318 Mon Sep 17 00:00:00 2001 From: Fabien Lahoudere Date: Thu, 2 Nov 2017 00:22:55 +0100 Subject: weston: Bump version to 3.0.0 Update weston release to 3.0.0. Two patches added: - fix-missing-header.patch: fix a build issue when musl is used as libc. - weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch: fix display issue with YUV420/I420 format, that could result in a crash. Signed-off-by: Fabien Lahoudere Signed-off-by: Richard Purdie --- .../wayland/weston/fix-missing-header.patch | 30 ++++++ ...t-pitch-correctly-for-subsampled-textures.patch | 55 ++++++++++ meta/recipes-graphics/wayland/weston_2.0.0.bb | 113 -------------------- meta/recipes-graphics/wayland/weston_3.0.0.bb | 114 +++++++++++++++++++++ 4 files changed, 199 insertions(+), 113 deletions(-) create mode 100644 meta/recipes-graphics/wayland/weston/fix-missing-header.patch create mode 100644 meta/recipes-graphics/wayland/weston/weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch delete mode 100644 meta/recipes-graphics/wayland/weston_2.0.0.bb create mode 100644 meta/recipes-graphics/wayland/weston_3.0.0.bb (limited to 'meta/recipes-graphics') diff --git a/meta/recipes-graphics/wayland/weston/fix-missing-header.patch b/meta/recipes-graphics/wayland/weston/fix-missing-header.patch new file mode 100644 index 0000000000..55c0d4fd0f --- /dev/null +++ b/meta/recipes-graphics/wayland/weston/fix-missing-header.patch @@ -0,0 +1,30 @@ +On the musl C library, tests/timespec-text.c does not build, with the +following error: + + In file included from tests/timespec-test.c:36:0: + ./shared/timespec-util.h:41:21: warning: ‘struct timespec’ declared + inside parameter list will not be visible outside of this definition + or declaration + timespec_sub(struct timespec *r, + ^~~~~~~~ + [...] + +Indeed, struct timespec is defined in time.h, so we must include it. + +Upstream-Status: Backport [fa41bdfbc0b962fd73b89f01aab1a5370c9c28eb] + +Signed-off-by: "Yann E. MORIN" +Reviewed-by: Pekka Paalanen + +Index: weston-3.0.0/shared/timespec-util.h +=================================================================== +--- weston-3.0.0.orig/shared/timespec-util.h ++++ weston-3.0.0/shared/timespec-util.h +@@ -28,6 +28,7 @@ + + #include + #include ++#include + + #define NSEC_PER_SEC 1000000000 + diff --git a/meta/recipes-graphics/wayland/weston/weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch b/meta/recipes-graphics/wayland/weston/weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch new file mode 100644 index 0000000000..b3e1d06f57 --- /dev/null +++ b/meta/recipes-graphics/wayland/weston/weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch @@ -0,0 +1,55 @@ +Multi-plane sub-sampled textures have partial width/height, e.g. +YUV420/I420 has a full-size Y plane, followed by a half-width/height U +plane, and a half-width/height V plane. + +zwp_linux_dmabuf_v1 allows clients to pass an explicit pitch for each +plane, but for wl_shm this must be inferred. gl-renderer was correctly +accounting for the width and height when subsampling, but the pitch was +being taken as the pitch for the first plane. + +This does not match the requirements for GStreamer's waylandsink, in +particular, as well as other clients. Fix the SHM upload path to +correctly set the pitch for each plane, according to subsampling. + +Tested with: + $ gst-launch-1.0 videotestsrc ! waylandsink + +Upstream-Status: Backport [https://patchwork.freedesktop.org/patch/180767/] + +Signed-off-by: Daniel Stone +Fixes: fdeefe42418 ("gl-renderer: add support of WL_SHM_FORMAT_YUV420") +Reported-by: Fabien Lahoudere +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103063 + +--- + libweston/gl-renderer.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c +index 244ce309..40bf0bb6 100644 +--- a/libweston/gl-renderer.c ++++ b/libweston/gl-renderer.c +@@ -1445,14 +1445,13 @@ gl_renderer_flush_damage(struct weston_surface *surface) + goto done; + } + +- glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, gs->pitch); +- + if (gs->needs_full_upload) { + glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0); + glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, 0); + wl_shm_buffer_begin_access(buffer->shm_buffer); + for (j = 0; j < gs->num_textures; j++) { + glBindTexture(GL_TEXTURE_2D, gs->textures[j]); ++ glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, gs->pitch / gs->hsub[j]); + glTexImage2D(GL_TEXTURE_2D, 0, + gs->gl_format[j], + gs->pitch / gs->hsub[j], +@@ -1477,6 +1476,7 @@ gl_renderer_flush_damage(struct weston_surface *surface) + glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, r.y1); + for (j = 0; j < gs->num_textures; j++) { + glBindTexture(GL_TEXTURE_2D, gs->textures[j]); ++ glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, gs->pitch / gs->hsub[j]); + glTexSubImage2D(GL_TEXTURE_2D, 0, + r.x1 / gs->hsub[j], + r.y1 / gs->vsub[j], diff --git a/meta/recipes-graphics/wayland/weston_2.0.0.bb b/meta/recipes-graphics/wayland/weston_2.0.0.bb deleted file mode 100644 index 8160f5556d..0000000000 --- a/meta/recipes-graphics/wayland/weston_2.0.0.bb +++ /dev/null @@ -1,113 +0,0 @@ -SUMMARY = "Weston, a Wayland compositor" -DESCRIPTION = "Weston is the reference implementation of a Wayland compositor" -HOMEPAGE = "http://wayland.freedesktop.org" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \ - file://libweston/compositor.c;endline=26;md5=e342df749174a8ee11065583157c7a38" - -SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ - file://weston.png \ - file://weston.desktop \ - file://0001-make-error-portable.patch \ - file://0001-configure.ac-Fix-wayland-protocols-path.patch \ - file://xwayland.weston-start \ - file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \ -" -SRC_URI[md5sum] = "15f38945942bf2a91fe2687145fb4c7d" -SRC_URI[sha256sum] = "b4e446ac27f118196f1609dab89bb3cb3e81652d981414ad860e733b355365d8" - -inherit autotools pkgconfig useradd distro_features_check -# depends on virtual/egl -REQUIRED_DISTRO_FEATURES = "opengl" - -DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0 jpeg" -DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native" - -EXTRA_OECONF = "--enable-setuid-install \ - --disable-rdp-compositor \ - " -EXTRA_OECONF_append_qemux86 = "\ - WESTON_NATIVE_BACKEND=fbdev-backend.so \ - " -EXTRA_OECONF_append_qemux86-64 = "\ - WESTON_NATIVE_BACKEND=fbdev-backend.so \ - " -PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \ - ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd x11', d)} \ - clients launch" -# -# Compositor choices -# -# Weston on KMS -PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev virtual/mesa mtdev" -# Weston on Wayland (nested Weston) -PACKAGECONFIG[wayland] = "--enable-wayland-compositor,--disable-wayland-compositor,virtual/mesa" -# Weston on X11 -PACKAGECONFIG[x11] = "--enable-x11-compositor,--disable-x11-compositor,virtual/libx11 libxcb libxcb libxcursor cairo" -# Headless Weston -PACKAGECONFIG[headless] = "--enable-headless-compositor,--disable-headless-compositor" -# Weston on framebuffer -PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor,--disable-fbdev-compositor,udev mtdev" -# weston-launch -PACKAGECONFIG[launch] = "--enable-weston-launch,--disable-weston-launch,drm" -# VA-API desktop recorder -PACKAGECONFIG[vaapi] = "--enable-vaapi-recorder,--disable-vaapi-recorder,libva" -# Weston with EGL support -PACKAGECONFIG[egl] = "--enable-egl --enable-simple-egl-clients,--disable-egl --disable-simple-egl-clients,virtual/egl" -# Weston with cairo glesv2 support -PACKAGECONFIG[cairo-glesv2] = "--with-cairo-glesv2,--with-cairo=image,cairo" -# Weston with lcms support -PACKAGECONFIG[lcms] = "--enable-lcms,--disable-lcms,lcms" -# Weston with webp support -PACKAGECONFIG[webp] = "--with-webp,--without-webp,libwebp" -# Weston with unwinding support -PACKAGECONFIG[libunwind] = "--enable-libunwind,--disable-libunwind,libunwind" -# Weston with systemd-login support -PACKAGECONFIG[systemd] = "--enable-systemd-login,--disable-systemd-login,systemd dbus" -# Weston with Xwayland support (requires X11 and Wayland) -PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland" -# colord CMS support -PACKAGECONFIG[colord] = "--enable-colord,--disable-colord,colord" -# Clients support -PACKAGECONFIG[clients] = "--enable-clients --enable-simple-clients --enable-demo-clients-install,--disable-clients --disable-simple-clients" -# Weston with PAM support -PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam" - -do_install_append() { - # Weston doesn't need the .la files to load modules, so wipe them - rm -f ${D}/${libdir}/libweston-2/*.la - - # If X11, ship a desktop file to launch it - if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then - install -d ${D}${datadir}/applications - install ${WORKDIR}/weston.desktop ${D}${datadir}/applications - - install -d ${D}${datadir}/icons/hicolor/48x48/apps - install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps - fi - - if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then - install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland - fi -} - -PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \ - libweston-2 ${PN}-examples" - -FILES_${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so ${datadir}" - -FILES_libweston-2 = "${libdir}/lib*${SOLIBS} ${libdir}/libweston-2/*.so" -SUMMARY_libweston-2 = "Helper library for implementing 'wayland window managers'." - -FILES_${PN}-examples = "${bindir}/*" - -FILES_${PN}-xwayland = "${libdir}/libweston-2/xwayland.so" -RDEPENDS_${PN}-xwayland += "xserver-xorg-xwayland" - -RDEPENDS_${PN} += "xkeyboard-config" -RRECOMMENDS_${PN} = "liberation-fonts" -RRECOMMENDS_${PN}-dev += "wayland-protocols" - -USERADD_PACKAGES = "${PN}" -GROUPADD_PARAM_${PN} = "--system weston-launch" diff --git a/meta/recipes-graphics/wayland/weston_3.0.0.bb b/meta/recipes-graphics/wayland/weston_3.0.0.bb new file mode 100644 index 0000000000..ad0cdc2b0f --- /dev/null +++ b/meta/recipes-graphics/wayland/weston_3.0.0.bb @@ -0,0 +1,114 @@ +SUMMARY = "Weston, a Wayland compositor" +DESCRIPTION = "Weston is the reference implementation of a Wayland compositor" +HOMEPAGE = "http://wayland.freedesktop.org" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \ + file://libweston/compositor.c;endline=26;md5=e342df749174a8ee11065583157c7a38" + +SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ + file://weston.png \ + file://weston.desktop \ + file://0001-make-error-portable.patch \ + file://xwayland.weston-start \ + file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \ + file://weston-gl-renderer-Set-pitch-correctly-for-subsampled-textures.patch \ + file://fix-missing-header.patch \ +" +SRC_URI[md5sum] = "9c42a4c51a1b9f35d040fa9d45ada36d" +SRC_URI[sha256sum] = "cde1d55e8dd70c3cbb3d1ec72f60e60000041579caa1d6a262bd9c35e93723a5" + +inherit autotools pkgconfig useradd distro_features_check +# depends on virtual/egl +REQUIRED_DISTRO_FEATURES = "opengl" + +DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0 jpeg" +DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native" + +EXTRA_OECONF = "--enable-setuid-install \ + --disable-rdp-compositor \ + " +EXTRA_OECONF_append_qemux86 = "\ + WESTON_NATIVE_BACKEND=fbdev-backend.so \ + " +EXTRA_OECONF_append_qemux86-64 = "\ + WESTON_NATIVE_BACKEND=fbdev-backend.so \ + " +PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd x11', d)} \ + clients launch" +# +# Compositor choices +# +# Weston on KMS +PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev virtual/mesa mtdev" +# Weston on Wayland (nested Weston) +PACKAGECONFIG[wayland] = "--enable-wayland-compositor,--disable-wayland-compositor,virtual/mesa" +# Weston on X11 +PACKAGECONFIG[x11] = "--enable-x11-compositor,--disable-x11-compositor,virtual/libx11 libxcb libxcb libxcursor cairo" +# Headless Weston +PACKAGECONFIG[headless] = "--enable-headless-compositor,--disable-headless-compositor" +# Weston on framebuffer +PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor,--disable-fbdev-compositor,udev mtdev" +# weston-launch +PACKAGECONFIG[launch] = "--enable-weston-launch,--disable-weston-launch,drm" +# VA-API desktop recorder +PACKAGECONFIG[vaapi] = "--enable-vaapi-recorder,--disable-vaapi-recorder,libva" +# Weston with EGL support +PACKAGECONFIG[egl] = "--enable-egl --enable-simple-egl-clients,--disable-egl --disable-simple-egl-clients,virtual/egl" +# Weston with cairo glesv2 support +PACKAGECONFIG[cairo-glesv2] = "--with-cairo-glesv2,--with-cairo=image,cairo" +# Weston with lcms support +PACKAGECONFIG[lcms] = "--enable-lcms,--disable-lcms,lcms" +# Weston with webp support +PACKAGECONFIG[webp] = "--with-webp,--without-webp,libwebp" +# Weston with unwinding support +PACKAGECONFIG[libunwind] = "--enable-libunwind,--disable-libunwind,libunwind" +# Weston with systemd-login support +PACKAGECONFIG[systemd] = "--enable-systemd-login,--disable-systemd-login,systemd dbus" +# Weston with Xwayland support (requires X11 and Wayland) +PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland" +# colord CMS support +PACKAGECONFIG[colord] = "--enable-colord,--disable-colord,colord" +# Clients support +PACKAGECONFIG[clients] = "--enable-clients --enable-simple-clients --enable-demo-clients-install,--disable-clients --disable-simple-clients" +# Weston with PAM support +PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam" + +do_install_append() { + # Weston doesn't need the .la files to load modules, so wipe them + rm -f ${D}/${libdir}/libweston-3/*.la + + # If X11, ship a desktop file to launch it + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then + install -d ${D}${datadir}/applications + install ${WORKDIR}/weston.desktop ${D}${datadir}/applications + + install -d ${D}${datadir}/icons/hicolor/48x48/apps + install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then + install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland + fi +} + +PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \ + libweston-3 ${PN}-examples" + +FILES_${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so ${datadir}" + +FILES_libweston-3 = "${libdir}/lib*${SOLIBS} ${libdir}/libweston-3/*.so" +SUMMARY_libweston-3 = "Helper library for implementing 'wayland window managers'." + +FILES_${PN}-examples = "${bindir}/*" + +FILES_${PN}-xwayland = "${libdir}/libweston-3/xwayland.so" +RDEPENDS_${PN}-xwayland += "xserver-xorg-xwayland" + +RDEPENDS_${PN} += "xkeyboard-config" +RRECOMMENDS_${PN} = "liberation-fonts" +RRECOMMENDS_${PN}-dev += "wayland-protocols" + +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM_${PN} = "--system weston-launch" -- cgit 1.2.3-korg