xserver: Branch 'master' - 2 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Feb 6 10:52:00 UTC 2022


 config/meson.build  |    2 +-
 config/wscons.c     |   18 ++++++++++++++----
 include/meson.build |    1 +
 3 files changed, 16 insertions(+), 5 deletions(-)

New commits:
commit 9946b0f1992780c48305c45c0935e560e5c77dc5
Author: nia <nia at NetBSD.org>
Date:   Tue Dec 7 11:27:38 2021 +0100

    config/wscons: Always attach the "ws" driver for pointer devices,
    rather than "mouse".
    
    Both OpenBSD and NetBSD (the only downstream users of this code)
    are both patching in this currently.
    
    Signed-off-by: Nia Alarie <nia at NetBSD.org>

diff --git a/config/wscons.c b/config/wscons.c
index c0148f0e0..e9368be6a 100644
--- a/config/wscons.c
+++ b/config/wscons.c
@@ -253,8 +253,8 @@ wscons_add_pointers(void)
             break;
         }
     }
-    /* Add a default entry catching all other mux elements as "mouse" */
-    wscons_add_pointer(WSCONS_MOUSE_PREFIX, "mouse", ATTR_POINTER);
+    /* Add a default entry catching all other mux elements as pointers */
+    wscons_add_pointer(WSCONS_MOUSE_PREFIX, "ws", ATTR_POINTER);
 }
 
 int
commit bcee84c3e497bee3e76c3f02cdc9e7059efa87ce
Author: nia <nia at NetBSD.org>
Date:   Tue Dec 7 11:15:50 2021 +0100

    config/wscons: Fix build and add support for NetBSD
    
    Signed-off-by: Nia Alarie <nia at NetBSD.org>

diff --git a/config/meson.build b/config/meson.build
index 2b5ab18bb..db7c49346 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -19,7 +19,7 @@ if build_udev
     config_dep += udev_dep
 endif
 
-if host_machine.system() == 'openbsd'
+if host_machine.system() == 'netbsd' or host_machine.system() == 'openbsd'
     srcs_config += 'wscons.c'
 endif
 
diff --git a/config/wscons.c b/config/wscons.c
index ee4567590..c0148f0e0 100644
--- a/config/wscons.c
+++ b/config/wscons.c
@@ -30,6 +30,7 @@
 
 #include <sys/ioctl.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <string.h>
 #include <unistd.h>
 
@@ -54,7 +55,10 @@ struct nameint {
     char *name;
 } kbdenc[] = {
     KB_OVRENC,
-    KB_ENCTAB,
+    KB_ENCTAB
+#ifndef __NetBSD__
+    ,
+#endif
     {0}
 };
 
@@ -220,7 +224,11 @@ wscons_add_pointers(void)
     for (i = 0; i < 4; i++) {
         snprintf(devname, sizeof(devname), "%s%d", WSCONS_MOUSE_PREFIX, i);
         LogMessageVerb(X_INFO, 10, "wsmouse: checking %s\n", devname);
-        fd = open_device(devnamem O_RDWR | O_NONBLOCK | O_EXCL);
+#ifdef HAVE_OPEN_DEVICE
+        fd = open_device(devname, O_RDWR | O_NONBLOCK | O_EXCL);
+#else
+        fd = open(devname, O_RDWR | O_NONBLOCK | O_EXCL);
+#endif
         if (fd == -1) {
             LogMessageVerb(X_WARNING, 10, "%s: %s\n", devname, strerror(errno));
             continue;
@@ -233,9 +241,11 @@ wscons_add_pointers(void)
         }
         close(fd);
         switch (wsmouse_type) {
+#ifdef WSMOUSE_TYPE_SYNAPTICS
         case WSMOUSE_TYPE_SYNAPTICS:
             wscons_add_pointer(devname, "synaptics", ATTR_TOUCHPAD);
             break;
+#endif
         case WSMOUSE_TYPE_TPANEL:
             wscons_add_pointer(devname, "ws", ATTR_TOUCHSCREEN);
             break;
diff --git a/include/meson.build b/include/meson.build
index 309a5d5b0..21939c4ca 100644
--- a/include/meson.build
+++ b/include/meson.build
@@ -157,6 +157,7 @@ conf_data.set('HAVE_GETZONEID', cc.has_function('getzoneid') ? '1' : false)
 conf_data.set('HAVE_MEMFD_CREATE', cc.has_function('memfd_create') ? '1' : false)
 conf_data.set('HAVE_MKOSTEMP', cc.has_function('mkostemp') ? '1' : false)
 conf_data.set('HAVE_MMAP', cc.has_function('mmap') ? '1' : false)
+conf_data.set('HAVE_OPEN_DEVICE', cc.has_function('open_device') ? '1' : false)
 conf_data.set('HAVE_POLL', cc.has_function('poll') ? '1' : false)
 conf_data.set('HAVE_POLLSET_CREATE', cc.has_function('pollset_create') ? '1' : false)
 conf_data.set('HAVE_POSIX_FALLOCATE', cc.has_function('posix_fallocate') ? '1' : false)


More information about the xorg-commit mailing list