summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2016-11-29 21:03:44 +0000
committerDaniel Stone <daniels@collabora.com>2017-02-07 19:16:33 +0000
commit1b23e2c4d4a8f545a3e52f63a93d94f0d072d948 (patch)
tree8f026697c21561ee013654aedb020d7459f2b797
parent716d7d7a609292732b0f92104806e5ce25735f61 (diff)
compositor-drm: Ignore views on other outputs
When we come to assign_planes, try very hard to ignore views which are only visible on other outputs, rather than forcibly moving them to the primary plane, which causes damage all round and unnecessary repaints. Signed-off-by: Daniel Stone <daniels@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D1530
-rw-r--r--libweston/compositor-drm.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 12249fa9..9855e614 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -1404,10 +1404,6 @@ drm_fb_get_from_view(struct drm_output_state *state, struct weston_view *ev)
struct linux_dmabuf_buffer *dmabuf;
struct drm_fb *fb;
- /* Don't import buffers which span multiple outputs. */
- if (ev->output_mask != (1u << output->base.id))
- return NULL;
-
if (ev->alpha != 1.0f)
return NULL;
@@ -2499,10 +2495,6 @@ drm_output_prepare_cursor_view(struct drm_output_state *output_state,
if (plane->state_cur->output && plane->state_cur->output != output)
return NULL;
- /* Don't import buffers which span multiple outputs. */
- if (ev->output_mask != (1u << output->base.id))
- return NULL;
-
/* We use GBM to import SHM buffers. */
if (b->gbm == NULL)
return NULL;
@@ -2661,13 +2653,22 @@ drm_output_propose_state(struct weston_output *output_base)
wl_list_for_each(ev, &output_base->compositor->view_list, link) {
struct weston_plane *next_plane = NULL;
+ /* If this view doesn't touch our output at all, there's no
+ * reason to do anything with it. */
+ if (!(ev->output_mask & (1u << output->base.id)))
+ continue;
+
+ /* We only assign planes to views which are exclusively present
+ * on our output. */
+ if (ev->output_mask != (1u << output->base.id))
+ next_plane = primary;
+
/* Since we process views from top to bottom, we know that if
* the view intersects the calculated renderer region, it must
* be part of, or occluded by, it, and cannot go on a plane. */
pixman_region32_init(&surface_overlap);
pixman_region32_intersect(&surface_overlap, &renderer_region,
&ev->transform.boundingbox);
-
if (pixman_region32_not_empty(&surface_overlap))
next_plane = primary;
pixman_region32_fini(&surface_overlap);
@@ -2706,6 +2707,11 @@ drm_assign_planes(struct weston_output *output_base, void *repaint_data)
wl_list_for_each(ev, &output_base->compositor->view_list, link) {
struct drm_plane *target_plane = NULL;
+ /* If this view doesn't touch our output at all, there's no
+ * reason to do anything with it. */
+ if (!(ev->output_mask & (1u << output->base.id)))
+ continue;
+
/* Test whether this buffer can ever go into a plane:
* non-shm, or small enough to be a cursor.
*