package/weston: bump to version 10.0.1

upgrade the weston to 10.0.1 for IMG DDK 1.19
and copy patches from IMG DDK 1.19

fix the patch and building issue

Signed-off-by: Andy Hu <andy.hu@starfivetech.com>
This commit is contained in:
Andy Hu
2023-06-01 22:20:27 +08:00
parent eb6c3c5a84
commit e1839688b8
13 changed files with 221 additions and 562 deletions
@@ -1,7 +1,7 @@
From 0f85e6d2e358c530dd1136d71bfd306cd64c4305 Mon Sep 17 00:00:00 2001
From a2ea65796237b064574e5d5a509f8fc1cd41a723 Mon Sep 17 00:00:00 2001
From: Brendan King <Brendan.King@imgtec.com>
Date: Tue, 4 Sep 2018 14:59:09 +0100
Subject: [PATCH 1/2] backend-drm: disable "bo geometry out of bounds" message
Subject: [PATCH 1/5] backend-drm: disable "bo geometry out of bounds" message
The message was being printed repeatedly whilst running an opaque
windowed application, because the application wasn't within the
@@ -11,10 +11,10 @@ framebuffer dimension limits.
1 file changed, 2 insertions(+)
diff --git a/libweston/backend-drm/fb.c b/libweston/backend-drm/fb.c
index e7349c4b..da781015 100644
index ba0c177e..3c664779 100644
--- a/libweston/backend-drm/fb.c
+++ b/libweston/backend-drm/fb.c
@@ -343,7 +343,9 @@ drm_fb_get_from_dmabuf(struct linux_dmabuf_buffer *dmabuf,
@@ -306,7 +306,9 @@ drm_fb_get_from_dmabuf(struct linux_dmabuf_buffer *dmabuf,
fb->width > backend->max_width ||
backend->min_height > fb->height ||
fb->height > backend->max_height) {
@@ -25,5 +25,5 @@ index e7349c4b..da781015 100644
}
--
2.17.1
2.25.1
@@ -0,0 +1,38 @@
From 2ac6b6b084a877adde64db7faff2ed22eb3ea97a Mon Sep 17 00:00:00 2001
From: Daniel Stone <daniels@collabora.com>
Date: Tue, 8 Feb 2022 22:39:42 +0000
Subject: [PATCH] tests: Add dependency on screenshooter client protocol
Given that the test-helper code relies on the screenshooter protocol,
make sure it's available for us to build, and the dependency ensures we
build in order.
Fixes: #588
Signed-off-by: Daniel Stone <daniels@collabora.com>
[Retrieved from:
https://gitlab.freedesktop.org/wayland/weston/-/commit/2ac6b6b084a877adde64db7faff2ed22eb3ea97a]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
tests/meson.build | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/meson.build b/tests/meson.build
index 2d464ddcc..222091cd1 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -29,8 +29,9 @@ lib_test_client = static_library(
'weston-test-client-helper.c',
'weston-test-fixture-compositor.c',
weston_test_client_protocol_h,
- weston_screenshooter_protocol_c,
weston_test_protocol_c,
+ weston_screenshooter_client_protocol_h,
+ weston_screenshooter_protocol_c,
viewporter_client_protocol_h,
viewporter_protocol_c,
'color_util.h',
--
GitLab
@@ -1,48 +0,0 @@
From b10c0e843dcb8148bbe869bb15261955b94ac98c Mon Sep 17 00:00:00 2001
From: Denys Dmytriyenko <denys@ti.com>
Date: Tue, 8 Sep 2020 19:37:42 -0400
Subject: [PATCH] tests: include fcntl.h for open(), O_RDWR, O_CLOEXEC and
O_CREAT
musl libc (unlike glibc) requires explicitly incuding fcntl.h to define open(),
O_RDWR, O_CLOEXEC and O_CREAT. Otherwise the build fails with the errors:
| ../weston-9.0.0/tests/weston-test-fixture-compositor.c: In function 'wait_for_lock':
| ../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]
| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700);
| | ^~~~
| | popen
| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:23: error: 'O_RDWR' undeclared (first use in this function)
| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700);
| | ^~~~~~
| ../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
| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:32: error: 'O_CLOEXEC' undeclared (first use in this function)
| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700);
| | ^~~~~~~~~
| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:44: error: 'O_CREAT' undeclared (first use in this function)
| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700);
| | ^~~~~~~
Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
[james.hilliard1@gmail.com: backport from upstream commit
b10c0e843dcb8148bbe869bb15261955b94ac98c]
---
tests/weston-test-fixture-compositor.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/weston-test-fixture-compositor.c b/tests/weston-test-fixture-compositor.c
index 1c32959c..c1eb26c4 100644
--- a/tests/weston-test-fixture-compositor.c
+++ b/tests/weston-test-fixture-compositor.c
@@ -35,6 +35,7 @@
#include <stdarg.h>
#include <stdlib.h>
#include <errno.h>
+#include <fcntl.h>
#include "shared/helpers.h"
#include "weston-test-fixture-compositor.h"
--
2.25.1
@@ -1,47 +0,0 @@
From 4b93b71067949cc5efabb9b3d59278a3f362b11c Mon Sep 17 00:00:00 2001
From: Heiko Thiery <heiko.thiery@gmail.com>
Date: Wed, 21 Oct 2020 13:33:25 +0200
Subject: [PATCH] libweston/backend/drm: might need EGL
gbm-drm.c includes gl-renderer.h. When EGL is enabled, that in turns
includes egl.h. As such, dependencies for drm should include EGL if
it is available.
This condition is modelled after a similar one in libweston/meson.build
Reported-by: Gary Bisson <gary.bisson@boundarydevices.com>
Reported-by: Heiko Thiery <heiko.thiery@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Refik Tuzakli <tuzakli.refik@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
This patch should be a proper fix for the issue discribed in the patch from
Gary [1].
Since the MR on weston upstream [2] is not merged now I add this patch
to have working weston with imx in buildroot.
[1] https://patchwork.ozlabs.org/project/buildroot/patch/20200402130842.918696-3-gary.bisson@boundarydevices.com/
[2] https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/508
---
libweston/backend-drm/meson.build | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libweston/backend-drm/meson.build b/libweston/backend-drm/meson.build
index 484c2702..e3e5b976 100644
--- a/libweston/backend-drm/meson.build
+++ b/libweston/backend-drm/meson.build
@@ -53,6 +53,9 @@ if get_option('renderer-gl')
config_h.set('HAVE_GBM_FD_IMPORT', '1')
endif
deps_drm += dep_gbm
+ if dep_egl.found()
+ deps_drm += dep_egl
+ endif
srcs_drm += 'drm-gbm.c'
config_h.set('BUILD_DRM_GBM', '1')
endif
--
2.20.1
@@ -0,0 +1,33 @@
From 2039ca706c9578e339dafa84b842559af86d7a11 Mon Sep 17 00:00:00 2001
From: Brendan King <Brendan.King@imgtec.com>
Date: Thu, 28 Mar 2019 12:58:10 +0000
Subject: [PATCH 2/5] meson: fix failure to find libudev when linking the
compositor
The compositor links against libinput, which in turn is linked against
libudev. When the compositor is linked, it has a dependency on libinput,
but not libudev. Whilst this is correct, it means the linker won't be
able to find libudev if the library is in a non-standard place (i.e.
a place where the linker wouldn't normally look).
Workaround the problem by adding libudev as a dependency for the
compositor.
---
compositor/meson.build | 1 +
1 file changed, 1 insertion(+)
diff --git a/compositor/meson.build b/compositor/meson.build
index 8a54ea99..11a6c59b 100644
--- a/compositor/meson.build
+++ b/compositor/meson.build
@@ -17,6 +17,7 @@ deps_weston = [
dep_libevdev,
dep_libdl,
dep_threads,
+ dependency('libudev'),
]
if get_option('xwayland')
--
2.25.1
@@ -1,7 +1,7 @@
From 4a6e5e4ac0a2c63eb78e442bc34a0ee6a0f470d4 Mon Sep 17 00:00:00 2001
From 909379d1ddfa7a3df16b49f3768202329922e457 Mon Sep 17 00:00:00 2001
From: Brendan King <Brendan.King@imgtec.com>
Date: Thu, 15 Apr 2021 19:30:02 +0100
Subject: [PATCH 3/3] libweston: reduce checks for dmabufs with DRM modifiers
Subject: [PATCH 3/5] libweston: reduce checks for dmabufs with DRM modifiers
If the buffer associated with a dmabuf has a DRM modifier, then
checking the stride and stride*height against the size of the
@@ -14,10 +14,10 @@ equivalent linear framebuffer.
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/libweston/linux-dmabuf.c b/libweston/linux-dmabuf.c
index 796e9826..0bbfe480 100644
index 21de498d..6d1c3ee4 100644
--- a/libweston/linux-dmabuf.c
+++ b/libweston/linux-dmabuf.c
@@ -240,22 +240,25 @@ params_create_common(struct wl_client *client,
@@ -244,22 +244,25 @@ params_create_common(struct wl_client *client,
goto err_out;
}
@@ -59,5 +59,5 @@ index 796e9826..0bbfe480 100644
}
--
2.17.1
2.25.1
@@ -1,391 +0,0 @@
From cc08737e3fd174ec3c4c208ea4f2a3a6a9e8af3e Mon Sep 17 00:00:00 2001
From: James Hilliard <james.hilliard1@gmail.com>
Date: Mon, 6 Jul 2020 00:58:02 -0600
Subject: [PATCH] pipewire: add support for 0.3 API
Fixes: #369
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
[james.hilliard1@gmail.com: backport from upstream commit
80b585f8d2a31e780b4de41fbd187a742bea7e1a]
---
.gitlab-ci.yml | 2 +-
.gitlab-ci/debian-install.sh | 16 ++++-
pipewire/meson.build | 28 ++++++---
pipewire/pipewire-plugin.c | 118 ++++++++++++++++++++++++++++++++++-
4 files changed, 151 insertions(+), 13 deletions(-)
diff --git a/pipewire/meson.build b/pipewire/meson.build
index 3d3374b8..e30a0b62 100644
--- a/pipewire/meson.build
+++ b/pipewire/meson.build
@@ -5,17 +5,25 @@ if get_option('pipewire')
error('Attempting to build the pipewire plugin without the required DRM backend. ' + user_hint)
endif
- depnames = [
- 'libpipewire-0.2', 'libspa-0.1'
- ]
deps_pipewire = [ dep_libweston_private ]
- foreach depname : depnames
- dep = dependency(depname, required: false)
- if not dep.found()
- error('Pipewire plugin requires @0@ which was not found. '.format(depname) + user_hint)
- endif
- deps_pipewire += dep
- endforeach
+
+ dep_libpipewire = dependency('libpipewire-0.3', required: false)
+ if not dep_libpipewire.found()
+ dep_libpipewire = dependency('libpipewire-0.2', required: false)
+ endif
+ if not dep_libpipewire.found()
+ error('Pipewire plugin requires libpipewire which was not found. ' + user_hint)
+ endif
+ deps_pipewire += dep_libpipewire
+
+ dep_libspa = dependency('libspa-0.2', required: false)
+ if not dep_libspa.found()
+ dep_libspa = dependency('libspa-0.1', required: false)
+ endif
+ if not dep_libspa.found()
+ error('Pipewire plugin requires libspa which was not found. ' + user_hint)
+ endif
+ deps_pipewire += dep_libspa
plugin_pipewire = shared_library(
'pipewire-plugin',
diff --git a/pipewire/pipewire-plugin.c b/pipewire/pipewire-plugin.c
index 6f892574..ce70ea63 100644
--- a/pipewire/pipewire-plugin.c
+++ b/pipewire/pipewire-plugin.c
@@ -34,20 +34,27 @@
#include <errno.h>
#include <unistd.h>
+#include <pipewire/pipewire.h>
+
#include <spa/param/format-utils.h>
#include <spa/param/video/format-utils.h>
#include <spa/utils/defs.h>
-#include <pipewire/pipewire.h>
+#if PW_CHECK_VERSION(0, 2, 90)
+#include <spa/buffer/meta.h>
+#include <spa/utils/result.h>
+#endif
#define PROP_RANGE(min, max) 2, (min), (max)
+#if !PW_CHECK_VERSION(0, 2, 90)
struct type {
struct spa_type_media_type media_type;
struct spa_type_media_subtype media_subtype;
struct spa_type_format_video format_video;
struct spa_type_video_format video_format;
};
+#endif
struct weston_pipewire {
struct weston_compositor *compositor;
@@ -60,12 +67,19 @@ struct weston_pipewire {
struct pw_loop *loop;
struct wl_event_source *loop_source;
+#if PW_CHECK_VERSION(0, 2, 90)
+ struct pw_context *context;
+#endif
struct pw_core *core;
struct pw_type *t;
+#if PW_CHECK_VERSION(0, 2, 90)
+ struct spa_hook core_listener;
+#else
struct type type;
struct pw_remote *remote;
struct spa_hook remote_listener;
+#endif
};
struct pipewire_output {
@@ -100,6 +114,7 @@ struct pipewire_frame_data {
struct wl_event_source *fence_sync_event_source;
};
+#if !PW_CHECK_VERSION(0, 2, 90)
static inline void init_type(struct type *type, struct spa_type_map *map)
{
spa_type_media_type_map(map, &type->media_type);
@@ -107,6 +122,7 @@ static inline void init_type(struct type *type, struct spa_type_map *map)
spa_type_format_video_map(map, &type->format_video);
spa_type_video_format_map(map, &type->video_format);
}
+#endif
static void
pipewire_debug_impl(struct weston_pipewire *pipewire,
@@ -141,6 +157,7 @@ pipewire_debug_impl(struct weston_pipewire *pipewire,
free(logstr);
}
+#if !PW_CHECK_VERSION(0, 2, 90)
static void
pipewire_debug(struct weston_pipewire *pipewire, const char *fmt, ...)
{
@@ -150,6 +167,7 @@ pipewire_debug(struct weston_pipewire *pipewire, const char *fmt, ...)
pipewire_debug_impl(pipewire, NULL, fmt, ap);
va_end(ap);
}
+#endif
static void
pipewire_output_debug(struct pipewire_output *output, const char *fmt, ...)
@@ -185,7 +203,9 @@ pipewire_output_handle_frame(struct pipewire_output *output, int fd,
const struct weston_drm_virtual_output_api *api =
output->pipewire->virtual_output_api;
size_t size = output->output->height * stride;
+#if !PW_CHECK_VERSION(0, 2, 90)
struct pw_type *t = output->pipewire->t;
+#endif
struct pw_buffer *buffer;
struct spa_buffer *spa_buffer;
struct spa_meta_header *h;
@@ -203,7 +223,12 @@ pipewire_output_handle_frame(struct pipewire_output *output, int fd,
spa_buffer = buffer->buffer;
+#if PW_CHECK_VERSION(0, 2, 90)
+ if ((h = spa_buffer_find_meta_data(spa_buffer, SPA_META_Header,
+ sizeof(struct spa_meta_header)))) {
+#else
if ((h = spa_buffer_find_meta(spa_buffer, t->meta.Header))) {
+#endif
h->pts = -1;
h->flags = 0;
h->seq = output->seq++;
@@ -375,18 +400,40 @@ pipewire_set_dpms(struct weston_output *base_output, enum dpms_enum level)
static int
pipewire_output_connect(struct pipewire_output *output)
{
+#if !PW_CHECK_VERSION(0, 2, 90)
struct weston_pipewire *pipewire = output->pipewire;
struct type *type = &pipewire->type;
+#endif
uint8_t buffer[1024];
struct spa_pod_builder builder =
SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
const struct spa_pod *params[1];
+#if !PW_CHECK_VERSION(0, 2, 90)
struct pw_type *t = pipewire->t;
+#endif
int frame_rate = output->output->current_mode->refresh / 1000;
int width = output->output->width;
int height = output->output->height;
int ret;
+#if PW_CHECK_VERSION(0, 2, 90)
+ params[0] = spa_pod_builder_add_object(&builder,
+ SPA_TYPE_OBJECT_Format, SPA_PARAM_EnumFormat,
+ SPA_FORMAT_mediaType, SPA_POD_Id(SPA_MEDIA_TYPE_video),
+ SPA_FORMAT_mediaSubtype, SPA_POD_Id(SPA_MEDIA_SUBTYPE_raw),
+ SPA_FORMAT_VIDEO_format, SPA_POD_Id(SPA_VIDEO_FORMAT_BGRx),
+ SPA_FORMAT_VIDEO_size, SPA_POD_Rectangle(&SPA_RECTANGLE(width, height)),
+ SPA_FORMAT_VIDEO_framerate, SPA_POD_Fraction(&SPA_FRACTION (0, 1)),
+ SPA_FORMAT_VIDEO_maxFramerate,
+ SPA_POD_CHOICE_RANGE_Fraction(&SPA_FRACTION(frame_rate, 1),
+ &SPA_FRACTION(1, 1),
+ &SPA_FRACTION(frame_rate, 1)));
+
+ ret = pw_stream_connect(output->stream, PW_DIRECTION_OUTPUT, SPA_ID_INVALID,
+ (PW_STREAM_FLAG_DRIVER |
+ PW_STREAM_FLAG_MAP_BUFFERS),
+ params, 1);
+#else
params[0] = spa_pod_builder_object(&builder,
t->param.idEnumFormat, t->spa_format,
"I", type->media_type.video,
@@ -406,6 +453,7 @@ pipewire_output_connect(struct pipewire_output *output)
(PW_STREAM_FLAG_DRIVER |
PW_STREAM_FLAG_MAP_BUFFERS),
params, 1);
+#endif
if (ret != 0) {
weston_log("Failed to connect pipewire stream: %s",
spa_strerror(ret));
@@ -482,26 +530,42 @@ pipewire_output_stream_state_changed(void *data, enum pw_stream_state old,
}
static void
+#if PW_CHECK_VERSION(0, 2, 90)
+pipewire_output_stream_param_changed(void *data, uint32_t id, const struct spa_pod *format)
+#else
pipewire_output_stream_format_changed(void *data, const struct spa_pod *format)
+#endif
{
struct pipewire_output *output = data;
+#if !PW_CHECK_VERSION(0, 2, 90)
struct weston_pipewire *pipewire = output->pipewire;
+#endif
uint8_t buffer[1024];
struct spa_pod_builder builder =
SPA_POD_BUILDER_INIT(buffer, sizeof(buffer));
const struct spa_pod *params[2];
+#if !PW_CHECK_VERSION(0, 2, 90)
struct pw_type *t = pipewire->t;
+#endif
int32_t width, height, stride, size;
const int bpp = 4;
if (!format) {
pipewire_output_debug(output, "format = None");
+#if PW_CHECK_VERSION(0, 2, 90)
+ pw_stream_update_params(output->stream, NULL, 0);
+#else
pw_stream_finish_format(output->stream, 0, NULL, 0);
+#endif
return;
}
+#if PW_CHECK_VERSION(0, 2, 90)
+ spa_format_video_raw_parse(format, &output->video_format);
+#else
spa_format_video_raw_parse(format, &output->video_format,
&pipewire->type.format_video);
+#endif
width = output->video_format.size.width;
height = output->video_format.size.height;
@@ -510,6 +574,21 @@ pipewire_output_stream_format_changed(void *data, const struct spa_pod *format)
pipewire_output_debug(output, "format = %dx%d", width, height);
+#if PW_CHECK_VERSION(0, 2, 90)
+ params[0] = spa_pod_builder_add_object(&builder,
+ SPA_TYPE_OBJECT_ParamBuffers, SPA_PARAM_Buffers,
+ SPA_PARAM_BUFFERS_size, SPA_POD_Int(size),
+ SPA_PARAM_BUFFERS_stride, SPA_POD_Int(stride),
+ SPA_PARAM_BUFFERS_buffers, SPA_POD_CHOICE_RANGE_Int(4, 2, 8),
+ SPA_PARAM_BUFFERS_align, SPA_POD_Int(16));
+
+ params[1] = spa_pod_builder_add_object(&builder,
+ SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta,
+ SPA_PARAM_META_type, SPA_POD_Id(SPA_META_Header),
+ SPA_PARAM_META_size, SPA_POD_Int(sizeof(struct spa_meta_header)));
+
+ pw_stream_update_params(output->stream, params, 2);
+#else
params[0] = spa_pod_builder_object(&builder,
t->param.idBuffers, t->param_buffers.Buffers,
":", t->param_buffers.size,
@@ -527,12 +606,17 @@ pipewire_output_stream_format_changed(void *data, const struct spa_pod *format)
":", t->param_meta.size, "i", sizeof(struct spa_meta_header));
pw_stream_finish_format(output->stream, 0, params, 2);
+#endif
}
static const struct pw_stream_events stream_events = {
PW_VERSION_STREAM_EVENTS,
.state_changed = pipewire_output_stream_state_changed,
+#if PW_CHECK_VERSION(0, 2, 90)
+ .param_changed = pipewire_output_stream_param_changed,
+#else
.format_changed = pipewire_output_stream_format_changed,
+#endif
};
static struct weston_output *
@@ -560,7 +644,11 @@ pipewire_output_create(struct weston_compositor *c, char *name)
if (!head)
goto err;
+#if PW_CHECK_VERSION(0, 2, 90)
+ output->stream = pw_stream_new(pipewire->core, name, NULL);
+#else
output->stream = pw_stream_new(pipewire->remote, name, NULL);
+#endif
if (!output->stream) {
weston_log("Cannot initialize pipewire stream\n");
goto err;
@@ -704,6 +792,14 @@ weston_pipewire_loop_handler(int fd, uint32_t mask, void *data)
return 0;
}
+#if PW_CHECK_VERSION(0, 2, 90)
+static void
+weston_pipewire_error(void *data, uint32_t id, int seq, int res,
+ const char *error)
+{
+ weston_log("pipewire remote error: %s\n", error);
+}
+#else
static void
weston_pipewire_state_changed(void *data, enum pw_remote_state old,
enum pw_remote_state state, const char *error)
@@ -725,12 +821,20 @@ weston_pipewire_state_changed(void *data, enum pw_remote_state old,
break;
}
}
+#endif
+#if PW_CHECK_VERSION(0, 2, 90)
+static const struct pw_core_events core_events = {
+ PW_VERSION_CORE_EVENTS,
+ .error = weston_pipewire_error,
+};
+#else
static const struct pw_remote_events remote_events = {
PW_VERSION_REMOTE_EVENTS,
.state_changed = weston_pipewire_state_changed,
};
+#endif
static int
weston_pipewire_init(struct weston_pipewire *pipewire)
@@ -745,10 +849,19 @@ weston_pipewire_init(struct weston_pipewire *pipewire)
pw_loop_enter(pipewire->loop);
+#if PW_CHECK_VERSION(0, 2, 90)
+ pipewire->context = pw_context_new(pipewire->loop, NULL, 0);
+#else
pipewire->core = pw_core_new(pipewire->loop, NULL);
pipewire->t = pw_core_get_type(pipewire->core);
init_type(&pipewire->type, pipewire->t->map);
+#endif
+#if PW_CHECK_VERSION(0, 2, 90)
+ pw_core_add_listener(pipewire->core,
+ &pipewire->core_listener,
+ &core_events, pipewire);
+#else
pipewire->remote = pw_remote_new(pipewire->core, NULL, 0);
pw_remote_add_listener(pipewire->remote,
&pipewire->remote_listener,
@@ -777,6 +890,7 @@ weston_pipewire_init(struct weston_pipewire *pipewire)
goto err;
}
}
+#endif
loop = wl_display_get_event_loop(pipewire->compositor->wl_display);
pipewire->loop_source =
@@ -786,12 +900,14 @@ weston_pipewire_init(struct weston_pipewire *pipewire)
pipewire);
return 0;
+#if !PW_CHECK_VERSION(0, 2, 90)
err:
if (pipewire->remote)
pw_remote_destroy(pipewire->remote);
pw_loop_leave(pipewire->loop);
pw_loop_destroy(pipewire->loop);
return -1;
+#endif
}
static const struct weston_pipewire_api pipewire_api = {
--
2.25.1
@@ -1,28 +0,0 @@
From a67393c353e0f25b142910a817be5a7754d436c3 Mon Sep 17 00:00:00 2001
From: Ambareesh Balaji <ambareeshbalaji@gmail.com>
Date: Sat, 5 Dec 2020 20:49:55 -0500
Subject: [PATCH] pipewire: fix null deref in 0.3 API
Signed-off-by: Ambareesh Balaji <ambareeshbalaji@gmail.com>
[Retrieved from:
https://gitlab.freedesktop.org/wayland/weston/-/commit/a67393c353e0f25b142910a817be5a7754d436c3]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
pipewire/pipewire-plugin.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/pipewire/pipewire-plugin.c b/pipewire/pipewire-plugin.c
index ca5cbfec1..55705acfc 100644
--- a/pipewire/pipewire-plugin.c
+++ b/pipewire/pipewire-plugin.c
@@ -856,6 +856,7 @@ weston_pipewire_init(struct weston_pipewire *pipewire)
#if PW_CHECK_VERSION(0, 2, 90)
pipewire->context = pw_context_new(pipewire->loop, NULL, 0);
+ pipewire->core = pw_context_connect(pipewire->context, NULL, 0);
#else
pipewire->core = pw_core_new(pipewire->loop, NULL);
pipewire->t = pw_core_get_type(pipewire->core);
--
GitLab
@@ -0,0 +1,25 @@
From e459a97de18c9da6f946a6d58555486de4d6500b Mon Sep 17 00:00:00 2001
From: Brendan King <Brendan.King@imgtec.com>
Date: Sat, 12 Jun 2021 16:50:01 +0100
Subject: [PATCH 4/5] tests: test-client depends on libudev
Source file weston-test-fixture-compositor.c includes libudev.h.
---
tests/meson.build | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/meson.build b/tests/meson.build
index d8e96e77..195366bb 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -43,6 +43,7 @@ lib_test_client = static_library(
dep_libexec_weston,
dep_pixman,
dependency('cairo'),
+ dependency('libudev'),
],
install: false,
)
--
2.25.1
@@ -0,0 +1,53 @@
From 386618c7f40b9a5ad93b0c68a622ea38a63378c6 Mon Sep 17 00:00:00 2001
From: Brendan King <Brendan.King@imgtec.com>
Date: Wed, 20 Apr 2022 11:56:50 +0000
Subject: [PATCH 5/5] backend-drm: allow linear framebuffers if no KMS modifier
support
If KMS doesn't support modifiers, but a framebuffer is supplied via
a dmabuf with a linear modifier, assume the buffer is compatible with
KMS. This scenario can occur when different drivers are used for the
GPU and KMS, and the GPU driver supports modifiers.
Some platforms used internally by IMG, such as the Acer R13 Chromebook,
have KMS drivers that don't support modifiers. Without this change,
applications such as weston-simple-egl cannot keep up with vsync.
This problem didn't occur with older versions of Weston (e.g, 9.0.0).
This change can be dropped for platforms where KMS supports modifiers.
The change that prompted this one was:
commit 567cc92797846081506ccb36e6af99884a8b6cf2
Author: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Date: Wed Apr 21 11:44:53 2021 -0300
backend-drm: add DRM_FORMAT_MOD_INVALID to modifier sets when no
modifiers are supported
---
libweston/backend-drm/fb.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/libweston/backend-drm/fb.c b/libweston/backend-drm/fb.c
index 3c664779..c59e0a99 100644
--- a/libweston/backend-drm/fb.c
+++ b/libweston/backend-drm/fb.c
@@ -489,6 +489,15 @@ drm_fb_compatible_with_plane(struct drm_fb *fb, struct drm_plane *plane)
if (weston_drm_format_has_modifier(fmt, fb->modifier))
return true;
+
+ /* KMS doesn't support modifiers, but we've been sent a dmabuf
+ * with a linear modifier. This can happen if different drivers
+ * are used for the GPU and KMS, and the GPU driver supports
+ * modifiers. Assume this is valid combination. */
+ if (fb->modifier == DRM_FORMAT_MOD_LINEAR &&
+ weston_drm_format_has_modifier(fmt, DRM_FORMAT_MOD_INVALID))
+ return true;
+
}
drm_debug(b, "\t\t\t\t[%s] not placing view on %s: "
--
2.25.1
Regular → Executable
+25 -21
View File
@@ -34,10 +34,6 @@ if BR2_PACKAGE_WESTON
choice
prompt "default compositor"
config BR2_PACKAGE_WESTON_DEFAULT_FBDEV
bool "fbdev"
select BR2_PACKAGE_WESTON_FBDEV
config BR2_PACKAGE_WESTON_DEFAULT_DRM
bool "drm"
depends on BR2_PACKAGE_MESA3D_OPENGL_EGL || BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL || BR2_PACKAGE_IMG_GPU_POWERVR_OUTPUT_WL
@@ -46,32 +42,33 @@ config BR2_PACKAGE_WESTON_DEFAULT_DRM
comment "drm backend needs mesa3d w/ EGL driver"
depends on !BR2_PACKAGE_MESA3D_OPENGL_EGL && !BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL && !BR2_PACKAGE_IMG_GPU_POWERVR_OUTPUT_WL
config BR2_PACKAGE_WESTON_DEFAULT_HEADLESS
bool "headless"
select BR2_PACKAGE_WESTON_HEADLESS
config BR2_PACKAGE_WESTON_DEFAULT_WAYLAND
bool "wayland (nested)"
select BR2_PACKAGE_WESTON_WAYLAND
config BR2_PACKAGE_WESTON_DEFAULT_X11
bool "X11"
bool "X11 (nested)"
depends on BR2_PACKAGE_XORG7
select BR2_PACKAGE_WESTON_X11
comment "X11 backend needs X.org"
comment "X11 (nested) backend needs X.org"
depends on !BR2_PACKAGE_XORG7
endchoice
config BR2_PACKAGE_WESTON_DEFAULT_COMPOSITOR
string
default "fbdev" if BR2_PACKAGE_WESTON_DEFAULT_FBDEV
default "drm" if BR2_PACKAGE_WESTON_DEFAULT_DRM
default "x11" if BR2_PACKAGE_WESTON_DEFAULT_X11
default "drm" if BR2_PACKAGE_WESTON_DEFAULT_DRM
default "headless" if BR2_PACKAGE_WESTON_DEFAULT_HEADLESS
default "wayland" if BR2_PACKAGE_WESTON_DEFAULT_WAYLAND
default "x11" if BR2_PACKAGE_WESTON_DEFAULT_X11
config BR2_PACKAGE_WESTON_DRM
bool "DRM compositor"
depends on BR2_PACKAGE_MESA3D_OPENGL_EGL || BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL
# Uses libgbm from mesa3d
comment "DRM compositor needs an OpenGL EGL backend provided by mesa3d"
depends on !BR2_PACKAGE_MESA3D_OPENGL_EGL && !BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL
config BR2_PACKAGE_WESTON_FBDEV
bool "fbdev compositor"
# FreeRDP needs threads and !static, already the case for weston
config BR2_PACKAGE_WESTON_RDP
@@ -99,13 +96,19 @@ comment "RDP compositor needs a toolchain w/ wchar, C++"
depends on BR2_TOOLCHAIN_HAS_SYNC_4
depends on !BR2_USE_WCHAR || !BR2_INSTALL_LIBSTDCPP
config BR2_PACKAGE_WESTON_HEADLESS
bool "headless (testing) compositor"
config BR2_PACKAGE_WESTON_WAYLAND
bool "Wayland (nested) compositor"
config BR2_PACKAGE_WESTON_X11
bool "X11 compositor"
bool "X11 (nested) compositor"
depends on BR2_PACKAGE_XORG7
select BR2_PACKAGE_LIBXCB
select BR2_PACKAGE_XLIB_LIBX11
comment "X11 compositor needs X.org enabled"
comment "X11 (nested) compositor needs X.org enabled"
depends on !BR2_PACKAGE_XORG7
config BR2_PACKAGE_WESTON_XWAYLAND
@@ -148,6 +151,7 @@ config BR2_PACKAGE_WESTON_DEMO_CLIENTS
bool "demo clients"
depends on BR2_USE_MMU # pango
depends on BR2_TOOLCHAIN_HAS_SYNC_4 # pango
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # pango
depends on BR2_INSTALL_LIBSTDCPP # pango
depends on BR2_TOOLCHAIN_HAS_THREADS # pango
depends on BR2_USE_WCHAR # pango
@@ -157,11 +161,11 @@ config BR2_PACKAGE_WESTON_DEMO_CLIENTS
help
This enables the installation of Weston's demo clients.
comment "demo clients needs an OpenGL ES provider, an OpenEGL-capable Wayland backend and a toolchain w/ wchar, threads, C++"
comment "demo clients needs an OpenGL ES provider, an OpenEGL-capable Wayland backend and a toolchain w/ wchar, threads, C++, gcc >= 4.9"
depends on BR2_USE_MMU
depends on BR2_TOOLCHAIN_HAS_SYNC_4
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || \
!BR2_USE_WCHAR || !BR2_PACKAGE_HAS_LIBGLES || \
!BR2_PACKAGE_HAS_LIBEGL_WAYLAND
!BR2_PACKAGE_HAS_LIBEGL_WAYLAND || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
endif
Regular → Executable
+3 -5
View File
@@ -1,6 +1,4 @@
# From https://lists.freedesktop.org/archives/wayland-devel/2020-September/041595.html
md5 b406da0fe9139fd39653238fde22a6cf weston-9.0.0.tar.xz
sha1 90b9540a0bd6d6f7a465817f1c696d4d393183c9 weston-9.0.0.tar.xz
sha256 5cf5d6ce192e0eb15c1fc861a436bf21b5bb3b91dbdabbdebe83e1f83aa098fe weston-9.0.0.tar.xz
sha512 ccc263f8279b7b23e5c593b4a8a023de2c3dc178b1b8d6593599171770bcfe97608de9fcb77aa1cab39255451d289d323e51c317dae190c7641282e085b84f90 weston-9.0.0.tar.xz
# From https://lists.freedesktop.org/archives/wayland-devel/2022-June/042260.html
sha256 8a9e52506a865a7410981b04f8341b89b84106db8531ab1f9fdd37b5dc034115 weston-10.0.1.tar.xz
sha512 688d843096a95b463161b98e85ca3443b31ba2ee49fc8d456a2780cc96f576e9d097054e9f361997a66e9cc8373cf29e406a742dae3884b3b50b26acf1710c8c weston-10.0.1.tar.xz
sha256 fdb65868f65d0fbdb05c2d3b779e10ce9969fa0c4b9262ba4f260e87086ab860 COPYING
Regular → Executable
+34 -12
View File
@@ -4,20 +4,22 @@
#
################################################################################
WESTON_VERSION = 9.0.0
WESTON_SITE = https://wayland.freedesktop.org/releases
WESTON_VERSION = 10.0.1
WESTON_SITE = https://gitlab.freedesktop.org/wayland/weston/-/releases/$(WESTON_VERSION)/downloads
WESTON_SOURCE = weston-$(WESTON_VERSION).tar.xz
WESTON_LICENSE = MIT
WESTON_LICENSE_FILES = COPYING
WESTON_CPE_ID_VENDOR = wayland
WESTON_DEPENDENCIES = host-pkgconf wayland wayland-protocols \
libxkbcommon pixman libpng jpeg udev cairo libinput libdrm
libxkbcommon pixman libpng udev cairo libinput libdrm
WESTON_CONF_OPTS = \
-Dbackend-headless=false \
-Dcolor-management-colord=false \
-Dremoting=false
-Ddoc=false \
-Dremoting=false \
-Dtools=calibrator,debug,info,terminal,touch-calibrator
# Uses VIDIOC_EXPBUF, only available from 3.8+
ifeq ($(BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_8),y)
@@ -33,6 +35,20 @@ else
WESTON_CONF_OPTS += -Dlauncher-logind=false
endif
ifeq ($(BR2_PACKAGE_SEATD),y)
WESTON_CONF_OPTS += -Dlauncher-libseat=true
WESTON_DEPENDENCIES += seatd
else
WESTON_CONF_OPTS += -Dlauncher-libseat=false
endif
ifeq ($(BR2_PACKAGE_JPEG),y)
WESTON_CONF_OPTS += -Dimage-jpeg=true
WESTON_DEPENDENCIES += jpeg
else
WESTON_CONF_OPTS += -Dimage-jpeg=false
endif
ifeq ($(BR2_PACKAGE_WEBP),y)
WESTON_CONF_OPTS += -Dimage-webp=true
WESTON_DEPENDENCIES += webp
@@ -48,10 +64,10 @@ endef
define WESTON_USERS
- - weston-launch -1 - - - - Weston launcher group
endef
WESTON_CONF_OPTS += -Dweston-launch=true
WESTON_CONF_OPTS += -Ddeprecated-weston-launch=true
WESTON_DEPENDENCIES += linux-pam
else
WESTON_CONF_OPTS += -Dweston-launch=false
WESTON_CONF_OPTS += -Ddeprecated-weston-launch=false
endif
ifeq ($(BR2_PACKAGE_HAS_LIBEGL_WAYLAND)$(BR2_PACKAGE_HAS_LIBGLES),yy)
@@ -76,18 +92,24 @@ else
WESTON_CONF_OPTS += -Dbackend-rdp=false
endif
ifeq ($(BR2_PACKAGE_WESTON_FBDEV),y)
WESTON_CONF_OPTS += -Dbackend-fbdev=true
else
WESTON_CONF_OPTS += -Dbackend-fbdev=false
endif
ifeq ($(BR2_PACKAGE_WESTON_DRM),y)
WESTON_CONF_OPTS += -Dbackend-drm=true
else
WESTON_CONF_OPTS += -Dbackend-drm=false
endif
ifeq ($(BR2_PACKAGE_WESTON_HEADLESS),y)
WESTON_CONF_OPTS += -Dbackend-headless=true
else
WESTON_CONF_OPTS += -Dbackend-headless=false
endif
ifeq ($(BR2_PACKAGE_WESTON_WAYLAND),y)
WESTON_CONF_OPTS += -Dbackend-wayland=true
else
WESTON_CONF_OPTS += -Dbackend-wayland=false
endif
ifeq ($(BR2_PACKAGE_WESTON_X11),y)
WESTON_CONF_OPTS += -Dbackend-x11=true
WESTON_DEPENDENCIES += libxcb xlib_libX11