From 18462e8924d6d0ac1db000f2e7ad3b7c427f0e18 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Fri, 15 Nov 2019 14:11:49 +0200 Subject: [PATCH] backend-drm: Further checks to skip plane assignment to HW planes Mode change from mixed-mode to renderer-only means we should no longer try to place views in HW planes (as we composite everything into the primary plane) thus we should avoid that whenever that happens. In the same time we need to be able to place in mixed-mode/renderer-only mode the cursor view into the cursor plane (if one is available). This patch adds a further check to skip plane assignment when disabling overlay support (when we switch to renderer-only mode), when drivers do not have atomic-modeset or it has been disabled intentionally. Signed-off-by: Marius Vlad --- libweston/backend-drm/state-propose.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/libweston/backend-drm/state-propose.c b/libweston/backend-drm/state-propose.c index e98e986f..767c34f4 100644 --- a/libweston/backend-drm/state-propose.c +++ b/libweston/backend-drm/state-propose.c @@ -691,6 +691,24 @@ drm_output_prepare_plane_view(struct drm_output_state *state, } } + if (mode == DRM_OUTPUT_PROPOSE_STATE_RENDERER_ONLY && + (plane->type == WDRM_PLANE_TYPE_OVERLAY || + plane->type == WDRM_PLANE_TYPE_PRIMARY)) { + drm_debug(b, "\t\t\t\t[plane] not adding plane %d to " + "candidate list: renderer-only mode\n", + plane->plane_id); + continue; + } + + if (plane->type != WDRM_PLANE_TYPE_CURSOR && + b->sprites_are_broken) { + drm_debug(b, "\t\t\t\t[plane] not adding plane %d, type %s to " + "candidate list: sprites are broken!\n", + plane->plane_id, + drm_output_get_plane_type_name(plane)); + continue; + } + if (!drm_output_plane_view_has_valid_format(plane, state, ev, fb)) { drm_debug(b, "\t\t\t\t[plane] not adding plane %d to " "candidate list: invalid pixel format\n",