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>
dev
Daniel Stone 6 years ago
parent a0f8276fe8
commit 44abfaaffd
  1. 10
      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);

Loading…
Cancel
Save