libweston: Move output damage subtraction out of backends

Right now every backend clears output damage from the primary plane when
it repaints. Instead of having this same operation spread across all
the backends, just do it in the core instead.

In the future, we want to remove damage tracking from the primary plane
entirely, and this is a small step in that direction.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2023-06-21 13:25:20 -05:00
parent a9986ef984
commit f07af89f9c
8 changed files with 3 additions and 22 deletions

View file

@ -415,9 +415,6 @@ drm_output_render(struct drm_output_state *state, pixman_region32_t *damage)
scanout_state->zpos = scanout_plane->zpos_min;
pixman_region32_subtract(&c->primary_plane.damage,
&c->primary_plane.damage, damage);
/* Don't bother calculating plane damage if the plane doesn't support it */
if (damage_info->prop_id == 0)
return;

View file

@ -167,9 +167,6 @@ headless_output_repaint(struct weston_output *output_base,
ec->renderer->repaint_output(&output->base, damage,
output->renderbuffer);
pixman_region32_subtract(&ec->primary_plane.damage,
&ec->primary_plane.damage, damage);
wl_event_source_timer_update(output->finish_frame_timer, 16);
return 0;

View file

@ -789,8 +789,6 @@ pipewire_output_repaint(struct weston_output *base, pixman_region32_t *damage)
pipewire_submit_buffer(output, buffer);
pixman_region32_subtract(&ec->primary_plane.damage,
&ec->primary_plane.damage, damage);
out:
pipewire_output_arm_timer(output);

View file

@ -317,9 +317,6 @@ rdp_output_repaint(struct weston_output *output_base, pixman_region32_t *damage)
pixman_region32_fini(&transformed_damage);
}
pixman_region32_subtract(&ec->primary_plane.damage,
&ec->primary_plane.damage, damage);
wl_event_source_timer_update(output->finish_frame_timer, next_frame_delta);
return 0;
}

View file

@ -957,8 +957,6 @@ vnc_output_repaint(struct weston_output *base, pixman_region32_t *damage)
if (pixman_region32_not_empty(damage)) {
vnc_update_buffer(output->display, damage);
pixman_region32_subtract(&ec->primary_plane.damage,
&ec->primary_plane.damage, damage);
}
/*

View file

@ -515,8 +515,6 @@ wayland_output_repaint_gl(struct weston_output *output_base,
ec->renderer->repaint_output(&output->base, damage, NULL);
pixman_region32_subtract(&ec->primary_plane.damage,
&ec->primary_plane.damage, damage);
return 0;
}
#endif
@ -638,8 +636,6 @@ wayland_output_repaint_pixman(struct weston_output *output_base,
sb->frame_damaged = 0;
pixman_region32_subtract(&b->compositor->primary_plane.damage,
&b->compositor->primary_plane.damage, damage);
return 0;
}

View file

@ -441,9 +441,6 @@ x11_output_repaint_gl(struct weston_output *output_base,
ec->renderer->repaint_output(output_base, damage, NULL);
pixman_region32_subtract(&ec->primary_plane.damage,
&ec->primary_plane.damage, damage);
wl_event_source_timer_update(output->finish_frame_timer, 10);
return 0;
}
@ -522,8 +519,6 @@ x11_output_repaint_shm(struct weston_output *output_base,
ec->renderer->repaint_output(output_base, damage, output->renderbuffer);
pixman_region32_subtract(&ec->primary_plane.damage,
&ec->primary_plane.damage, damage);
set_clip_for_output(output_base, damage);
cookie = xcb_shm_put_image_checked(b->conn, output->window, output->gc,
pixman_image_get_width(image),

View file

@ -3263,6 +3263,9 @@ weston_output_repaint(struct weston_output *output)
r = output->repaint(output, &output_damage);
pixman_region32_subtract(&ec->primary_plane.damage,
&ec->primary_plane.damage, &output_damage);
pixman_region32_fini(&output_damage);
output->repaint_needed = false;