1 From d171c7b3ba346c4d0bd6494f45ebf0be3c3cc5fb Mon Sep 17 00:00:00 2001
2 From: Marius Vlad <marius.vlad@collabora.com>
3 Upstream-Status: Backport
4 Date: Thu, 1 Apr 2021 00:12:00 +0300
5 Subject: [PATCH] libweston/backend-drm: Re-order gbm destruction at
8 Tearing down the drm-backend when there are no input devices, would call
9 for the gbm device destruction before compositor shutdown. The latter
10 would call into the renderer detroy function and assume that the
11 EGLDisplay, which was created using the before-mentioned gbm device, is
12 still available. This patch re-orders the gbm destruction after the
13 compositor shutdown when no one would make use of it.
17 Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
18 Suggested-by: Daniel Stone <daniel.stone@collabora.com>
20 libweston/backend-drm/drm.c | 8 ++++----
21 1 file changed, 4 insertions(+), 4 deletions(-)
23 diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
24 index c780c1c16..abfcabd3b 100644
25 --- a/libweston/backend-drm/drm.c
26 +++ b/libweston/backend-drm/drm.c
27 @@ -3203,10 +3203,6 @@ err_drm_source:
29 udev_input_destroy(&b->input);
33 - gbm_device_destroy(b->gbm);
37 drmModeFreeResources(res);
38 @@ -3218,6 +3214,10 @@ err_launcher:
39 weston_launcher_destroy(compositor->launcher);
41 weston_compositor_shutdown(compositor);
44 + gbm_device_destroy(b->gbm);