pixman-render: Keeping a weston_buffer ref alive with the underlying shm buffer gone (on fade out views)
With patch "weston_buffer: Hold lifetime for resource/backend usage" (7e904330) weston_buffer_destroy_handler()
which now marks buffer->shm_buffer = NULL
, causes a side-effect
in repaint_region()
.
As the reference is still alive, but with its shm_buffer long gone, it will obviously fail. It doesn't appear to be sufficient to add an additional check when accessing the shm_buffer. As the shm_buffer is no longer available, it would fail at the next composite_* function. So ignoring the output repaint altogether seem to help, but wonder if this is really a correct fix.
Something like the following:
diff --git a/libweston/pixman-renderer.c b/libweston/pixman-renderer.c
index 636d9d91..b7f54ac0 100644
--- a/libweston/pixman-renderer.c
+++ b/libweston/pixman-renderer.c
@@ -335,6 +335,9 @@ repaint_region(struct weston_view *ev, struct weston_output *output,
pixman_image_t *mask_image;
pixman_color_t mask = { 0, };
+ if (ps->buffer_ref.buffer && !ps->buffer_ref.buffer->shm_buffer)
+ return;
+
Haven't observed this with close-animation=none
which might reveal why the reference is still alive but its buffer gone.