backend-drm: Further checks to skip plane assignment to HW planes
authorMarius Vlad <marius.vlad@collabora.com>
Fri, 15 Nov 2019 12:11:49 +0000 (14:11 +0200)
committerMarius Vlad <marius.vlad@collabora.com>
Fri, 22 Nov 2019 18:25:20 +0000 (20:25 +0200)
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 <marius.vlad@collabora.com>
libweston/backend-drm/state-propose.c

index e98e986fb54ec96979ac3024ab70d5b005ff110f..767c34f463cdfb466e1757d9b36fdb1b24431138 100644 (file)
@@ -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",