summaryrefslogtreecommitdiff
path: root/recipes-graphics/wayland/weston/0001-libweston-backend-fbdev-fbdev.c-don-t-destroy-output.patch
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2021-02-04 21:51:07 +0100
committerMax Krummenacher <max.krummenacher@toradex.com>2021-02-22 18:34:26 +0100
commit31b6041d525f36c20f20e8f9b9d06fd515fe9d1a (patch)
treedeb50d5aac48fe3fcfe018bd2fbdf8cad2732f29 /recipes-graphics/wayland/weston/0001-libweston-backend-fbdev-fbdev.c-don-t-destroy-output.patch
parent40ea7dd9bf213d2e822d4a1b2ecc68a0cc24e1a7 (diff)
weston: imx: fix use with fbdev/pixman
If the imx fork is used on a i.MX 6ULL stopping weston may result in a segfault due to using already freed memory. Make sure to only call pixman_renderer_output_destroy() once and harden pixman_renderer_output_destroy() to not segfault should it be called twice. Related-to: ELB-3532 Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 942c1d04fb1c57e0698620adc03fbd476c8fbe93)
Diffstat (limited to 'recipes-graphics/wayland/weston/0001-libweston-backend-fbdev-fbdev.c-don-t-destroy-output.patch')
-rw-r--r--recipes-graphics/wayland/weston/0001-libweston-backend-fbdev-fbdev.c-don-t-destroy-output.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/recipes-graphics/wayland/weston/0001-libweston-backend-fbdev-fbdev.c-don-t-destroy-output.patch b/recipes-graphics/wayland/weston/0001-libweston-backend-fbdev-fbdev.c-don-t-destroy-output.patch
new file mode 100644
index 0000000..1469938
--- /dev/null
+++ b/recipes-graphics/wayland/weston/0001-libweston-backend-fbdev-fbdev.c-don-t-destroy-output.patch
@@ -0,0 +1,50 @@
+From 52ec338ec27a3e3267442bcef36e0b9312441af5 Mon Sep 17 00:00:00 2001
+From: Max Krummenacher <max.krummenacher@toradex.com>
+Date: Thu, 4 Feb 2021 20:33:40 +0000
+Subject: [PATCH 1/2] libweston/backend-fbdev/fbdev.c: don't destroy output
+ twice
+
+This is currently unsupported and may result in a segfault.
+
+fbdev_output_disable(base) does call pixman_renderer_output_destroy(base) so
+one should not do it a second time here.
+
+Observed on a colibri-imx6ull which actually uses pixman for rendering.
+
+Program received signal SIGSEGV, Segmentation fault.
+_pixman_image_fini (image=0x636f6c2f)
+ at ../pixman-0.38.4/pixman/pixman-image.c:139
+139 ../pixman-0.38.4/pixman/pixman-image.c: Datei oder Verzeichnis nicht gefunden.
+(gdb) bt
+ at ../pixman-0.38.4/pixman/pixman-image.c:139
+ at ../pixman-0.38.4/pixman/pixman-image.c:211
+ at ../git/libweston/pixman-renderer.c:971
+ at ../git/libweston/backend-fbdev/fbdev.c:790
+ at ../git/libweston/compositor.c:7607
+ at ../git/libweston/backend-fbdev/fbdev.c:885
+ at ../git/libweston/compositor.c:7949
+ at ../git/compositor/main.c:3538
+ from /srv/nfs/rootfs-colibri-imx6ull/lib/libc.so.6
+
+Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
+---
+ libweston/backend-fbdev/fbdev.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/libweston/backend-fbdev/fbdev.c b/libweston/backend-fbdev/fbdev.c
+index becc1488..6c6376c1 100644
+--- a/libweston/backend-fbdev/fbdev.c
++++ b/libweston/backend-fbdev/fbdev.c
+@@ -786,8 +786,7 @@ fbdev_output_destroy(struct weston_output *base)
+ fbdev_output_disable(base);
+
+ if (backend->use_pixman) {
+- if (base->renderer_state != NULL)
+- pixman_renderer_output_destroy(base);
++ ;
+ #if defined(ENABLE_IMXGPU)
+ #if defined(ENABLE_IMXG2D)
+ } else if (backend->use_g2d) {
+--
+2.20.1
+