1 From bd108ca84767a339c274ad0b56d74b46b3888c38 Mon Sep 17 00:00:00 2001
2 From: Marius Vlad <marius.vlad@collabora.com>
3 Date: Thu, 1 Apr 2021 00:12:00 +0300
4 Subject: [PATCH] libweston/backend-drm: Re-order gbm destruction at
7 Tearing down the drm-backend when there are no input devices, would call
8 for the gbm device destruction before compositor shutdown. The latter
9 would call into the renderer detroy function and assume that the
10 EGLDisplay, which was created using the before-mentioned gbm device, is
11 still available. This patch re-orders the gbm destruction after the
12 compositor shutdown when no one would make use of it.
16 Upstream-Status: Backport
17 Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
18 Suggested-by: Daniel Stone <daniel.stone@collabora.com>
21 libweston/backend-drm/drm.c | 8 ++++----
22 1 file changed, 4 insertions(+), 4 deletions(-)
24 diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
25 index be2570b..3cb41bf 100644
26 --- a/libweston/backend-drm/drm.c
27 +++ b/libweston/backend-drm/drm.c
28 @@ -2992,10 +2992,6 @@ err_drm_source:
30 udev_input_destroy(&b->input);
34 - gbm_device_destroy(b->gbm);
38 udev_device_unref(drm_device);
39 @@ -3005,6 +3001,10 @@ err_launcher:
40 weston_launcher_destroy(compositor->launcher);
42 weston_compositor_shutdown(compositor);
45 + gbm_device_destroy(b->gbm);