summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMisha Gusarov <dottedmag@dottedmag.net>2021-01-27 12:37:51 +0000
committerOlivier Fourdan <fourdan@gmail.com>2021-01-29 10:02:14 +0000
commit4341f1da728e4c67187b48865faf06c1312bcdff (patch)
tree49d1fc2acf0e4dbbe870ec2971241fc7a4dc15b3
parent0148a15da1616a868d71abe1b56e3f28cc79533c (diff)
xwayland: Add -verbose option as in xfree86
Makes it easier to debug Xwayland problems. Signed-off-by: Misha Gusarov <dottedmag@dottedmag.net>
-rw-r--r--hw/xwayland/man/Xwayland.man9
-rw-r--r--hw/xwayland/xwayland.c17
-rw-r--r--hw/xwayland/xwayland.pc.in1
3 files changed, 27 insertions, 0 deletions
diff --git a/hw/xwayland/man/Xwayland.man b/hw/xwayland/man/Xwayland.man
index c5e59c365..a3e04c74b 100644
--- a/hw/xwayland/man/Xwayland.man
+++ b/hw/xwayland/man/Xwayland.man
@@ -75,6 +75,15 @@ to be an X window manager as well.
Force the shared memory backend instead of glamor (if available) for passing
buffers to the Wayland server.
.TP 8
+.BR \-verbose " [\fIn\fP]"
+Sets the verbosity level for information printed on stderr. If the
+.I n
+value isn't supplied, each occurrence of this option increments the
+verbosity level. When the
+.I n
+value is supplied, the verbosity level is set to that value. The default
+verbosity level is 0.
+.TP 8
.BI \-version
Show the server version and exit.
.TP 8
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 9fc3db976..b11e2020c 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -93,6 +93,7 @@ ddxUseMsg(void)
ErrorF("-eglstream use eglstream backend for nvidia GPUs\n");
#endif
ErrorF("-shm use shared memory for passing buffers\n");
+ ErrorF("-verbose [n] verbose startup messages\n");
ErrorF("-version show the server version and exit\n");
}
@@ -100,6 +101,7 @@ static int init_fd = -1;
static int wm_fd = -1;
static int listen_fds[5] = { -1, -1, -1, -1, -1 };
static int listen_fd_count = 0;
+static int verbosity = 0;
static void
xwl_show_version(void)
@@ -161,6 +163,21 @@ ddxProcessArgument(int argc, char *argv[], int i)
else if (strcmp(argv[i], "-shm") == 0) {
return 1;
}
+ else if (strcmp(argv[i], "-verbose") == 0) {
+ if (++i < argc && argv[i]) {
+ char *end;
+ long val;
+
+ val = strtol(argv[i], &end, 0);
+ if (*end == '\0') {
+ verbosity = val;
+ LogSetParameter(XLOG_VERBOSITY, verbosity);
+ return 2;
+ }
+ }
+ LogSetParameter(XLOG_VERBOSITY, ++verbosity);
+ return 1;
+ }
else if (strcmp(argv[i], "-eglstream") == 0) {
return 1;
}
diff --git a/hw/xwayland/xwayland.pc.in b/hw/xwayland/xwayland.pc.in
index b82a4fd56..c42435fb7 100644
--- a/hw/xwayland/xwayland.pc.in
+++ b/hw/xwayland/xwayland.pc.in
@@ -6,3 +6,4 @@ have_glamor=@have_glamor@
have_eglstream=@have_eglstream@
have_initfd=true
have_listenfd=true
+have_verbose=true