backend-x11: create renderbuffer when pixman output state already exists

Reorder pixman renderer output state and SHM renderbuffer creation and
removal to make sure the pixman renderbuffer list is empty when the
output state is destroyed.

Fixes: 4d96635a3f ("pixman-renderer: track damage in weston_renderbuffer")
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
This commit is contained in:
Philipp Zabel 2023-01-29 13:44:37 +01:00 committed by Marius Vlad
parent 918ec64f6a
commit a222ce03c7

View File

@ -899,8 +899,8 @@ x11_output_disable(struct weston_output *base)
wl_event_source_remove(output->finish_frame_timer);
if (renderer->type == WESTON_RENDERER_PIXMAN) {
renderer->pixman->output_destroy(&output->base);
x11_output_deinit_shm(backend, output);
renderer->pixman->output_destroy(&output->base);
} else {
renderer->gl->output_destroy(&output->base);
}
@ -1042,14 +1042,14 @@ x11_output_enable(struct weston_output *base)
},
.format = pixel_format_get_info_by_pixman(PIXMAN_x8r8g8b8)
};
if (renderer->pixman->output_create(&output->base, &options) < 0) {
weston_log("Failed to create pixman renderer for output\n");
goto err;
}
if (x11_output_init_shm(b, output,
mode->width, mode->height) < 0) {
weston_log("Failed to initialize SHM for the X11 output\n");
goto err;
}
if (renderer->pixman->output_create(&output->base, &options) < 0) {
weston_log("Failed to create pixman renderer for output\n");
x11_output_deinit_shm(b, output);
renderer->pixman->output_destroy(&output->base);
goto err;
}