summaryrefslogtreecommitdiffstats
path: root/meta-agl-core/recipes-graphics/wayland/weston
diff options
context:
space:
mode:
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
+