view: Move psf_flags from weston_view to weston_paint_node

Fundamentally, the flags are a property of each paint node, rather than
each view as such. Move them over there so it gets a little less painful
to work with.

Signed-off-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Daniel Stone 2023-12-06 16:21:55 +00:00 committed by Marius Vlad
parent b56d887e34
commit f5074f261a
4 changed files with 22 additions and 24 deletions

View File

@ -1827,9 +1827,6 @@ struct weston_view {
*/
uint32_t output_mask;
/* Per-surface Presentation feedback flags, controlled by backend. */
uint32_t psf_flags;
bool is_mapped;
struct weston_log_pacer subsurface_parent_log_pacer;
};

View File

@ -1076,12 +1076,12 @@ drm_assign_planes(struct weston_output *output_base)
if (!target_plane ||
target_plane->type == WDRM_PLANE_TYPE_CURSOR) {
/* cursor plane & renderer involve a copy */
ev->psf_flags = 0;
pnode->psf_flags = 0;
} else {
/* All other planes are a direct scanout of a
* single client buffer.
*/
ev->psf_flags = WP_PRESENTATION_FEEDBACK_KIND_ZERO_COPY;
pnode->psf_flags = WP_PRESENTATION_FEEDBACK_KIND_ZERO_COPY;
}
}

View File

@ -3579,18 +3579,19 @@ static void
weston_output_take_feedback_list(struct weston_output *output,
struct weston_surface *surface)
{
struct weston_view *view;
struct weston_presentation_feedback *feedback;
struct weston_paint_node *pnode;
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) {
wl_list_for_each(pnode, &surface->paint_node_list, surface_link) {
/* ignore views that are not on this output at all */
if (view->output_mask & (1u << output->id))
flags &= view->psf_flags;
if (pnode->output != output)
continue;
flags &= pnode->psf_flags;
}
wl_list_for_each(feedback, &surface->feedback_list, link)
@ -3703,7 +3704,7 @@ weston_output_repaint(struct weston_output *output, struct timespec *now)
wl_list_for_each(pnode, &output->paint_node_z_order_list,
z_order_link) {
weston_paint_node_move_to_plane(pnode, &output->primary_plane);
pnode->view->psf_flags = 0;
pnode->psf_flags = 0;
}
}
@ -3733,22 +3734,22 @@ weston_output_repaint(struct weston_output *output, struct timespec *now)
/* Note: This operation is safe to do multiple times on the
* same surface.
*/
if (pnode->surface->output == output) {
if (pnode->surface->output != output)
continue;
/*
* avoid adding pnode's frame callbacks/presented
* feedback to the respective lists if pnode/surface is
* occluded
*/
if (!pixman_region32_not_empty(&pnode->visible))
continue;
/*
* avoid adding pnode's frame callbacks/presented
* feedback to the respective lists if pnode/surface is
* occluded
*/
if (!pixman_region32_not_empty(&pnode->visible))
continue;
wl_list_insert_list(&frame_callback_list,
&pnode->surface->frame_callback_list);
wl_list_init(&pnode->surface->frame_callback_list);
wl_list_insert_list(&frame_callback_list,
&pnode->surface->frame_callback_list);
wl_list_init(&pnode->surface->frame_callback_list);
weston_output_take_feedback_list(output, pnode->surface);
}
weston_output_take_feedback_list(output, pnode->surface);
}

View File

@ -561,8 +561,8 @@ struct weston_paint_node {
bool is_direct;
bool draw_solid;
struct weston_solid_buffer_values solid;
bool need_hole;
uint32_t psf_flags; /* presentation-feedback flags */
};
struct weston_paint_node *