From 82b646728c74f86a42398628d1de0478cab334da Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 17 Jan 2022 19:03:33 +0000 Subject: [PATCH] backend-drm: Handle solid-colour buffers in state propose When we're checking to see if a view is suitable to go on a plane, check for (and reject) solid-colour buffers. Signed-off-by: Daniel Stone --- libweston/backend-drm/state-propose.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/libweston/backend-drm/state-propose.c b/libweston/backend-drm/state-propose.c index ecb49b71..790db3ec 100644 --- a/libweston/backend-drm/state-propose.c +++ b/libweston/backend-drm/state-propose.c @@ -447,7 +447,11 @@ drm_output_find_plane_for_view(struct drm_output_state *state, } buffer = ev->surface->buffer_ref.buffer; - if (buffer->type == WESTON_BUFFER_SHM) { + if (buffer->type == WESTON_BUFFER_SOLID) { + pnode->try_view_on_plane_failure_reasons |= + FAILURE_REASONS_FB_FORMAT_INCOMPATIBLE; + return NULL; + } else if (buffer->type == WESTON_BUFFER_SHM) { if (!output->cursor_plane || b->cursors_are_broken) { pnode->try_view_on_plane_failure_reasons |= FAILURE_REASONS_FB_FORMAT_INCOMPATIBLE; @@ -773,6 +777,17 @@ drm_output_propose_state(struct weston_output *output_base, force_renderer = true; } + /* We can support this with the 'CRTC background colour' property, + * if it is fullscreen (i.e. we disable the primary plane), and + * opaque (as it is only shown in the absence of any covering + * plane, not as a replacement for the primary plane per se). */ + if (ev->surface->buffer_ref.buffer && + ev->surface->buffer_ref.buffer->type == WESTON_BUFFER_SOLID) { + drm_debug(b, "\t\t\t\t[view] not assigning view %p to plane " + "(solid-colour surface)\n", ev); + force_renderer = true; + } + if (pnode->surf_xform.transform != NULL || !pnode->surf_xform.identity_pipeline) { drm_debug(b, "\t\t\t\t[view] not assigning view %p to plane "