summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2018-07-10 14:31:06 +0100
committerDaniel Stone <daniels@collabora.com>2018-07-11 12:24:55 +0100
commit44abfaaffde1c575e044dfd8df2db02fd8dde1b7 (patch)
treeade076d690b7985208fdc7e453825db73ff5d9ac
parenta0f8276fe814957ea8ae46bd4f5fda3a9e1b8e69 (diff)
downloadweston-44abfaaffde1c575e044dfd8df2db02fd8dde1b7.tar.gz
compositor-drm: Use sprites_are_broken for scanout plane
When the sprites_are_broken variable is set, do not attempt to promote client surfaces to the scanout plane. We are currently assuming that every client buffer will be compatible with the scanout plane, but that is not the case, particularly with more exotic tiled/compressed buffers. Once we promote the client buffer to scanout, there is no going back: if the repaint fails, we do not mark this as failed and go back to repaint through composition. This permanently removes the ability for scanout bypass when using the non-atomic path. Future patches lift the restriction when using atomic modesetting, as we can actually test and ensure that the view is compatible with scanout. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reported-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-rw-r--r--libweston/compositor-drm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 2305f708..d045778a 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -1944,11 +1944,14 @@ drm_output_prepare_scanout_view(struct drm_output_state *output_state,
struct weston_view *ev)
{
struct drm_output *output = output_state->output;
+ struct drm_backend *b = to_drm_backend(output->base.compositor);
struct drm_plane *scanout_plane = output->scanout_plane;
struct drm_plane_state *state;
struct drm_fb *fb;
pixman_box32_t *extents;
+ assert(!b->sprites_are_broken);
+
/* Check the view spans exactly the output size, calculated in the
* logical co-ordinate space. */
extents = pixman_region32_extents(&ev->transform.boundingbox);
@@ -3004,8 +3007,7 @@ drm_output_prepare_overlay_view(struct drm_output_state *output_state,
struct drm_fb *fb;
unsigned int i;
- if (b->sprites_are_broken)
- return NULL;
+ assert(!b->sprites_are_broken);
fb = drm_fb_get_from_view(output_state, ev);
if (!fb)
@@ -3260,6 +3262,7 @@ drm_output_propose_state(struct weston_output *output_base,
struct drm_pending_state *pending_state)
{
struct drm_output *output = to_drm_output(output_base);
+ struct drm_backend *b = to_drm_backend(output->base.compositor);
struct drm_output_state *state;
struct weston_view *ev;
pixman_region32_t surface_overlap, renderer_region, occluded_region;
@@ -3342,6 +3345,9 @@ drm_output_propose_state(struct weston_output *output_base,
if (next_plane == NULL && !drm_view_is_opaque(ev))
next_plane = primary;
+ if (next_plane == NULL && b->sprites_are_broken)
+ next_plane = primary;
+
if (next_plane == NULL)
next_plane = drm_output_prepare_scanout_view(state, ev);