From patchwork Thu May 16 22:08:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Perez de Castro X-Patchwork-Id: 1100756 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=igalia.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.b="dxZXm1TK"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 454lv621Rqz9s7h for ; Fri, 17 May 2019 08:09:05 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C1ED7874C7; Thu, 16 May 2019 22:09:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0nt3uEj+BW3j; Thu, 16 May 2019 22:09:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id E755587492; Thu, 16 May 2019 22:09:00 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 008111BF3AD for ; Thu, 16 May 2019 22:08:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id EFBE588134 for ; Thu, 16 May 2019 22:08:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id AOmcMRDcSYSF for ; Thu, 16 May 2019 22:08:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from fanzine.igalia.com (fanzine.igalia.com [91.117.99.155]) by hemlock.osuosl.org (Postfix) with ESMTPS id 2217B8813A for ; Thu, 16 May 2019 22:08:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From; bh=BjaxAv7TCrBvsWK4PCz5PpEnRrkvEP5nZK3XwCvQLkE=; b=dxZXm1TKzyKwhqJ4feLXJ513iqRhXMiidzw+CquNNKBGvql2OciF+Wyj87uM0bBxzGcIYegAVmugvKXJgXVyn4gu8ppcC1/nKOPNYtEB6MG6Uo7AWab4CJ85ww/G6Nfica9EWzun33CHixnXAeKfp5tv6aiJI/bbCftM3HAfDUJsg2AVRCsPtRjjsRp3gUGdmw4xXlf33JUITARyhZWxIwa5RTpRdTK5rzpGIT7ZV4IaJfcjDYyi0KXZUbqsOsk4BcL5EZezQa3JrUMXZVr/+GL0+QaDSnFCJyEdyH7uHf7pPvuQOt+37zQRQtX2g5ddxKkD1I0oa345+ESN5JKr3Q==; Received: from mobile-access-b04827-38.dhcp.inet.fi ([176.72.39.38] helo=kodama) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1hROYU-0001tl-Pc for ; Fri, 17 May 2019 00:08:51 +0200 Received: from localhost (kodama [local]) by kodama (OpenSMTPD) with ESMTPA id b248ded4 for ; Thu, 16 May 2019 22:08:36 +0000 (UTC) From: Adrian Perez de Castro To: buildroot@buildroot.org Date: Fri, 17 May 2019 01:08:35 +0300 Message-Id: <20190516220836.24543-2-aperez@igalia.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190516220836.24543-1-aperez@igalia.com> References: <20190516220836.24543-1-aperez@igalia.com> MIME-Version: 1.0 Subject: [Buildroot] [RFC PATCH/next 1/2] package/wlroots: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" wlroots is a modular library which provides building blocks to implement Wayland compositors. wlroots is a dependency of the Cage Wayland compositor. https://github.com/swaywm/wlroots/ Signed-off-by: Adrian Perez de Castro --- package/Config.in | 1 + package/wlroots/Config.in | 65 +++++++++++++++++++++++++++++ package/wlroots/wlroots.hash | 5 +++ package/wlroots/wlroots.mk | 80 ++++++++++++++++++++++++++++++++++++ 4 files changed, 151 insertions(+) create mode 100644 package/wlroots/Config.in create mode 100644 package/wlroots/wlroots.hash create mode 100644 package/wlroots/wlroots.mk diff --git a/package/Config.in b/package/Config.in index f592e74a99..5b1f279b8e 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1341,6 +1341,7 @@ menu "Graphics" source "package/waylandpp/Config.in" source "package/webkitgtk/Config.in" source "package/webp/Config.in" + source "package/wlroots/Config.in" source "package/woff2/Config.in" source "package/wpebackend-fdo/Config.in" source "package/wpewebkit/Config.in" diff --git a/package/wlroots/Config.in b/package/wlroots/Config.in new file mode 100644 index 0000000000..45db63f62c --- /dev/null +++ b/package/wlroots/Config.in @@ -0,0 +1,65 @@ +config BR2_PACKAGE_WLROOTS + bool "wlroots" + depends on !BR2_STATIC_LIBS # mesa3d, wayland + depends on BR2_INSTALL_LIBSTDCPP # freedrp, mesa3d + depends on BR2_TOOLCHAIN_HAS_THREADS # libdrm, wayland + depends on BR2_TOOLCHAIN_HAS_SYNC_1 # mesa3d + depends on BR2_TOOLCHAIN_HAS_THREADS_NPTL # mesa3d + depends on BR2_ENABLE_LOCALE # libinput + depends on BR2_PACKAGE_HAS_UDEV # libinput + depends on BR2_PACKAGE_HAS_LIBEGL + depends on BR2_PACKAGE_HAS_LIBEGL_WAYLAND + depends on BR2_PACKAGE_HAS_LIBGLES + select BR2_PACKAGE_LIBDRM + select BR2_PACKAGE_LIBINPUT + select BR2_PACKAGE_LIBXKBCOMMON + select BR2_PACKAGE_PIXMAN + select BR2_PACKAGE_WAYLAND + select BR2_PACKAGE_WAYLAND_PROTOCOLS + help + wlroots is a modular Wayland library for building compositors + which implements many of their common features. + + https://github.com/swaywm/wlroots + +if BR2_PACKAGE_WLROOTS + +config BR2_PACKAGE_WLROOTS_RDP + bool "RDP backend support" + depends on BR2_PACKAGE_FREERDP + depends on BR2_USE_WCHAR # freerdp + depends on BR2_USE_MMU # libglib2 + depends on BR2_TOOLCHAIN_HAS_SYNC_4 # freerdp + help + Support Wayland sessions served using the RDP protocol + +comment "RDP backend support needs FreeRDP" + depends on !BR2_PACKAGE_FREERDP + +config BR2_PACKAGE_WLROOTS_X11 + bool "X11 backend support" + depends on BR2_PACKAGE_XORG7 + select BR2_PACKAGE_LIBXCB + select BR2_PACKAGE_XLIB_LIBX11 + help + Support Wayland sessions nested inside a X11 window + +comment "X11 backend support needs X.org enabled" + depends on !BR2_PACKAGE_XORG7 + +config BR2_PACKAGE_WLROOTS_XWAYLAND + bool "XWayland support" + depends on BR2_PACKAGE_XORG7 + select BR2_PACKAGE_LIBXCB + help + Enable support for XWayland + +comment "XWayland support needs X.org enabled" + depends on !BR2_PACKAGE_XORG7 + +config BR2_PACKAGE_WLROOTS_ROOTSTON + bool "rootston" + help + Build and install the rootston example compositor + +endif diff --git a/package/wlroots/wlroots.hash b/package/wlroots/wlroots.hash new file mode 100644 index 0000000000..dbb387a865 --- /dev/null +++ b/package/wlroots/wlroots.hash @@ -0,0 +1,5 @@ +# Generated locally +sha256 9cf3716f3683d800df8b150f256ff66dad65faf13a9d67c284f67a9444d28c70 0.6.0.tar.gz + +# Hashes for license files: +sha256 ffd3737a478b83a8b51b42757d3bf909ef36694508355879722e11fc1fa6736b LICENSE diff --git a/package/wlroots/wlroots.mk b/package/wlroots/wlroots.mk new file mode 100644 index 0000000000..9d3581fd6f --- /dev/null +++ b/package/wlroots/wlroots.mk @@ -0,0 +1,80 @@ +################################################################################ +# +# wlroots +# +################################################################################ + +WLROOTS_VERSION = 0.6.0 +WLROOTS_SITE = https://github.com/swaywm/wlroots/archive +WLROOTS_SOURCE = $(WLROOTS_VERSION).tar.gz +WLROOTS_LICENSE = MIT +WLROOTS_INSTALL_STAGING = YES + +WLROOTS_DEPENDENCIES = host-pkgconf host-wayland libegl libinput \ + libxkbcommon mesa3d pixman udev \ + wayland wayland-protocols + +WLROOTS_CONF_OPTS = -Dexamples=false + +ifeq ($(BR2_PACKAGE_FFMPEG),y) +WLROOTS_DEPENDENCIES += ffmpeg +endif + +ifeq ($(BR2_PACKAGE_LIBCAP),y) +WLROOTS_CONF_OPTS += -Dlibcap=enabled +WLROOTS_DEPENDENCIES += libcap +else +WLROOTS_CONF_OPTS += -Dlibcap=disabled +endif + +ifeq ($(BR2_PACKAGE_LIBPNG),y) +WLROOTS_DEPENDENCIES += libpng +endif + +ifeq ($(BR2_PACKAGE_SYSTEMD_LOGIND),y) +WLROOTS_CONF_OPTS += -Dlogind=enabled -Dlogind-provider=systemd +WLROOTS_DEPENDENCIES += systemd +else +WLROOTS_CONF_OPTS += -Dlogind=disabled +endif + +ifeq ($(BR2_PACKAGE_WLROOTS_RDP),y) +WLROOTS_CONF_OPTS += -Dfreerdp=enabled +WLROOTS_DEPENDENCIES += freerdp +else +WLROOTS_CONF_OPTS += -Dfreerdp=disabled +endif + +ifeq ($(BR2_PACKAGE_WLROOTS_X11),y) +WLROOTS_CONF_OPTS += -Dx11-backend=enabled +WLROOTS_DEPENDENCIES += xlib_libX11 +else +WLROOTS_CONF_OPTS += -Dx11-backend=disabled +endif + +ifeq ($(BR2_PACKAGE_WLROOTS_XWAYLAND),y) +WLROOTS_CONF_OPTS += -Dxwayland=enabled +WLROOTS_DEPENDENCIES += libxcb +ifeq ($(BR2_PACKAGE_XCB_UTIL),y) +WLROOTS_CONF_OPTS += -Dxcb-errors=enabled +WLROOTS_DEPENDENCIES += xcb-util +else +WLROOTS_CONF_OPTS += -Dxcb-errors=disabled +endif +ifeq ($(BR2_PACKAGE_XCB_UTIL_WM),y) +WLROOTS_CONF_OPTS += -Dxcb-icccm=enabled +WLROOTS_DEPENDENCIES += xcb-util-wm +else +WLROOTS_CONF_OPTS += -Dxcb-icccm=disabled +endif +else +WLROOTS_CONF_OPTS += -Dxwayland=disabled -Dxcb-errors=disabled -Dxcb-icccm=disabled +endif + +ifeq ($(BR2_PACKAGE_WLROOTS_ROOTSTON),y) +WLROOTS_CONF_OPTS += -Drootston=true +else +WLROOTS_CONF_OPTS += -Drootston=false +endif + +$(eval $(meson-package)) From patchwork Thu May 16 22:08:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Perez de Castro X-Patchwork-Id: 1100755 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=igalia.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.b="Hn+iwzyu"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 454lv45pXlz9s4Y for ; Fri, 17 May 2019 08:09:04 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 23DC68814B; Thu, 16 May 2019 22:09:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OStYAoFL7pJe; Thu, 16 May 2019 22:09:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id D989E88134; Thu, 16 May 2019 22:09:01 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 098601BF3AD for ; Thu, 16 May 2019 22:08:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0662B88134 for ; Thu, 16 May 2019 22:08:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K5Wc8Sku63yK for ; Thu, 16 May 2019 22:08:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from fanzine.igalia.com (fanzine.igalia.com [91.117.99.155]) by hemlock.osuosl.org (Postfix) with ESMTPS id 9CDF785207 for ; Thu, 16 May 2019 22:08:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From; bh=fkI9xRd7yAqJCUzGMynEEoLeF4f/3Z3WCY4YgdhlVEA=; b=Hn+iwzyuaO9OlnWQadISzMKn01yqasz6Y7ts2QqvGM6M7g3yVw3t8n1g/ufzowXW8R4HjM3bXz697iRTUcYr46QR5lRoSTca0wL0bzp+BCx6D21aXhHrpmV872ZYtuMsz1fBJ8ekim5PNNF44qZCY5N8yZIkLXRFYc7V8EVT7cN9EY4A6aqrnIoM+PRwwQVwolqxWkWFtyK5ngRSCKBqTH+g26rUTZs6+ysD6pJ9QXnyzjKcEPEInANf1GL1FB/CqC64l4r7A/ZpRrSYZjlD1K7lAulqm01rJzw43mJCNju8nwMDEEyNU/DujP6TKHRA3A6xJfprOPquBcwSeOraGQ==; Received: from mobile-access-b04827-38.dhcp.inet.fi ([176.72.39.38] helo=kodama) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1hROYX-0001uU-MX for ; Fri, 17 May 2019 00:08:53 +0200 Received: from localhost (kodama [local]) by kodama (OpenSMTPD) with ESMTPA id a7d9fdfe for ; Thu, 16 May 2019 22:08:36 +0000 (UTC) From: Adrian Perez de Castro To: buildroot@buildroot.org Date: Fri, 17 May 2019 01:08:36 +0300 Message-Id: <20190516220836.24543-3-aperez@igalia.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190516220836.24543-1-aperez@igalia.com> References: <20190516220836.24543-1-aperez@igalia.com> MIME-Version: 1.0 Subject: [Buildroot] [RFC PATCH/next 2/2] package/cage: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Cage is a "kiosk" Wayland compositor, which shows a single maximized application at a time and limits user interaction to that application. https://www.hjdskes.nl/projects/cage/ Signed-off-by: Adrian Perez de Castro --- package/Config.in | 1 + .../cage/0001-Updates-for-wlroots-0.6.0.patch | 264 ++++++++++++++++++ package/cage/Config.in | 24 ++ package/cage/cage.hash | 5 + package/cage/cage.mk | 19 ++ 5 files changed, 313 insertions(+) create mode 100644 package/cage/0001-Updates-for-wlroots-0.6.0.patch create mode 100644 package/cage/Config.in create mode 100644 package/cage/cage.hash create mode 100644 package/cage/cage.mk diff --git a/package/Config.in b/package/Config.in index 5b1f279b8e..7cac6de79f 100644 --- a/package/Config.in +++ b/package/Config.in @@ -328,6 +328,7 @@ comment "QT libraries and helper libraries" source "package/quazip/Config.in" source "package/qwt/Config.in" endif + source "package/cage/Config.in" source "package/tekui/Config.in" source "package/weston/Config.in" source "package/x11r7/Config.in" diff --git a/package/cage/0001-Updates-for-wlroots-0.6.0.patch b/package/cage/0001-Updates-for-wlroots-0.6.0.patch new file mode 100644 index 0000000000..57e5a1289a --- /dev/null +++ b/package/cage/0001-Updates-for-wlroots-0.6.0.patch @@ -0,0 +1,264 @@ +From 86b9d6719e52cbddda4fb6d055e60e9caf9a57ff Mon Sep 17 00:00:00 2001 +From: Jente Hidskes +Date: Fri, 3 May 2019 19:39:19 +0200 +Subject: [PATCH 1/3] CI: use wlroots 0.6.0 + +Signed-off-by: Adrian Perez de Castro +[Upstream status: https://github.com/Hjdskes/cage/pull/65] + +--- + .builds/alpine.yml | 4 ++-- + .builds/archlinux.yml | 4 ++-- + .builds/freebsd.yml | 4 ++-- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/.builds/alpine.yml b/.builds/alpine.yml +index 909bd0e..2c6d089 100644 +--- a/.builds/alpine.yml ++++ b/.builds/alpine.yml +@@ -17,8 +17,8 @@ tasks: + # version, instead of master, to avoid any breaking changes in wlroots. + - wlroots: | + cd wlroots +- # This corresponds to the tag of 0.5.0 +- git checkout c9137cba691b57c3eaf3ff94f9bf8e623f66ccc5 ++ # This corresponds to the tag of 0.6.0 ++ git checkout c0305f4f864543f8c3fea6f302e91c9b1d3396f3 + meson --prefix=/usr build -Drootston=false -Dexamples=false + ninja -C build + sudo ninja -C build install +diff --git a/.builds/archlinux.yml b/.builds/archlinux.yml +index b270c40..e052118 100644 +--- a/.builds/archlinux.yml ++++ b/.builds/archlinux.yml +@@ -15,8 +15,8 @@ tasks: + # version, instead of master, to avoid any breaking changes in wlroots. + - wlroots: | + cd wlroots +- # This corresponds to the tag of 0.5.0 +- git checkout c9137cba691b57c3eaf3ff94f9bf8e623f66ccc5 ++ # This corresponds to the tag of 0.6.0 ++ git checkout c0305f4f864543f8c3fea6f302e91c9b1d3396f3 + meson --prefix=/usr build -Drootston=false -Dexamples=false + ninja -C build + sudo ninja -C build install +diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml +index f1a4f52..274eaaa 100644 +--- a/.builds/freebsd.yml ++++ b/.builds/freebsd.yml +@@ -18,8 +18,8 @@ tasks: + # version, instead of master, to avoid any breaking changes in wlroots. + - wlroots: | + cd wlroots +- # This corresponds to the tag of 0.5.0 +- git checkout c9137cba691b57c3eaf3ff94f9bf8e623f66ccc5 ++ # This corresponds to the tag of 0.6.0 ++ git checkout c0305f4f864543f8c3fea6f302e91c9b1d3396f3 + meson --prefix=/usr/local build -Drootston=false -Dexamples=false + ninja -C build + sudo ninja -C build install + +From 08ecd52a3313d00d06cc4e12d4d3243865af5dd0 Mon Sep 17 00:00:00 2001 +From: Drew DeVault +Date: Thu, 25 Apr 2019 11:40:25 -0400 +Subject: [PATCH 2/3] Update to wlroots 0.6.0 + +--- + output.c | 15 ++++++++------- + xdg_shell.c | 12 ++++++------ + 2 files changed, 14 insertions(+), 13 deletions(-) + +diff --git a/output.c b/output.c +index c682dcc..1849486 100644 +--- a/output.c ++++ b/output.c +@@ -198,23 +198,23 @@ handle_output_damage_frame(struct wl_listener *listener, void *data) + struct timespec now; + clock_gettime(CLOCK_MONOTONIC, &now); + +- bool needs_swap; ++ bool needs_frame; + pixman_region32_t damage; + pixman_region32_init(&damage); +- if (!wlr_output_damage_make_current(output->damage, &needs_swap, &damage)) { ++ if (!wlr_output_damage_attach_render(output->damage, &needs_frame, &damage)) { + wlr_log(WLR_ERROR, "Cannot make damage output current"); + goto damage_finish; + } + +- if (!needs_swap) { +- wlr_log(WLR_DEBUG, "Output doesn't need swap and isn't damaged"); ++ if (!needs_frame) { ++ wlr_log(WLR_DEBUG, "Output doesn't need frame and isn't damaged"); + goto damage_finish; + } + + wlr_renderer_begin(renderer, output->wlr_output->width, output->wlr_output->height); + + if (!pixman_region32_not_empty(&damage)) { +- wlr_log(WLR_DEBUG, "Output isn't damaged but needs a buffer swap"); ++ wlr_log(WLR_DEBUG, "Output isn't damaged but needs a buffer frame"); + goto renderer_end; + } + +@@ -267,8 +267,9 @@ handle_output_damage_frame(struct wl_listener *listener, void *data) + enum wl_output_transform transform = wlr_output_transform_invert(output->wlr_output->transform); + wlr_region_transform(&damage, &damage, transform, output_width, output_height); + +- if (!wlr_output_damage_swap_buffers(output->damage, &now, &damage)) { +- wlr_log(WLR_ERROR, "Could not swap buffers"); ++ wlr_output_set_damage(output->wlr_output, &damage); ++ if (!wlr_output_commit(output->wlr_output)) { ++ wlr_log(WLR_ERROR, "Could not commit output"); + } + + damage_finish: +diff --git a/xdg_shell.c b/xdg_shell.c +index 4fcb00e..f964f76 100644 +--- a/xdg_shell.c ++++ b/xdg_shell.c +@@ -94,15 +94,15 @@ popup_unconstrain(struct cg_xdg_popup *popup) + { + struct cg_view *view = popup->view_child.view; + struct wlr_output *output = view->server->output->wlr_output; ++ struct wlr_output_layout *output_layout = view->server->output_layout; + +- int width, height; +- wlr_output_effective_resolution(output, &width, &height); ++ struct wlr_box *output_box = wlr_output_layout_get_box(output_layout, output); + + struct wlr_box output_toplevel_box = { +- .x = output->lx - view->x, +- .y = output->ly - view->y, +- .width = width, +- .height = height ++ .x = output_box->x - view->x, ++ .y = output_box->y - view->y, ++ .width = output_box->width, ++ .height = output_box->height + }; + + wlr_xdg_popup_unconstrain_from_box(popup->wlr_popup, &output_toplevel_box); + +From 711aebb4d20848d2d9052e0483cd301c7022b844 Mon Sep 17 00:00:00 2001 +From: Jente Hidskes +Date: Fri, 3 May 2019 20:53:19 +0200 +Subject: [PATCH 3/3] output: don't submit too much damage + +See https://github.com/swaywm/wlroots/issues/1666#issue-436967396 and +the linked changes +https://github.com/swaywm/wlroots/pull/1668/files#diff-95fe5e5b411cc64a5dc31e2b72669a0d +--- + output.c | 38 ++++++++++++++++++++++---------------- + 1 file changed, 22 insertions(+), 16 deletions(-) + +diff --git a/output.c b/output.c +index 1849486..bfb4822 100644 +--- a/output.c ++++ b/output.c +@@ -152,7 +152,7 @@ render_surface(struct wlr_surface *surface, int sx, int sy, void *data) + pixman_region32_union_rect(&damage, &damage, box.x, box.y, box.width, box.height); + pixman_region32_intersect(&damage, &damage, rdata->damage); + if (!pixman_region32_not_empty(&damage)) { +- goto damage_finish; ++ goto buffer_damage_finish; + } + + float matrix[9]; +@@ -166,7 +166,7 @@ render_surface(struct wlr_surface *surface, int sx, int sy, void *data) + wlr_render_texture_with_matrix(surface->renderer, texture, matrix, 1); + } + +- damage_finish: ++ buffer_damage_finish: + pixman_region32_fini(&damage); + } + +@@ -199,21 +199,21 @@ handle_output_damage_frame(struct wl_listener *listener, void *data) + clock_gettime(CLOCK_MONOTONIC, &now); + + bool needs_frame; +- pixman_region32_t damage; +- pixman_region32_init(&damage); +- if (!wlr_output_damage_attach_render(output->damage, &needs_frame, &damage)) { ++ pixman_region32_t buffer_damage; ++ pixman_region32_init(&buffer_damage); ++ if (!wlr_output_damage_attach_render(output->damage, &needs_frame, &buffer_damage)) { + wlr_log(WLR_ERROR, "Cannot make damage output current"); +- goto damage_finish; ++ goto buffer_damage_finish; + } + + if (!needs_frame) { + wlr_log(WLR_DEBUG, "Output doesn't need frame and isn't damaged"); +- goto damage_finish; ++ goto buffer_damage_finish; + } + + wlr_renderer_begin(renderer, output->wlr_output->width, output->wlr_output->height); + +- if (!pixman_region32_not_empty(&damage)) { ++ if (!pixman_region32_not_empty(&buffer_damage)) { + wlr_log(WLR_DEBUG, "Output isn't damaged but needs a buffer frame"); + goto renderer_end; + } +@@ -226,7 +226,7 @@ handle_output_damage_frame(struct wl_listener *listener, void *data) + + float color[4] = {0.3, 0.3, 0.3, 1.0}; + int nrects; +- pixman_box32_t *rects = pixman_region32_rectangles(&damage, &nrects); ++ pixman_box32_t *rects = pixman_region32_rectangles(&buffer_damage, &nrects); + for (int i = 0; i < nrects; i++) { + scissor_output(output->wlr_output, &rects[i]); + wlr_renderer_clear(renderer, color); +@@ -236,7 +236,7 @@ handle_output_damage_frame(struct wl_listener *listener, void *data) + .output_layout = output->server->output_layout, + .output = output->wlr_output, + .when = &now, +- .damage = &damage, ++ .damage = &buffer_damage, + }; + + struct cg_view *view; +@@ -251,29 +251,35 @@ handle_output_damage_frame(struct wl_listener *listener, void *data) + renderer_end: + /* Draw software cursor in case hardware cursors aren't + available. This is a no-op when they are. */ +- wlr_output_render_software_cursors(output->wlr_output, &damage); ++ wlr_output_render_software_cursors(output->wlr_output, &buffer_damage); + wlr_renderer_scissor(renderer, NULL); + wlr_renderer_end(renderer); + + int output_width, output_height; + wlr_output_transformed_resolution(output->wlr_output, &output_width, &output_height); + ++ pixman_region32_t output_damage; ++ pixman_region32_init(&output_damage); ++ + #ifdef DEBUG + if (output->server->debug_damage_tracking) { +- pixman_region32_union_rect(&damage, &damage, 0, 0, output_width, output_height); ++ pixman_region32_union_rect(&output_damage, &output_damage, 0, 0, output_width, output_height); + } + #endif + + enum wl_output_transform transform = wlr_output_transform_invert(output->wlr_output->transform); +- wlr_region_transform(&damage, &damage, transform, output_width, output_height); ++ wlr_region_transform(&output_damage, &output->damage->current, transform, output_width, output_height); ++ ++ wlr_output_set_damage(output->wlr_output, &output_damage); ++ pixman_region32_fini(&output_damage); + +- wlr_output_set_damage(output->wlr_output, &damage); + if (!wlr_output_commit(output->wlr_output)) { + wlr_log(WLR_ERROR, "Could not commit output"); ++ goto buffer_damage_finish; + } + +- damage_finish: +- pixman_region32_fini(&damage); ++ buffer_damage_finish: ++ pixman_region32_fini(&buffer_damage); + + wl_list_for_each_reverse(view, &output->server->views, link) { + view_for_each_surface(view, send_frame_done, &now); diff --git a/package/cage/Config.in b/package/cage/Config.in new file mode 100644 index 0000000000..07dc4c9da3 --- /dev/null +++ b/package/cage/Config.in @@ -0,0 +1,24 @@ +config BR2_PACKAGE_CAGE + bool "cage" + depends on !BR2_STATIC_LIBS # wlroots + depends on BR2_TOOLCHAIN_HAS_THREADS # wlroots + select BR2_PACKAGE_WLROOTS + help + Kiosk compositor for Wayland, which displays a single + maximized application at a time. + + https://www.hjdskes.nl/projects/cage/ + +if BR2_PACKAGE_CAGE + +config BR2_PACKAGE_CAGE_XWAYLAND + bool "XWayland support" + depends on BR2_PACKAGE_XORG7 # wlroots + depends on BR2_PACKAGE_WLROOTS_XWAYLAND + help + Enable support for running X11 applications through XWayland + +comment "XWayland supports needs X.org and support in wlroots enabled" + depends on !BR2_PACKAGE_XORG7 || !BR2_PACKAGE_WLROOTS_XWAYLAND + +endif diff --git a/package/cage/cage.hash b/package/cage/cage.hash new file mode 100644 index 0000000000..5609b073d6 --- /dev/null +++ b/package/cage/cage.hash @@ -0,0 +1,5 @@ +# Generated locally +sha256 03e2b4d97744aead935f4a289e5cfda4888dd06c6586982f4a25c8f435ef4166 v0.1.tar.gz + +# Hashes for license files: +sha256 1fd28695090b961ed2846627365489228d84f784bff60a90e933febcedaeb65d LICENSE diff --git a/package/cage/cage.mk b/package/cage/cage.mk new file mode 100644 index 0000000000..b24eb743ee --- /dev/null +++ b/package/cage/cage.mk @@ -0,0 +1,19 @@ +################################################################################ +# +# cage +# +################################################################################ + +CAGE_VERSION = 0.1 +CAGE_SITE = https://github.com/Hjdskes/cage/archive +CAGE_SOURCE = v$(CAGE_VERSION).tar.gz +CAGE_LICENSE = MIT +CAGE_DEPENDENCIES = host-pkgconf wlroots + +ifeq ($(BR2_PACKAGE_CAGE_XWAYLAND),y) +CAGE_CONF_OPTS = -Dxwayland=true +else +CAGE_CONF_OPTS = -Dxwayland=false +endif + +$(eval $(meson-package))