compositor-rpi: Fix input initialization
The input initialization code assumes the outputs have already been initialized; thus create the outputs first. This fixes a segfault upon startup. It is also what the drm and fbdev backends do.
This commit is contained in:
committed by
Kristian Høgsberg
parent
c74ab15eac
commit
bf539e39c1
+8
-11
@@ -527,13 +527,6 @@ rpi_compositor_create(struct wl_display *display, int *argc, char *argv[],
|
|||||||
weston_log("Dispmanx planes are %s buffered.\n",
|
weston_log("Dispmanx planes are %s buffered.\n",
|
||||||
compositor->single_buffer ? "single" : "double");
|
compositor->single_buffer ? "single" : "double");
|
||||||
|
|
||||||
if (udev_input_init(&compositor->input,
|
|
||||||
&compositor->base,
|
|
||||||
compositor->udev, "seat0") != 0) {
|
|
||||||
weston_log("Failed to initialize udev input.\n");
|
|
||||||
goto out_launcher;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (key = KEY_F1; key < KEY_F9; key++)
|
for (key = KEY_F1; key < KEY_F9; key++)
|
||||||
weston_compositor_add_key_binding(&compositor->base, key,
|
weston_compositor_add_key_binding(&compositor->base, key,
|
||||||
MODIFIER_CTRL | MODIFIER_ALT,
|
MODIFIER_CTRL | MODIFIER_ALT,
|
||||||
@@ -549,19 +542,23 @@ rpi_compositor_create(struct wl_display *display, int *argc, char *argv[],
|
|||||||
bcm_host_init();
|
bcm_host_init();
|
||||||
|
|
||||||
if (rpi_renderer_create(&compositor->base, ¶m->renderer) < 0)
|
if (rpi_renderer_create(&compositor->base, ¶m->renderer) < 0)
|
||||||
goto out_udev_input;
|
goto out_launcher;
|
||||||
|
|
||||||
if (rpi_output_create(compositor, param->output_transform) < 0)
|
if (rpi_output_create(compositor, param->output_transform) < 0)
|
||||||
goto out_renderer;
|
goto out_renderer;
|
||||||
|
|
||||||
|
if (udev_input_init(&compositor->input,
|
||||||
|
&compositor->base,
|
||||||
|
compositor->udev, "seat0") != 0) {
|
||||||
|
weston_log("Failed to initialize udev input.\n");
|
||||||
|
goto out_renderer;
|
||||||
|
}
|
||||||
|
|
||||||
return &compositor->base;
|
return &compositor->base;
|
||||||
|
|
||||||
out_renderer:
|
out_renderer:
|
||||||
compositor->base.renderer->destroy(&compositor->base);
|
compositor->base.renderer->destroy(&compositor->base);
|
||||||
|
|
||||||
out_udev_input:
|
|
||||||
udev_input_destroy(&compositor->input);
|
|
||||||
|
|
||||||
out_launcher:
|
out_launcher:
|
||||||
weston_launcher_destroy(compositor->base.launcher);
|
weston_launcher_destroy(compositor->base.launcher);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user