From 9aa68248a98aab86666f774339b90ca367385c1d Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 1 May 2023 23:38:22 +0100 Subject: [PATCH] backend-drm: Use weston_compositor.shutting_down We previously had our own local variable for this, but now we can just use the one in weston_compositor. Signed-off-by: Daniel Stone --- libweston/backend-drm/drm-gbm.c | 2 +- libweston/backend-drm/drm-internal.h | 2 -- libweston/backend-drm/drm.c | 8 +++----- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/libweston/backend-drm/drm-gbm.c b/libweston/backend-drm/drm-gbm.c index e399b329..a24c7c31 100644 --- a/libweston/backend-drm/drm-gbm.c +++ b/libweston/backend-drm/drm-gbm.c @@ -285,7 +285,7 @@ drm_output_fini_egl(struct drm_output *output) /* Destroying the GBM surface will destroy all our GBM buffers, * regardless of refcount. Ensure we destroy them here. */ - if (!b->shutting_down && + if (!b->compositor->shutting_down && output->scanout_plane->state_cur->fb && output->scanout_plane->state_cur->fb->type == BUFFER_GBM_SURFACE) { drm_plane_reset_state(output->scanout_plane); diff --git a/libweston/backend-drm/drm-internal.h b/libweston/backend-drm/drm-internal.h index 427ac958..3c7171d6 100644 --- a/libweston/backend-drm/drm-internal.h +++ b/libweston/backend-drm/drm-internal.h @@ -374,8 +374,6 @@ struct drm_backend { uint32_t pageflip_timeout; - bool shutting_down; - struct weston_log_scope *debug; }; diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c index 97df57c3..2c3edba4 100644 --- a/libweston/backend-drm/drm.c +++ b/libweston/backend-drm/drm.c @@ -1490,7 +1490,7 @@ drm_output_fini_pixman(struct drm_output *output) /* Destroying the Pixman surface will destroy all our buffers, * regardless of refcount. Ensure we destroy them here. */ - if (!b->shutting_down && + if (!b->compositor->shutting_down && output->scanout_plane->state_cur->fb && output->scanout_plane->state_cur->fb->type == BUFFER_PIXMAN_DUMB) { drm_plane_reset_state(output->scanout_plane); @@ -1970,7 +1970,7 @@ 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) { + if (!b->compositor->shutting_down) { wl_list_remove(&output->scanout_plane->base.link); wl_list_init(&output->scanout_plane->base.link); @@ -2173,7 +2173,7 @@ drm_output_deinit(struct weston_output *base) struct drm_device *device = b->drm; struct drm_pending_state *pending; - if (!b->shutting_down) { + if (!b->compositor->shutting_down) { pending = drm_pending_state_alloc(device); drm_output_get_disable_state(pending, output); drm_pending_state_apply_sync(pending); @@ -3174,8 +3174,6 @@ drm_destroy(struct weston_backend *backend) wl_event_source_remove(b->udev_drm_source); wl_event_source_remove(b->drm_source); - b->shutting_down = true; - destroy_sprites(b->drm); weston_log_scope_destroy(b->debug);