From f4c7dcac228f7b4a749f94f38efff6d15b08fc8a Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Tue, 28 Dec 2021 16:48:17 +0200 Subject: meta-agl-core/recipes-graphics/wayland: Backport two fixes for libweston-8 This backports two small fixes for some potential libweston crashes happening on the DRM backend tear down, or EGL initailization failure paths. Bug-AGL: SPEC-4197 Signed-off-by: Marius Vlad Reported-by: Scott Murray Change-Id: Idc28bb7ef6d8fde8c149bb5eb35a2ba40a25706a Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/27068 Tested-by: Jenkins Job builder account ci-image-build: Jenkins Job builder account ci-image-boot-test: Jenkins Job builder account Reviewed-by: Scott Murray Reviewed-by: Jan-Simon Moeller --- ...ackend-drm-Re-order-gbm-destruction-at-DR.patch | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch (limited to 'meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch') diff --git a/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch b/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch new file mode 100644 index 000000000..e8e324c32 --- /dev/null +++ b/meta-agl-core/recipes-graphics/wayland/weston/0001-libweston-backend-drm-Re-order-gbm-destruction-at-DR.patch @@ -0,0 +1,51 @@ +From d171c7b3ba346c4d0bd6494f45ebf0be3c3cc5fb Mon Sep 17 00:00:00 2001 +From: Marius Vlad +Upstream-Status: Backport +Date: Thu, 1 Apr 2021 00:12:00 +0300 +Subject: [PATCH] libweston/backend-drm: Re-order gbm destruction at + DRM-backend tear down + +Tearing down the drm-backend when there are no input devices, would call +for the gbm device destruction before compositor shutdown. The latter +would call into the renderer detroy function and assume that the +EGLDisplay, which was created using the before-mentioned gbm device, is +still available. This patch re-orders the gbm destruction after the +compositor shutdown when no one would make use of it. + +Fixes: #314 + +Signed-off-by: Marius Vlad +Suggested-by: Daniel Stone +--- + libweston/backend-drm/drm.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c +index c780c1c16..abfcabd3b 100644 +--- a/libweston/backend-drm/drm.c ++++ b/libweston/backend-drm/drm.c +@@ -3203,10 +3203,6 @@ err_drm_source: + err_udev_input: + udev_input_destroy(&b->input); + err_sprite: +-#ifdef BUILD_DRM_GBM +- if (b->gbm) +- gbm_device_destroy(b->gbm); +-#endif + destroy_sprites(b); + err_create_crtc_list: + drmModeFreeResources(res); +@@ -3218,6 +3214,10 @@ err_launcher: + weston_launcher_destroy(compositor->launcher); + err_compositor: + weston_compositor_shutdown(compositor); ++#ifdef BUILD_DRM_GBM ++ if (b->gbm) ++ gbm_device_destroy(b->gbm); ++#endif + free(b); + return NULL; + } +-- +2.33.0 + -- cgit 1.2.3-korg