+++ /dev/null
-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>
-Upstream-Status: Backport [https://gitlab.freedesktop.org/wayland/weston/-/commit/14cfb979]
----
- 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
-
+++ /dev/null
-From fb60f9c16ce8865fbdcd181419f44b72af1aa3c2 Mon Sep 17 00:00:00 2001
-From: Ray Smith <rsmith@brightsign.biz>
-Date: Tue, 19 Dec 2023 11:43:55 +0000
-Subject: [PATCH 1/2] backend-drm: don't leak gem_handle_refcnt in drm_destroy
-
-Signed-off-by: Ray Smith <rsmith@brightsign.biz>
-Upstream-Status: Backport [https://gitlab.freedesktop.org/wayland/weston/-/commit/80f096d9]
----
- libweston/backend-drm/drm.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
-index 8092789..fcececb 100644
---- a/libweston/backend-drm/drm.c
-+++ b/libweston/backend-drm/drm.c
-@@ -3364,6 +3364,9 @@ drm_destroy(struct weston_backend *backend)
- weston_launcher_close(ec->launcher, device->drm.fd);
- weston_launcher_destroy(ec->launcher);
-
-+ if (device->gem_handle_refcnt)
-+ hash_table_destroy(device->gem_handle_refcnt);
-+
- free(device->drm.filename);
- free(device);
- free(b);
---
-2.43.0
-
+++ /dev/null
-From 10fcfd66069c774e28f67b18afd329e4bcf9f5b3 Mon Sep 17 00:00:00 2001
-From: Ray Smith <rsmith@brightsign.biz>
-Date: Tue, 19 Dec 2023 11:45:45 +0000
-Subject: [PATCH 2/2] backend-drm: always create gem_handle_refcnt hash table
-
-Devices created via drm_device_create have this hash table, but those
-created via drm_backend_create don't.
-
-Signed-off-by: Ray Smith <rsmith@brightsign.biz>
-Upstream-Status: Backport [https://gitlab.freedesktop.org/wayland/weston/-/commit/e7960048]
----
- libweston/backend-drm/drm.c | 12 +++++++++---
- 1 file changed, 9 insertions(+), 3 deletions(-)
-
-diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
-index fcececb..9d6a9cf 100644
---- a/libweston/backend-drm/drm.c
-+++ b/libweston/backend-drm/drm.c
-@@ -3364,8 +3364,7 @@ drm_destroy(struct weston_backend *backend)
- weston_launcher_close(ec->launcher, device->drm.fd);
- weston_launcher_destroy(ec->launcher);
-
-- if (device->gem_handle_refcnt)
-- hash_table_destroy(device->gem_handle_refcnt);
-+ hash_table_destroy(device->gem_handle_refcnt);
-
- free(device->drm.filename);
- free(device);
-@@ -3867,10 +3866,13 @@ drm_backend_create(struct weston_compositor *compositor,
-
- device = zalloc(sizeof *device);
- if (device == NULL)
-- return NULL;
-+ goto err_backend;
- device->state_invalid = true;
- device->drm.fd = -1;
- device->backend = b;
-+ device->gem_handle_refcnt = hash_table_create();
-+ if (!device->gem_handle_refcnt)
-+ goto err_device;
-
- b->drm = device;
- wl_list_init(&b->kms_list);
-@@ -4108,6 +4110,10 @@ err_compositor:
- if (b->gbm)
- gbm_device_destroy(b->gbm);
- #endif
-+ hash_table_destroy(device->gem_handle_refcnt);
-+err_device:
-+ free(device);
-+err_backend:
- free(b);
- return NULL;
- }
---
-2.43.0
-
-require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'weston_13.0_aglcore.inc', '', d)}
+require ${@bb.utils.contains('AGL_FEATURES', 'aglcore', 'weston_14_aglcore.inc', '', d)}
SRC_URI:append = " \
file://0001-clients-Handle-missing-pointer_surface-is-there-s-no.patch \
- file://0001-backend-drm-don-t-leak-gem_handle_refcnt-in-drm_dest.patch \
- file://0002-backend-drm-always-create-gem_handle_refcnt-hash-tab.patch \
- file://0001-backend-Add-weston_get_backend_type.patch \
"
WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}"