From b7844bc8dd6208fd4d66192d7ff7311424ce2d2e Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Fri, 20 Mar 2026 13:51:40 -0500 Subject: [PATCH] drm: Move fence check before underlay check There's no need to evaluate these in any particular order, but I'm going to refactor all the check unrelated to underlays into a single place shortly. Signed-off-by: Derek Foreman --- libweston/backend-drm/state-propose.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libweston/backend-drm/state-propose.c b/libweston/backend-drm/state-propose.c index 9407fdb29..8b05bb2f7 100644 --- a/libweston/backend-drm/state-propose.c +++ b/libweston/backend-drm/state-propose.c @@ -723,6 +723,16 @@ drm_output_find_plane_for_view(struct drm_output_state *state, continue; } + /* If the surface buffer has an in-fence fd, but the plane doesn't + * support fences, we can't place the buffer on this plane. */ + if (ev->surface->acquire_fence_fd >= 0 && + plane->props[WDRM_PLANE_IN_FENCE_FD].prop_id == 0) { + drm_debug(b, "\t\t\t\t[%s] not placing view %s on %s: " + "no in-fence support\n", + p_name, ev->internal_name, p_name); + continue; + } + /* The paint node isn't occluded by the renderer, so it doesn't * unconditionally need an underlay plane. However, we may * only have underlay planes available, so it could use one @@ -750,16 +760,6 @@ drm_output_find_plane_for_view(struct drm_output_state *state, continue; } - /* If the surface buffer has an in-fence fd, but the plane doesn't - * support fences, we can't place the buffer on this plane. */ - if (ev->surface->acquire_fence_fd >= 0 && - plane->props[WDRM_PLANE_IN_FENCE_FD].prop_id == 0) { - drm_debug(b, "\t\t\t\t[%s] not placing view %s on %s: " - "no in-fence support\n", - p_name, ev->internal_name, p_name); - continue; - } - if (!output->has_underlay && mm_underlay_only) { drm_debug(b, "\t\t\t\t[plane] not adding plane %d to " "candidate list: plane is below the primary "