<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 18, 2014 at 9:12 AM, Fernando Herrera <span dir="ltr"><<a href="mailto:fherrera@onirica.com" target="_blank">fherrera@onirica.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Adds a --no-input option to the rpi backend so weston can be started<br>
without any input device attached. This is useful for display boxes<br>
without any keyboard/mouse attached<br></blockquote><div><br></div><div>Ok, maybe this is a silly question, but why are we requiring input devices on start-up at all? I agree that a --no-input option that explicitly disables input is potentially useful, but shouldn't weston be able to start up without input devices anyway? Also, It might be a good idea to think about making such an option global. I don't think making it global would be easy right now, but it's worth thinking about.<br>
<br></div><div>Other than that, the patch looks pretty good to me.<br></div><div>--Jason Ekstrand<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Signed-off-by: Fernando Herrera <<a href="mailto:fherrera@onirica.com">fherrera@onirica.com</a>><br>
---<br>
src/compositor-rpi.c | 29 ++++++++++++++++++-----------<br>
src/compositor.c | 1 +<br>
2 files changed, 19 insertions(+), 11 deletions(-)<br>
<br>
diff --git a/src/compositor-rpi.c b/src/compositor-rpi.c<br>
index 287451d..f39152d 100644<br>
--- a/src/compositor-rpi.c<br>
+++ b/src/compositor-rpi.c<br>
@@ -488,7 +488,8 @@ struct rpi_parameters {<br>
static struct weston_compositor *<br>
rpi_compositor_create(struct wl_display *display, int *argc, char *argv[],<br>
struct weston_config *config,<br>
- struct rpi_parameters *param)<br>
+ struct rpi_parameters *param,<br>
+ int no_input)<br>
{<br>
struct rpi_compositor *compositor;<br>
uint32_t key;<br>
@@ -503,10 +504,12 @@ rpi_compositor_create(struct wl_display *display, int *argc, char *argv[],<br>
config) < 0)<br>
goto out_free;<br>
<br>
- compositor->udev = udev_new();<br>
- if (compositor->udev == NULL) {<br>
- weston_log("Failed to initialize udev context.\n");<br>
- goto out_compositor;<br>
+ if (!no_input) {<br>
+ compositor->udev = udev_new();<br>
+ if (compositor->udev == NULL) {<br>
+ weston_log("Failed to initialize udev context.\n");<br>
+ goto out_compositor;<br>
+ }<br>
}<br>
<br>
compositor->session_listener.notify = session_notify;<br>
@@ -548,11 +551,13 @@ rpi_compositor_create(struct wl_display *display, int *argc, char *argv[],<br>
if (rpi_output_create(compositor, param->output_transform) < 0)<br>
goto out_renderer;<br>
<br>
- if (udev_input_init(&compositor->input,<br>
- &compositor->base,<br>
- compositor->udev, "seat0") != 0) {<br>
- weston_log("Failed to initialize udev input.\n");<br>
- goto out_renderer;<br>
+ if (!no_input) {<br>
+ if (udev_input_init(&compositor->input,<br>
+ &compositor->base,<br>
+ compositor->udev, "seat0") != 0) {<br>
+ weston_log("Failed to initialize udev input.\n");<br>
+ goto out_renderer;<br>
+ }<br>
}<br>
<br>
return &compositor->base;<br>
@@ -581,6 +586,7 @@ backend_init(struct wl_display *display, int *argc, char *argv[],<br>
struct weston_config *config)<br>
{<br>
const char *transform = "normal";<br>
+ int no_input;<br>
int ret;<br>
<br>
struct rpi_parameters param = {<br>
@@ -597,6 +603,7 @@ backend_init(struct wl_display *display, int *argc, char *argv[],<br>
{ WESTON_OPTION_STRING, "transform", 0, &transform },<br>
{ WESTON_OPTION_BOOLEAN, "opaque-regions", 0,<br>
¶m.renderer.opaque_regions },<br>
+ { WESTON_OPTION_BOOLEAN, "no-input", 0, &no_input },<br>
};<br>
<br>
parse_options(rpi_options, ARRAY_LENGTH(rpi_options), argc, argv);<br>
@@ -607,5 +614,5 @@ backend_init(struct wl_display *display, int *argc, char *argv[],<br>
else<br>
param.output_transform = ret;<br>
<br>
- return rpi_compositor_create(display, argc, argv, config, ¶m);<br>
+ return rpi_compositor_create(display, argc, argv, config, ¶m, no_input);<br>
}<br>
diff --git a/src/compositor.c b/src/compositor.c<br>
index 7c29d51..723a4f5 100644<br>
--- a/src/compositor.c<br>
+++ b/src/compositor.c<br>
@@ -3964,6 +3964,7 @@ usage(int error_code)<br>
"\tnormal 90 180 270 flipped flipped-90 flipped-180 flipped-270\n"<br>
" --opaque-regions\tEnable support for opaque regions, can be "<br>
"very slow without support in the GPU firmware.\n"<br>
+ " --no-input\t\tDont create input devices\n"<br>
"\n");<br>
#endif<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
1.7.10.4<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</font></span></blockquote></div><br></div></div>