next_plane = drm_output_prepare_overlay_view(output, ev);
if (next_plane == NULL)
next_plane = primary;
+
weston_view_move_to_plane(ev, next_plane);
+
if (next_plane == primary)
pixman_region32_union(&overlap, &overlap,
&ev->transform.boundingbox);
+ if (next_plane == primary ||
+ next_plane == &output->cursor_plane) {
+ /* cursor plane involves a copy */
+ ev->psf_flags = 0;
+ } else {
+ /* All other planes are a direct scanout of a
+ * single client buffer.
+ */
+ ev->psf_flags = PRESENTATION_FEEDBACK_KIND_ZERO_COPY;
+ }
+
pixman_region32_fini(&surface_overlap);
}
pixman_region32_fini(&overlap);
/* XXX: could use just wl_resource_get_link() instead */
struct wl_list link;
+
+ /* The per-surface feedback flags */
+ uint32_t psf_flags;
};
static void
ts->tv_nsec,
refresh_nsec,
seq >> 32, seq & 0xffffffff,
- flags);
+ flags | feedback->psf_flags);
wl_resource_destroy(feedback->resource);
}
surface_free_unused_subsurface_views(view->surface);
}
+static void
+weston_output_take_feedback_list(struct weston_output *output,
+ struct weston_surface *surface)
+{
+ struct weston_view *view;
+ struct weston_presentation_feedback *feedback;
+ uint32_t flags = 0xffffffff;
+
+ if (wl_list_empty(&surface->feedback_list))
+ return;
+
+ /* All views must have the flag for the flag to survive. */
+ wl_list_for_each(view, &surface->views, surface_link) {
+ /* ignore views that are not on this output at all */
+ if (view->output_mask & (1u << output->id))
+ flags &= view->psf_flags;
+ }
+
+ wl_list_for_each(feedback, &surface->feedback_list, link)
+ feedback->psf_flags = flags;
+
+ wl_list_insert_list(&output->feedback_list, &surface->feedback_list);
+ wl_list_init(&surface->feedback_list);
+}
+
static int
weston_output_repaint(struct weston_output *output)
{
/* Rebuild the surface list and update surface transforms up front. */
weston_compositor_build_view_list(ec);
- if (output->assign_planes && !output->disable_planes)
+ if (output->assign_planes && !output->disable_planes) {
output->assign_planes(output);
- else
- wl_list_for_each(ev, &ec->view_list, link)
+ } else {
+ wl_list_for_each(ev, &ec->view_list, link) {
weston_view_move_to_plane(ev, &ec->primary_plane);
+ ev->psf_flags = 0;
+ }
+ }
wl_list_init(&frame_callback_list);
wl_list_for_each(ev, &ec->view_list, link) {
&ev->surface->frame_callback_list);
wl_list_init(&ev->surface->frame_callback_list);
- wl_list_insert_list(&output->feedback_list,
- &ev->surface->feedback_list);
- wl_list_init(&ev->surface->feedback_list);
+ weston_output_take_feedback_list(output, ev->surface);
}
}