[PATCH weston] fbdev-backend: Support being launched from weston-launch

Adrian M Negreanu groleo at gmail.com
Sun Jul 28 08:40:58 PDT 2013


On Sun, Jul 28, 2013 at 5:36 PM, nerdopolis
<bluescreen_avenger at verizon.net> wrote:
> From: n3rdopolis <bluescreen_avenger at verizon.net>
>
> This allows the fbdev-backend to be run from weston-launch, and have privileges to the input devices, similar to the drm-backend.

Hi,

I've just submitted a patch for this :).


> ---
>  src/compositor-fbdev.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
> index 9c3d17e..5856675 100644
> --- a/src/compositor-fbdev.c
> +++ b/src/compositor-fbdev.c
> @@ -833,6 +833,15 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[],
>                                    config) < 0)
>                 goto out_free;
>
> +       /* Check if we run fbdev-backend using weston-launch */
> +       compositor->base.launcher_sock =
> +               weston_environment_get_fd("WESTON_LAUNCHER_SOCK");
> +       if (compositor->base.launcher_sock == -1 && geteuid() != 0) {
> +               weston_log("fatal: drm backend should be run "
> +                          "using weston-launch binary or as root\n");
> +               goto err_compositor;
goto out_compositor should do it too


> +       }
> +
>         compositor->udev = udev_new();
>         if (compositor->udev == NULL) {
>                 weston_log("Failed to initialize udev context.\n");
> @@ -880,6 +889,9 @@ out_udev:
>  out_compositor:
>         weston_compositor_shutdown(&compositor->base);
>
> +err_compositor:
> +       weston_compositor_shutdown(&compositor->base);
> +
>  out_free:
>         free(compositor);
>
> --
> 1.8.1.2
>
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel



-- 
Regards!
http://groleo.wordpress.com


More information about the wayland-devel mailing list