From 9e379db082ab99d46295661199f7435d1c7995d9 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Thu, 18 Nov 2021 15:21:08 +0000 Subject: [PATCH] backend-drm: Early-out in plane assignment for unimportable buffers No sense walking the plane list every frame if we can't use it because it's neither a SHM buffer nor a client buffer we can directly import as a framebuffer. Signed-off-by: Daniel Stone --- libweston/backend-drm/state-propose.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libweston/backend-drm/state-propose.c b/libweston/backend-drm/state-propose.c index 247762f4..7ddecd7b 100644 --- a/libweston/backend-drm/state-propose.c +++ b/libweston/backend-drm/state-propose.c @@ -773,6 +773,8 @@ drm_output_prepare_plane_view(struct drm_output_state *state, buffer = ev->surface->buffer_ref.buffer; shmbuf = wl_shm_buffer_get(buffer->resource); fb = drm_fb_get_from_view(state, ev, try_view_on_plane_failure_reasons); + if (!shmbuf && !fb) + return NULL; /* assemble a list with possible candidates */ wl_list_for_each(plane, &b->plane_list, link) {