summaryrefslogtreecommitdiffstats
path: root/meta-agl-core/recipes-graphics/wayland/weston
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2024-12-13 17:41:21 +0200
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2025-01-06 16:03:33 +0000
commitd51049c8222704775f81c0fed82e3a1c8c398f64 (patch)
tree6e3419cd6d1e219205874944b3845773695b3883 /meta-agl-core/recipes-graphics/wayland/weston
parent6960b0d1c461910bdf6dab4fade24df3b7808e20 (diff)
weston: Add weston_get_backend_type from Weston 14HEADmaster
This helper is from Weston 14 and helps identify the outputs created by other remote back-ends (like PipeWire/RDP/VNC) which we can further use to further differentiate between different types of back- ends. Bug-AGL: SPEC-5324 Change-Id: Ie7537380eaa81a4c48d4ef5c09598ab102310842 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/30680 Tested-by: Jenkins Job builder account Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'meta-agl-core/recipes-graphics/wayland/weston')
-rw-r--r--meta-agl-core/recipes-graphics/wayland/weston/0001-backend-Add-weston_get_backend_type.patch79
1 files changed, 79 insertions, 0 deletions
diff --git a/meta-agl-core/recipes-graphics/wayland/weston/0001-backend-Add-weston_get_backend_type.patch b/meta-agl-core/recipes-graphics/wayland/weston/0001-backend-Add-weston_get_backend_type.patch
new file mode 100644
index 000000000..01d5f91d6
--- /dev/null
+++ b/meta-agl-core/recipes-graphics/wayland/weston/0001-backend-Add-weston_get_backend_type.patch
@@ -0,0 +1,79 @@
+From fcccf1b63dc3cbf6063238c39a31197f0d32364c Mon Sep 17 00:00:00 2001
+From: Marius Vlad <marius.vlad@collabora.com>
+Date: Fri, 13 Dec 2024 17:14:44 +0200
+Subject: [PATCH] backend: Add weston_get_backend_type
+
+Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
+---
+ include/libweston/libweston.h | 3 +++
+ libweston/backend.h | 5 +++++
+ libweston/compositor.c | 19 +++++++++++++++++++
+ 3 files changed, 27 insertions(+)
+
+diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h
+index 077c16b..da6200d 100644
+--- a/include/libweston/libweston.h
++++ b/include/libweston/libweston.h
+@@ -2685,6 +2685,9 @@ weston_compositor_add_screenshot_authority(struct weston_compositor *compositor,
+ int
+ weston_compositor_backends_loaded(struct weston_compositor *compositor);
+
++enum weston_compositor_backend
++weston_get_backend_type(struct weston_backend *backend);
++
+ #ifdef __cplusplus
+ }
+ #endif
+diff --git a/libweston/backend.h b/libweston/backend.h
+index 495d0a5..9b12544 100644
+--- a/libweston/backend.h
++++ b/libweston/backend.h
+@@ -120,6 +120,11 @@ struct weston_backend {
+ */
+ bool (*can_scanout_dmabuf)(struct weston_backend *backend,
+ struct linux_dmabuf_buffer *buffer);
++
++ /** Identifies a particular backend_type from one
++ * defined in weston_compositor_backend.
++ */
++ enum weston_compositor_backend backend_type;
+ };
+
+ /* weston_head */
+diff --git a/libweston/compositor.c b/libweston/compositor.c
+index 41459eb..ef1932f 100644
+--- a/libweston/compositor.c
++++ b/libweston/compositor.c
+@@ -9691,6 +9691,7 @@ weston_compositor_load_backend(struct weston_compositor *compositor,
+ return NULL;
+
+ b = wl_container_of(compositor->backend_list.next, b, link);
++ b->backend_type = backend;
+
+ /* Return the last loaded backend. */
+ return b;
+@@ -9954,3 +9955,21 @@ weston_output_finish_frame_from_timer(struct weston_output *output)
+
+ weston_output_finish_frame(output, &ts, 0);
+ }
++
++/** Retrieve the backend type of as described in enum
++ * weston_compositor_backend.
++ *
++ * Note that the backend must be loaded, with weston_compositor_load_backend
++ *
++ * \param backend weston_backend in question
++ * \returns a type of enum weston_compositor_backend
++ *
++ * \sa weston_compositor_load_backend
++ *
++ */
++WL_EXPORT enum weston_compositor_backend
++weston_get_backend_type(struct weston_backend *backend)
++{
++ assert(backend);
++ return backend->backend_type;
++}
+--
+2.43.0
+