Skip to contentSkip to conversation

DONOTMERGE: weston: overlay version 9.0.0 locally

PATCH In review Denys Dmytriyenko 2 participants 2 messages Mar 29, 2022 – Mar 30, 2022 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 DONOTMERGE: weston: overlay version 9.0.0 locally

From: Denys Dmytriyenko <[email protected]>

OE-Core has upgraded weston to 10.0.0, that requires some new Mesa/GBM APIs, which currently breaks with SGX and RGX DDK versions provided by meta-ti. Until DDKs are upgraded in meta-ti, overlay older weston 9.0.0 directly from OE-Core before the upgrade, in order to get graphics stack built.

---
 ...d-drm-Re-order-gbm-destruction-at-DR.patch |  50 +++++
 ...001-meson.build-fix-incorrect-header.patch |  32 +++
 ...ntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch |  47 +++++
 ...ovide-a-default-version-that-doesn-t.patch | 199 ++++++++++++++++++
 .../weston/dont-use-plane-add-prop.patch      |  23 ++
 .../weston/systemd-notify.weston-start        |   9 +
 .../wayland/weston/weston.desktop             |   9 +
 .../wayland/weston/weston.png                 | Bin 0 -> 2383 bytes
 .../wayland/weston/xwayland.weston-start      |   5 +
 .../recipes-graphics/wayland/weston_9.0.0.bb  | 143 +++++++++++++
 10 files changed, 517 insertions(+)
 create mode 100644 meta-arago-extras/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch
 create mode 100644 meta-arago-extras/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch
 create mode 100644 meta-arago-extras/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch
 create mode 100644 meta-arago-extras/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
 create mode 100644 meta-arago-extras/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch
 create mode 100644 meta-arago-extras/recipes-graphics/wayland/weston/systemd-notify.weston-start
 create mode 100644 meta-arago-extras/recipes-graphics/wayland/weston/weston.desktop
 create mode 100644 meta-arago-extras/recipes-graphics/wayland/weston/weston.png
 create mode 100644 meta-arago-extras/recipes-graphics/wayland/weston/xwayland.weston-start
 create mode 100644 meta-arago-extras/recipes-graphics/wayland/weston_9.0.0.bb
meta-arago-extras/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch new file +50 -0
new file mode 100644
index 00000000..f8f75894
@@ -0,0 +1,50 @@
+From c8bfa1f8d576cdc6d515dbbac36c48c6166be0d5 Mon Sep 17 00:00:00 2001
+From: Marius Vlad <[email protected]>
+Date: Thu, 1 Apr 2021 00:12:00 +0300
+Subject: [PATCH] libweston/backend-drm: Re-order gbm destruction at DRM-backend tear down
+
+Tearing down the drm-backend when there are no input devices, would call
+for the gbm device destruction before compositor shutdown. The latter
+would call into the renderer detroy function and assume that the
+EGLDisplay, which was created using the before-mentioned gbm device, is
+still available. This patch re-orders the gbm destruction after the
+compositor shutdown when no one would make use of it.
+
+Fixes: #314
+
+Signed-off-by: Marius Vlad <[email protected]>
+Suggested-by: Daniel Stone <[email protected]>
+
+Upstream-Status: Backport [https://gitlab.freedesktop.org/wayland/weston/-/commit/d171c7b3ba346c4d0bd6494f45ebf0be3c3cc5fb]
+---
+ libweston/backend-drm/drm.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
+index 2780f3b..fbcfeca 100644
+--- a/libweston/backend-drm/drm.c
++++ b/libweston/backend-drm/drm.c
+@@ -3025,10 +3025,6 @@ err_drm_source:
+ err_udev_input:
+ 	udev_input_destroy(&b->input);
+ err_sprite:
+-#ifdef BUILD_DRM_GBM
+-	if (b->gbm)
+-		gbm_device_destroy(b->gbm);
+-#endif
+ 	destroy_sprites(b);
+ err_udev_dev:
+ 	udev_device_unref(drm_device);
+@@ -3038,6 +3034,10 @@ err_launcher:
+ 	weston_launcher_destroy(compositor->launcher);
+ err_compositor:
+ 	weston_compositor_shutdown(compositor);
++#ifdef BUILD_DRM_GBM
++	if (b->gbm)
++		gbm_device_destroy(b->gbm);
++#endif
+ 	free(b);
+ 	return NULL;
+ }
+--
+2.33.0
meta-arago-extras/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch new file +32 -0
new file mode 100644
index 00000000..06e0f7ba
@@ -0,0 +1,32 @@
+From a2ba4714a6872e547621d29d9ddcb0f374b88cf6 Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+Date: Tue, 20 Apr 2021 20:42:18 -0700
+Subject: [PATCH] meson.build: fix incorrect header
+
+The wayland.c actually include 'xdg-shell-client-protocol.h' instead of
+the server one, so fix it. Otherwise, it's possible to get build failure
+due to race condition.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ libweston/backend-wayland/meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libweston/backend-wayland/meson.build b/libweston/backend-wayland/meson.build
+index 7e82513..29270b5 100644
+--- a/libweston/backend-wayland/meson.build
++++ b/libweston/backend-wayland/meson.build
+@@ -10,7 +10,7 @@ srcs_wlwl = [
+ 	fullscreen_shell_unstable_v1_protocol_c,
+ 	presentation_time_protocol_c,
+ 	presentation_time_server_protocol_h,
+-	xdg_shell_server_protocol_h,
++	xdg_shell_client_protocol_h,
+ 	xdg_shell_protocol_c,
+ ]
+ 
+-- 
+2.30.2
+
meta-arago-extras/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch new file +47 -0

47 lines not on this page · raw message

meta-arago-extras/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch new file +199 -0

199 lines not on this page · raw message

meta-arago-extras/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch new file +23 -0
new file mode 100644
index 00000000..a4444e5d
@@ -0,0 +1,23 @@
+Fix atomic modesetting with musl
+
+atomic modesetting seems to fail with drm weston backend and this patch fixes
+it, below errors are seen before weston exits
+
+atomic: couldn't commit new state: Invalid argument
+
+Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/weston/-/issues/158]
+Signed-off-by: Khem Raj <[email protected]>
+
+--- a/libweston/backend-drm/kms.c
++++ b/libweston/backend-drm/kms.c
+@@ -1168,8 +1168,8 @@ drm_pending_state_apply_atomic(struct dr
+ 		wl_list_for_each(plane, &b->plane_list, link) {
+ 			drm_debug(b, "\t\t[atomic] starting with plane %lu disabled\n",
+ 				  (unsigned long) plane->plane_id);
+-			plane_add_prop(req, plane, WDRM_PLANE_CRTC_ID, 0);
+-			plane_add_prop(req, plane, WDRM_PLANE_FB_ID, 0);
++			//plane_add_prop(req, plane, WDRM_PLANE_CRTC_ID, 0);
++			//plane_add_prop(req, plane, WDRM_PLANE_FB_ID, 0);
+ 		}
+ 
+ 		flags |= DRM_MODE_ATOMIC_ALLOW_MODESET;
meta-arago-extras/recipes-graphics/wayland/weston/systemd-notify.weston-start new file +9 -0
new file mode 100644
index 00000000..a97e7b38
@@ -0,0 +1,9 @@
+#!/bin/sh
+  
+# SPDX-FileCopyrightText: Huawei Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+
+if [[ -x "/usr/lib/weston/systemd-notify.so" ]]; then
+        add_weston_module "systemd-notify.so"
+fi
meta-arago-extras/recipes-graphics/wayland/weston/weston.desktop new file +9 -0
new file mode 100644
index 00000000..1086ae8b
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Application
+Name=Weston
+Comment=Wayland Compostitor
+Exec=weston
+Icon=weston
+Terminal=false
+Categories=Utility;
meta-arago-extras/recipes-graphics/wayland/weston/weston.png new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..ea8b7e0e233c86301a88e5bc925f09b3de2f9dec
GIT binary patch
meta-arago-extras/recipes-graphics/wayland/weston/xwayland.weston-start new file +5 -0
new file mode 100644
index 00000000..db384b1a
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+if type Xwayland  >/dev/null 2>/dev/null; then
+	mkdir -p /tmp/.X11-unix
+fi
meta-arago-extras/recipes-graphics/wayland/weston_9.0.0.bb new file +143 -0

143 lines not on this page · raw message

Signature · 1 line
2.25.1
#1 lore raw
Quoted 7 lines · Denys Dmytriyenko

From: Denys Dmytriyenko <[email protected]>

OE-Core has upgraded weston to 10.0.0, that requires some new Mesa/GBM APIs, which currently breaks with SGX and RGX DDK versions provided by meta-ti. Until DDKs are upgraded in meta-ti, overlay older weston 9.0.0 directly from OE-Core before the upgrade, in order to get graphics stack built.

If this is so we can continue to build-test all the graphics stack components before our GPU driver support the needed APIs, would it be better to patch the GPU driver stack with the needed Mesa/GBM APIs as dummies? (just enough to make the build test work)

Otherwise, building out Weston 9 and all the components on top of that, doesn't prove out much if we still have to switch to Weston 10 when it's time for kirkstone..

Andrew