Skip to content
Snippets Groups Projects
Commit acd71fb0 authored by Pekka Paalanen's avatar Pekka Paalanen
Browse files

compositor-fbdev: fix start-up assertion

Fixes the failure to start with fbdev-backend:

weston: /home/pq/git/weston/libweston/compositor.c:4733: weston_compositor_add_pending_output: Assertion `output->disable' failed.

The disable hook was completely unimplemented, and the regression was
caused by e952a01c
"libweston: move asserts to add_pending_output()".
It used to work because Weston never tried to explicitly disable the
fbdev output, but now it is hitting the assert.

Fix it by tentatively implementing a disable hook. It has not been
tested to work for explicit disabling, but it does solve the regression.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=102208


Cc: bluescreen_avenger@verizon.net
Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: default avatarArmin Krezović <krezovic.armin@gmail.com>
Tested-by: default avatarn3rdopolis <bluescreen_avenger@verizon.net>
parent 167bbb6d
No related branches found
No related tags found
No related merge requests found
...@@ -472,6 +472,21 @@ out_hw_surface: ...@@ -472,6 +472,21 @@ out_hw_surface:
return -1; return -1;
} }
static int
fbdev_output_disable_handler(struct weston_output *base)
{
if (!base->enabled)
return 0;
/* Close the frame buffer. */
fbdev_output_disable(base);
if (base->renderer_state != NULL)
pixman_renderer_output_destroy(base);
return 0;
}
static int static int
fbdev_output_create(struct fbdev_backend *backend, fbdev_output_create(struct fbdev_backend *backend,
const char *device) const char *device)
...@@ -497,7 +512,7 @@ fbdev_output_create(struct fbdev_backend *backend, ...@@ -497,7 +512,7 @@ fbdev_output_create(struct fbdev_backend *backend,
output->base.name = strdup("fbdev"); output->base.name = strdup("fbdev");
output->base.destroy = fbdev_output_destroy; output->base.destroy = fbdev_output_destroy;
output->base.disable = NULL; output->base.disable = fbdev_output_disable_handler;
output->base.enable = fbdev_output_enable; output->base.enable = fbdev_output_enable;
weston_output_init(&output->base, backend->compositor); weston_output_init(&output->base, backend->compositor);
...@@ -539,11 +554,7 @@ fbdev_output_destroy(struct weston_output *base) ...@@ -539,11 +554,7 @@ fbdev_output_destroy(struct weston_output *base)
weston_log("Destroying fbdev output.\n"); weston_log("Destroying fbdev output.\n");
/* Close the frame buffer. */ fbdev_output_disable_handler(base);
fbdev_output_disable(base);
if (base->renderer_state != NULL)
pixman_renderer_output_destroy(base);
/* Remove the output. */ /* Remove the output. */
weston_output_destroy(&output->base); weston_output_destroy(&output->base);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment