From 3d6721eb15c8aa84e908d26d25e70f31a8fcf715 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Wed, 16 Sep 2020 15:04:04 +0300 Subject: [PATCH] drm-backend: fix deinit_planes Commit "drm-backend: move code to init/deinit planes to specific functions" lost a chunk of drm_output_deinit() when moving code into drm_output_deinit_planes(). Reinstate the missing chunk. This fixes an endless loop over weston_compositor::plane_list when you start with three monitors connected, unplug and re-plug one. Fixes: 3be23eff99f13a4fdf5f31537bd489316b91346f Signed-off-by: Pekka Paalanen --- libweston/backend-drm/drm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c index 7a8bc238..53cf9fa6 100644 --- a/libweston/backend-drm/drm.c +++ b/libweston/backend-drm/drm.c @@ -1706,6 +1706,16 @@ drm_output_deinit_planes(struct drm_output *output) /* If the compositor is already shutting down, the planes have already * been destroyed. */ if (!b->shutting_down) { + wl_list_remove(&output->scanout_plane->base.link); + wl_list_init(&output->scanout_plane->base.link); + + if (output->cursor_plane) { + wl_list_remove(&output->cursor_plane->base.link); + wl_list_init(&output->cursor_plane->base.link); + /* Turn off hardware cursor */ + drmModeSetCursor(b->drm.fd, output->crtc->crtc_id, 0, 0, 0); + } + if (!b->universal_planes) { /* Without universal planes, our special planes are * pseudo-planes allocated at output creation, freed at