meta-agl-profile-graphical: backport weston drm tear-down fix
[AGL/meta-agl.git] / meta-agl-profile-graphical / recipes-graphics / wayland / weston / 0005-correctly-tear-down-drm-backend.patch
1 commit 5130a8c21a9deea54e8f7c96a3a5049e2d60a210
2 Author: Marius Vlad <marius.vlad@collabora.com>
3 Date:   Thu Jul 30 14:47:32 2020 +0300
4
5 backend-drm: Correctly tear down the DRM backend
6     
7 It seem that we skipped to put back in TEXT mode the tty, in case a DRM
8 device node wasn't present at that time, or it isn't present at all. This
9 orders the destroy part correctly as to handle that case as well.
10     
11 As a side effect, as the tty will still be set to GRAPHICS mode we will
12 require a manual change of the tty number, which might be not possible
13 on all systems. Properly putting back the tty to TEXT mode should avoid
14 that, and allows to re-use the same tty no in case the DRM device has
15 been created at a later point in time.
16
17 Upstream-Status: Backport    
18 Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
19 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
20
21 diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
22 index 980a12da..1cf61a33 100644
23 --- a/libweston/backend-drm/drm.c
24 +++ b/libweston/backend-drm/drm.c
25 @@ -3031,10 +3031,10 @@ err_sprite:
26         destroy_sprites(b);
27  err_udev_dev:
28         udev_device_unref(drm_device);
29 -err_launcher:
30 -       weston_launcher_destroy(compositor->launcher);
31  err_udev:
32         udev_unref(b->udev);
33 +err_launcher:
34 +       weston_launcher_destroy(compositor->launcher);
35  err_compositor:
36         weston_compositor_shutdown(compositor);
37         free(b);