mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-07 04:58:16 +02:00
renderer-gl: Set SHMbufs to dirty to avoid garbage
Mark all the SHM buffer as dirty to avoid garbage caused by original damage information in GPU recovery. Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
This commit is contained in:
parent
9730192811
commit
10d8c02fec
1 changed files with 27 additions and 0 deletions
|
|
@ -5301,6 +5301,7 @@ gl_renderer_recover_resources(struct weston_compositor *ec)
|
|||
{
|
||||
struct gl_renderer *gr = get_renderer(ec);
|
||||
struct gl_buffer_state *gb, *tmp;
|
||||
struct weston_output *output;
|
||||
struct wl_list tmp_gb_list;
|
||||
|
||||
wl_list_init(&tmp_gb_list);
|
||||
|
|
@ -5349,6 +5350,32 @@ gl_renderer_recover_resources(struct weston_compositor *ec)
|
|||
/* Manually add the new gbs to shm_bufs. */
|
||||
wl_list_insert_list(&gr->shm_bufs, &tmp_gb_list);
|
||||
|
||||
/*
|
||||
* Since all the buffer states have been recreated, mark them all as
|
||||
* dirty to avoid garbage caused by original damage information.
|
||||
*/
|
||||
wl_list_for_each(output, &ec->output_list, link) {
|
||||
struct weston_paint_node *pnode;
|
||||
|
||||
wl_list_for_each(pnode, &output->paint_node_z_order_list,
|
||||
z_order_link) {
|
||||
struct weston_surface *surface = pnode->surface;
|
||||
struct weston_buffer *buffer = surface->buffer_ref.buffer;
|
||||
|
||||
if (!buffer || buffer->type != WESTON_BUFFER_SHM)
|
||||
continue;
|
||||
|
||||
pixman_region32_t region;
|
||||
|
||||
pixman_region32_init_rect(®ion, 0, 0,
|
||||
buffer->width,
|
||||
buffer->height);
|
||||
pixman_region32_copy(&surface->damage, ®ion);
|
||||
ec->renderer->flush_damage(pnode);
|
||||
pixman_region32_fini(®ion);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue