diff options
Diffstat (limited to 'meta/recipes-graphics/wayland/weston')
5 files changed, 11 insertions, 330 deletions
diff --git a/meta/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch b/meta/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch deleted file mode 100644 index f8f7589499..0000000000 --- a/meta/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | From c8bfa1f8d576cdc6d515dbbac36c48c6166be0d5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Marius Vlad <marius.vlad@collabora.com> | ||
3 | Date: Thu, 1 Apr 2021 00:12:00 +0300 | ||
4 | Subject: [PATCH] libweston/backend-drm: Re-order gbm destruction at DRM-backend tear down | ||
5 | |||
6 | Tearing down the drm-backend when there are no input devices, would call | ||
7 | for the gbm device destruction before compositor shutdown. The latter | ||
8 | would call into the renderer detroy function and assume that the | ||
9 | EGLDisplay, which was created using the before-mentioned gbm device, is | ||
10 | still available. This patch re-orders the gbm destruction after the | ||
11 | compositor shutdown when no one would make use of it. | ||
12 | |||
13 | Fixes: #314 | ||
14 | |||
15 | Signed-off-by: Marius Vlad <marius.vlad@collabora.com> | ||
16 | Suggested-by: Daniel Stone <daniel.stone@collabora.com> | ||
17 | |||
18 | Upstream-Status: Backport [https://gitlab.freedesktop.org/wayland/weston/-/commit/d171c7b3ba346c4d0bd6494f45ebf0be3c3cc5fb] | ||
19 | --- | ||
20 | libweston/backend-drm/drm.c | 8 ++++---- | ||
21 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
22 | |||
23 | diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c | ||
24 | index 2780f3b..fbcfeca 100644 | ||
25 | --- a/libweston/backend-drm/drm.c | ||
26 | +++ b/libweston/backend-drm/drm.c | ||
27 | @@ -3025,10 +3025,6 @@ err_drm_source: | ||
28 | err_udev_input: | ||
29 | udev_input_destroy(&b->input); | ||
30 | err_sprite: | ||
31 | -#ifdef BUILD_DRM_GBM | ||
32 | - if (b->gbm) | ||
33 | - gbm_device_destroy(b->gbm); | ||
34 | -#endif | ||
35 | destroy_sprites(b); | ||
36 | err_udev_dev: | ||
37 | udev_device_unref(drm_device); | ||
38 | @@ -3038,6 +3034,10 @@ err_launcher: | ||
39 | weston_launcher_destroy(compositor->launcher); | ||
40 | err_compositor: | ||
41 | weston_compositor_shutdown(compositor); | ||
42 | +#ifdef BUILD_DRM_GBM | ||
43 | + if (b->gbm) | ||
44 | + gbm_device_destroy(b->gbm); | ||
45 | +#endif | ||
46 | free(b); | ||
47 | return NULL; | ||
48 | } | ||
49 | -- | ||
50 | 2.33.0 | ||
diff --git a/meta/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch b/meta/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch deleted file mode 100644 index 06e0f7baec..0000000000 --- a/meta/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | From a2ba4714a6872e547621d29d9ddcb0f374b88cf6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Chen Qi <Qi.Chen@windriver.com> | ||
3 | Date: Tue, 20 Apr 2021 20:42:18 -0700 | ||
4 | Subject: [PATCH] meson.build: fix incorrect header | ||
5 | |||
6 | The wayland.c actually include 'xdg-shell-client-protocol.h' instead of | ||
7 | the server one, so fix it. Otherwise, it's possible to get build failure | ||
8 | due to race condition. | ||
9 | |||
10 | Upstream-Status: Pending | ||
11 | |||
12 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> | ||
13 | --- | ||
14 | libweston/backend-wayland/meson.build | 2 +- | ||
15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
16 | |||
17 | diff --git a/libweston/backend-wayland/meson.build b/libweston/backend-wayland/meson.build | ||
18 | index 7e82513..29270b5 100644 | ||
19 | --- a/libweston/backend-wayland/meson.build | ||
20 | +++ b/libweston/backend-wayland/meson.build | ||
21 | @@ -10,7 +10,7 @@ srcs_wlwl = [ | ||
22 | fullscreen_shell_unstable_v1_protocol_c, | ||
23 | presentation_time_protocol_c, | ||
24 | presentation_time_server_protocol_h, | ||
25 | - xdg_shell_server_protocol_h, | ||
26 | + xdg_shell_client_protocol_h, | ||
27 | xdg_shell_protocol_c, | ||
28 | ] | ||
29 | |||
30 | -- | ||
31 | 2.30.2 | ||
32 | |||
diff --git a/meta/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch b/meta/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch deleted file mode 100644 index 6fe86ff3f0..0000000000 --- a/meta/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | From 58760e09eed662a72da939ff4802d605489cff8e Mon Sep 17 00:00:00 2001 | ||
2 | From: Denys Dmytriyenko <denys@ti.com> | ||
3 | Date: Tue, 8 Sep 2020 19:37:42 -0400 | ||
4 | Subject: [PATCH] tests: include fcntl.h for open(), O_RDWR, O_CLOEXEC and | ||
5 | O_CREAT | ||
6 | |||
7 | musl libc (unlike glibc) requires explicitly incuding fcntl.h to define open(), | ||
8 | O_RDWR, O_CLOEXEC and O_CREAT. Otherwise the build fails with the errors: | ||
9 | |||
10 | | ../weston-9.0.0/tests/weston-test-fixture-compositor.c: In function 'wait_for_lock': | ||
11 | | ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:7: warning: implicit declaration of function 'open'; did you mean 'popen'? [-Wimplicit-function-declaration] | ||
12 | | 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700); | ||
13 | | | ^~~~ | ||
14 | | | popen | ||
15 | | ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:23: error: 'O_RDWR' undeclared (first use in this function) | ||
16 | | 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700); | ||
17 | | | ^~~~~~ | ||
18 | | ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:23: note: each undeclared identifier is reported only once for each function it appears in | ||
19 | | ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:32: error: 'O_CLOEXEC' undeclared (first use in this function) | ||
20 | | 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700); | ||
21 | | | ^~~~~~~~~ | ||
22 | | ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:44: error: 'O_CREAT' undeclared (first use in this function) | ||
23 | | 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700); | ||
24 | | | ^~~~~~~ | ||
25 | |||
26 | Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/493/diffs?commit_id=b10c0e843dcb8148bbe869bb15261955b94ac98c] | ||
27 | |||
28 | Signed-off-by: Denys Dmytriyenko <denys@ti.com> | ||
29 | --- | ||
30 | tests/weston-test-fixture-compositor.c | 1 + | ||
31 | 1 file changed, 1 insertion(+) | ||
32 | |||
33 | diff --git a/tests/weston-test-fixture-compositor.c b/tests/weston-test-fixture-compositor.c | ||
34 | index 0c9855f..e0e32c9 100644 | ||
35 | --- a/tests/weston-test-fixture-compositor.c | ||
36 | +++ b/tests/weston-test-fixture-compositor.c | ||
37 | @@ -31,6 +31,7 @@ | ||
38 | #include <unistd.h> | ||
39 | #include <sys/file.h> | ||
40 | #include <errno.h> | ||
41 | +#include <fcntl.h> | ||
42 | |||
43 | #include "shared/helpers.h" | ||
44 | #include "weston-test-fixture-compositor.h" | ||
45 | -- | ||
46 | 2.7.4 | ||
47 | |||
diff --git a/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch b/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch deleted file mode 100644 index f6ebfd8f61..0000000000 --- a/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch +++ /dev/null | |||
@@ -1,199 +0,0 @@ | |||
1 | From a1548c742bf2dedbb47282d8a00407b60bbab669 Mon Sep 17 00:00:00 2001 | ||
2 | From: Tom Hochstein <tom.hochstein@nxp.com> | ||
3 | Date: Wed, 22 Feb 2017 15:53:30 +0200 | ||
4 | Subject: [PATCH] weston-launch: Provide a default version that doesn't require | ||
5 | |||
6 | PAM | ||
7 | |||
8 | weston-launch requires PAM for starting weston as a non-root user. | ||
9 | |||
10 | Since starting weston as root is a valid use case by itself, if | ||
11 | PAM is not available, provide a default version of weston-launch | ||
12 | without non-root-user support. | ||
13 | |||
14 | Upstream-Status: Denied [https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/725] | ||
15 | |||
16 | Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com> | ||
17 | Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> | ||
18 | Signed-off-by: Denys Dmytriyenko <denys@ti.com> | ||
19 | Signed-off-by: Ming Liu <ming.liu@toradex.com> | ||
20 | |||
21 | --- | ||
22 | libweston/meson.build | 16 ++++++++++++---- | ||
23 | libweston/weston-launch.c | 21 +++++++++++++++++++++ | ||
24 | meson_options.txt | 7 +++++++ | ||
25 | 3 files changed, 40 insertions(+), 4 deletions(-) | ||
26 | |||
27 | diff --git a/libweston/meson.build b/libweston/meson.build | ||
28 | index 08d23ec..cb9fd3f 100644 | ||
29 | --- a/libweston/meson.build | ||
30 | +++ b/libweston/meson.build | ||
31 | @@ -216,16 +216,24 @@ dep_vertex_clipping = declare_dependency( | ||
32 | ) | ||
33 | |||
34 | if get_option('weston-launch') | ||
35 | - dep_pam = cc.find_library('pam') | ||
36 | + deps_weston_launch = [systemd_dep, dep_libdrm] | ||
37 | |||
38 | - if not cc.has_function('pam_open_session', dependencies: dep_pam) | ||
39 | - error('pam_open_session not found for weston-launch') | ||
40 | + if get_option('pam') | ||
41 | + dep_pam = cc.find_library('pam') | ||
42 | + if not cc.has_function('pam_open_session', dependencies: dep_pam) | ||
43 | + error('pam_open_session not found for weston-launch') | ||
44 | + endif | ||
45 | + | ||
46 | + if dep_pam.found() | ||
47 | + deps_weston_launch += dep_pam | ||
48 | + config_h.set('HAVE_PAM', '1') | ||
49 | + endif | ||
50 | endif | ||
51 | |||
52 | executable( | ||
53 | 'weston-launch', | ||
54 | 'weston-launch.c', | ||
55 | - dependencies: [dep_pam, systemd_dep, dep_libdrm], | ||
56 | + dependencies: deps_weston_launch, | ||
57 | include_directories: common_inc, | ||
58 | install: true | ||
59 | ) | ||
60 | diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c | ||
61 | index 521cb2c..2d42d33 100644 | ||
62 | --- a/libweston/weston-launch.c | ||
63 | +++ b/libweston/weston-launch.c | ||
64 | @@ -51,7 +51,9 @@ | ||
65 | |||
66 | #include <pwd.h> | ||
67 | #include <grp.h> | ||
68 | +#ifdef HAVE_PAM | ||
69 | #include <security/pam_appl.h> | ||
70 | +#endif | ||
71 | |||
72 | #ifdef HAVE_SYSTEMD_LOGIN | ||
73 | #include <systemd/sd-login.h> | ||
74 | @@ -100,8 +102,10 @@ drmSetMaster(int drm_fd) | ||
75 | #endif | ||
76 | |||
77 | struct weston_launch { | ||
78 | +#ifdef HAVE_PAM | ||
79 | struct pam_conv pc; | ||
80 | pam_handle_t *ph; | ||
81 | +#endif | ||
82 | int tty; | ||
83 | int ttynr; | ||
84 | int sock[2]; | ||
85 | @@ -192,6 +196,7 @@ weston_launch_allowed(struct weston_launch *wl) | ||
86 | return false; | ||
87 | } | ||
88 | |||
89 | +#ifdef HAVE_PAM | ||
90 | static int | ||
91 | pam_conversation_fn(int msg_count, | ||
92 | const struct pam_message **messages, | ||
93 | @@ -232,6 +237,7 @@ setup_pam(struct weston_launch *wl) | ||
94 | |||
95 | return 0; | ||
96 | } | ||
97 | +#endif | ||
98 | |||
99 | static int | ||
100 | setup_launcher_socket(struct weston_launch *wl) | ||
101 | @@ -466,6 +472,7 @@ quit(struct weston_launch *wl, int status) | ||
102 | close(wl->signalfd); | ||
103 | close(wl->sock[0]); | ||
104 | |||
105 | +#ifdef HAVE_PAM | ||
106 | if (wl->new_user) { | ||
107 | err = pam_close_session(wl->ph, 0); | ||
108 | if (err) | ||
109 | @@ -473,6 +480,7 @@ quit(struct weston_launch *wl, int status) | ||
110 | err, pam_strerror(wl->ph, err)); | ||
111 | pam_end(wl->ph, err); | ||
112 | } | ||
113 | +#endif | ||
114 | |||
115 | /* | ||
116 | * Get a fresh handle to the tty as the previous one is in | ||
117 | @@ -710,6 +718,7 @@ setup_session(struct weston_launch *wl, char **child_argv) | ||
118 | setenv("HOME", wl->pw->pw_dir, 1); | ||
119 | setenv("SHELL", wl->pw->pw_shell, 1); | ||
120 | |||
121 | +#ifdef HAVE_PAM | ||
122 | env = pam_getenvlist(wl->ph); | ||
123 | if (env) { | ||
124 | for (i = 0; env[i]; ++i) { | ||
125 | @@ -718,6 +727,7 @@ setup_session(struct weston_launch *wl, char **child_argv) | ||
126 | } | ||
127 | free(env); | ||
128 | } | ||
129 | +#endif | ||
130 | |||
131 | /* | ||
132 | * We open a new session, so it makes sense | ||
133 | @@ -789,8 +799,10 @@ static void | ||
134 | help(const char *name) | ||
135 | { | ||
136 | fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name); | ||
137 | +#ifdef HAVE_PAM | ||
138 | fprintf(stderr, " -u, --user Start session as specified username,\n" | ||
139 | " e.g. -u joe, requires root.\n"); | ||
140 | +#endif | ||
141 | fprintf(stderr, " -t, --tty Start session on alternative tty,\n" | ||
142 | " e.g. -t /dev/tty4, requires -u option.\n"); | ||
143 | fprintf(stderr, " -v, --verbose Be verbose\n"); | ||
144 | @@ -804,7 +816,9 @@ main(int argc, char *argv[]) | ||
145 | int i, c; | ||
146 | char *tty = NULL; | ||
147 | struct option opts[] = { | ||
148 | +#ifdef HAVE_PAM | ||
149 | { "user", required_argument, NULL, 'u' }, | ||
150 | +#endif | ||
151 | { "tty", required_argument, NULL, 't' }, | ||
152 | { "verbose", no_argument, NULL, 'v' }, | ||
153 | { "help", no_argument, NULL, 'h' }, | ||
154 | @@ -816,11 +830,16 @@ main(int argc, char *argv[]) | ||
155 | while ((c = getopt_long(argc, argv, "u:t:vh", opts, &i)) != -1) { | ||
156 | switch (c) { | ||
157 | case 'u': | ||
158 | +#ifdef HAVE_PAM | ||
159 | wl.new_user = optarg; | ||
160 | if (getuid() != 0) { | ||
161 | fprintf(stderr, "weston: Permission denied. -u allowed for root only\n"); | ||
162 | exit(EXIT_FAILURE); | ||
163 | } | ||
164 | +#else | ||
165 | + fprintf(stderr, "weston: -u is unsupported in this weston-launch build\n"); | ||
166 | + exit(EXIT_FAILURE); | ||
167 | +#endif | ||
168 | break; | ||
169 | case 't': | ||
170 | tty = optarg; | ||
171 | @@ -872,8 +891,10 @@ main(int argc, char *argv[]) | ||
172 | if (setup_tty(&wl, tty) < 0) | ||
173 | exit(EXIT_FAILURE); | ||
174 | |||
175 | +#ifdef HAVE_PAM | ||
176 | if (wl.new_user && setup_pam(&wl) < 0) | ||
177 | exit(EXIT_FAILURE); | ||
178 | +#endif | ||
179 | |||
180 | if (setup_launcher_socket(&wl) < 0) | ||
181 | exit(EXIT_FAILURE); | ||
182 | diff --git a/meson_options.txt b/meson_options.txt | ||
183 | index 239bd2d..99e4ec3 100644 | ||
184 | --- a/meson_options.txt | ||
185 | +++ b/meson_options.txt | ||
186 | @@ -73,6 +73,13 @@ option( | ||
187 | ) | ||
188 | |||
189 | option( | ||
190 | + 'pam', | ||
191 | + type: 'boolean', | ||
192 | + value: true, | ||
193 | + description: 'Define if PAM is available' | ||
194 | +) | ||
195 | + | ||
196 | +option( | ||
197 | 'xwayland', | ||
198 | type: 'boolean', | ||
199 | value: true, | ||
diff --git a/meta/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch b/meta/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch index a4444e5d18..1ac0695222 100644 --- a/meta/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch +++ b/meta/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch | |||
@@ -1,4 +1,7 @@ | |||
1 | Fix atomic modesetting with musl | 1 | From ece4c3d261aeec230869c0304ed1011ff6837c16 Mon Sep 17 00:00:00 2001 |
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 12 Sep 2020 14:04:04 -0700 | ||
4 | Subject: [PATCH] Fix atomic modesetting with musl | ||
2 | 5 | ||
3 | atomic modesetting seems to fail with drm weston backend and this patch fixes | 6 | atomic modesetting seems to fail with drm weston backend and this patch fixes |
4 | it, below errors are seen before weston exits | 7 | it, below errors are seen before weston exits |
@@ -8,9 +11,15 @@ atomic: couldn't commit new state: Invalid argument | |||
8 | Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/weston/-/issues/158] | 11 | Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/weston/-/issues/158] |
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
10 | 13 | ||
14 | --- | ||
15 | libweston/backend-drm/kms.c | 4 ++-- | ||
16 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
17 | |||
18 | diff --git a/libweston/backend-drm/kms.c b/libweston/backend-drm/kms.c | ||
19 | index 780d007..9994da1 100644 | ||
11 | --- a/libweston/backend-drm/kms.c | 20 | --- a/libweston/backend-drm/kms.c |
12 | +++ b/libweston/backend-drm/kms.c | 21 | +++ b/libweston/backend-drm/kms.c |
13 | @@ -1168,8 +1168,8 @@ drm_pending_state_apply_atomic(struct dr | 22 | @@ -1142,8 +1142,8 @@ drm_pending_state_apply_atomic(struct drm_pending_state *pending_state, |
14 | wl_list_for_each(plane, &b->plane_list, link) { | 23 | wl_list_for_each(plane, &b->plane_list, link) { |
15 | drm_debug(b, "\t\t[atomic] starting with plane %lu disabled\n", | 24 | drm_debug(b, "\t\t[atomic] starting with plane %lu disabled\n", |
16 | (unsigned long) plane->plane_id); | 25 | (unsigned long) plane->plane_id); |