From: Scott Murray Date: Thu, 28 Nov 2024 21:54:09 +0000 (-0500) Subject: weston: handle Weston 14.0 upgrade X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=b4edb2db13f58e8b2f6654ebbc24254e69669c74;p=AGL%2Fmeta-agl.git weston: handle Weston 14.0 upgrade Rework Weston bbappend and patches in meta-agl-core for upstream upgrade to 14.0. The dropped patches have been confirmed to be present upstream. Bug-AGL: SPEC-5147 Change-Id: I2132740a040401bc1281148dbc0246b717699836 Signed-off-by: Scott Murray --- 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 deleted file mode 100644 index 37e38e225..000000000 --- a/meta-agl-core/recipes-graphics/wayland/weston/0001-backend-Add-weston_get_backend_type.patch +++ /dev/null @@ -1,80 +0,0 @@ -From fcccf1b63dc3cbf6063238c39a31197f0d32364c Mon Sep 17 00:00:00 2001 -From: Marius Vlad -Date: Fri, 13 Dec 2024 17:14:44 +0200 -Subject: [PATCH] backend: Add weston_get_backend_type - -Signed-off-by: Marius Vlad -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 - diff --git a/meta-agl-core/recipes-graphics/wayland/weston/0001-backend-drm-don-t-leak-gem_handle_refcnt-in-drm_dest.patch b/meta-agl-core/recipes-graphics/wayland/weston/0001-backend-drm-don-t-leak-gem_handle_refcnt-in-drm_dest.patch deleted file mode 100644 index 4298a66f5..000000000 --- a/meta-agl-core/recipes-graphics/wayland/weston/0001-backend-drm-don-t-leak-gem_handle_refcnt-in-drm_dest.patch +++ /dev/null @@ -1,28 +0,0 @@ -From fb60f9c16ce8865fbdcd181419f44b72af1aa3c2 Mon Sep 17 00:00:00 2001 -From: Ray Smith -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 -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 - diff --git a/meta-agl-core/recipes-graphics/wayland/weston/0002-backend-drm-always-create-gem_handle_refcnt-hash-tab.patch b/meta-agl-core/recipes-graphics/wayland/weston/0002-backend-drm-always-create-gem_handle_refcnt-hash-tab.patch deleted file mode 100644 index a6e42386e..000000000 --- a/meta-agl-core/recipes-graphics/wayland/weston/0002-backend-drm-always-create-gem_handle_refcnt-hash-tab.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 10fcfd66069c774e28f67b18afd329e4bcf9f5b3 Mon Sep 17 00:00:00 2001 -From: Ray Smith -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 -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 - diff --git a/meta-agl-core/recipes-graphics/wayland/weston_13.0.%.bbappend b/meta-agl-core/recipes-graphics/wayland/weston_14.%.bbappend similarity index 70% rename from meta-agl-core/recipes-graphics/wayland/weston_13.0.%.bbappend rename to meta-agl-core/recipes-graphics/wayland/weston_14.%.bbappend index 87cad12a0..5ebff000f 100644 --- a/meta-agl-core/recipes-graphics/wayland/weston_13.0.%.bbappend +++ b/meta-agl-core/recipes-graphics/wayland/weston_14.%.bbappend @@ -1 +1 @@ -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)} diff --git a/meta-agl-core/recipes-graphics/wayland/weston_13.0_aglcore.inc b/meta-agl-core/recipes-graphics/wayland/weston_14_aglcore.inc similarity index 83% rename from meta-agl-core/recipes-graphics/wayland/weston_13.0_aglcore.inc rename to meta-agl-core/recipes-graphics/wayland/weston_14_aglcore.inc index f4f5e4c17..6edbc681d 100644 --- a/meta-agl-core/recipes-graphics/wayland/weston_13.0_aglcore.inc +++ b/meta-agl-core/recipes-graphics/wayland/weston_14_aglcore.inc @@ -2,9 +2,6 @@ FILESEXTRAPATHS:append := ":${THISDIR}/weston" 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])}"