From 0afe96a4dd26aa41a79defbd4bc74e5e300b6ad2 Mon Sep 17 00:00:00 2001 From: John Sadler Date: Fri, 4 Sep 2015 15:03:32 +0100 Subject: [PATCH 2/4] rpi: fix segfault at startup in `rpi_flippipe_init()` due to NULL `compositor` When running with the RPi backend, Weston now segfaults at startup on the line: flippipe->clk_id = output->base.compositor->presentation_clock; in `rpi_flippipe_init()`. This is because `output->base.compositor` is NULL. This problem did not exist on 1.8.0, and it looks like it may have been introduced by 954f183e2f. This commit ensures that the `compositor` is initialised in `rpi_backend` and the output base, prior to the above function being called. --- src/compositor-rpi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compositor-rpi.c b/src/compositor-rpi.c index 602cbee..340a974 100644 --- a/src/compositor-rpi.c +++ b/src/compositor-rpi.c @@ -305,6 +305,7 @@ rpi_output_create(struct rpi_backend *backend, uint32_t transform) output->backend = backend; output->single_buffer = backend->single_buffer; + output->base.compositor = backend->compositor; if (rpi_flippipe_init(&output->flippipe, output) < 0) { weston_log("Creating message pipe failed.\n"); @@ -495,6 +496,7 @@ rpi_backend_create(struct weston_compositor *compositor, goto out_udev; } + backend->compositor = compositor; backend->base.destroy = rpi_backend_destroy; backend->base.restore = rpi_restore; -- 1.8.1.4