<div dir="ltr">This removal breaks my Xephyr-based single-GPU multi-seat setup :-(<div><br></div><div>Anyway, Xephyr never was my preferred options for such a setup, but I simply have no other choice (at least until xf86-video-nested gets revived). I'm currently working on a xf86-video-nested fork at GitHub and I would like to submit a patch series upstream (if someone could review/apply it).</div><div><br></div><div>When/If I can get xf86-video-nested working properly, then you could even revert that input hot-plugging suport I've introduced in kdrive/Xephyr (without kdrive-evdev, it's completely useless).</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-02-16 15:46 GMT-02:00 Adam Jackson <span dir="ltr"><<a href="mailto:ajax@redhat.com" target="_blank">ajax@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">With Xfbdev gone this has no consumers.<br>
<br>
Signed-off-by: Adam Jackson <<a href="mailto:ajax@redhat.com">ajax@redhat.com</a>><br>
---<br>
<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> | 44 ----<br>
hw/kdrive/Makefile.am | 7 +-<br>
hw/kdrive/linux/Makefile.am | 19 --<br>
hw/kdrive/linux/evdev.c | 530 ------------------------------<wbr>--------------<br>
hw/kdrive/linux/linux.c | 347 -----------------------------<br>
hw/kdrive/linux/tslib.c | 194 ----------------<br>
6 files changed, 1 insertion(+), 1140 deletions(-)<br>
delete mode 100644 hw/kdrive/linux/Makefile.am<br>
delete mode 100644 hw/kdrive/linux/evdev.c<br>
delete mode 100644 hw/kdrive/linux/linux.c<br>
delete mode 100644 hw/kdrive/linux/tslib.c<br>
<br>
diff --git a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
index da00d88..d652c86 100644<br>
--- a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
+++ b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
@@ -656,7 +656,6 @@ dnl kdrive and its subsystems<br>
AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-<wbr>kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no])<br>
AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-<wbr>xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto])<br>
dnl kdrive options<br>
-AC_ARG_ENABLE(kdrive-evdev, AS_HELP_STRING([--enable-<wbr>kdrive-evdev], [Build evdev driver for kdrive (default: auto)]), [KDRIVE_EVDEV=$enableval], [KDRIVE_EVDEV=auto])<br>
AC_ARG_ENABLE(libunwind, AS_HELP_STRING([--enable-<wbr>libunwind], [Use libunwind for backtracing (default: auto)]), [LIBUNWIND="$enableval"], [LIBUNWIND="auto"])<br>
AC_ARG_ENABLE(xshmfence, AS_HELP_STRING([--disable-<wbr>xshmfence], [Disable xshmfence (default: auto)]), [XSHMFENCE="$enableval"], [XSHMFENCE="auto"])<br>
<br>
@@ -2366,45 +2365,6 @@ if test "$KDRIVE" = yes; then<br>
AC_DEFINE(KDRIVESERVER,1,[<wbr>Build Kdrive X server])<br>
AC_DEFINE(KDRIVEDDXACTIONS,,[<wbr>Build kdrive ddx])<br>
<br>
- PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [HAVE_TSLIB="yes"], [HAVE_TSLIB="no"])<br>
- if test "x$HAVE_TSLIB" = xno; then<br>
- AC_CHECK_LIB(ts, ts_open, [<br>
- HAVE_TSLIB="yes"<br>
- TSLIB_LIBS="-lts"<br>
- ])<br>
- fi<br>
-<br>
- if test "xTSLIB" = xauto; then<br>
- TSLIB="$HAVE_TSLIB"<br>
- fi<br>
-<br>
- if test "x$TSLIB" = xyes; then<br>
- if ! test "x$HAVE_TSLIB" = xyes; then<br>
- AC_MSG_ERROR([tslib must be installed to build the tslib driver. See <a href="http://tslib.berlios.de/" rel="noreferrer" target="_blank">http://tslib.berlios.de/</a>])<br>
- else<br>
- AC_DEFINE(TSLIB, 1, [Have tslib support])<br>
- fi<br>
- fi<br>
-<br>
- case $host_os in<br>
- *linux*)<br>
- KDRIVE_OS_LIB='$(top_builddir)<wbr>/hw/kdrive/linux/<a href="http://liblinux.la" rel="noreferrer" target="_blank">liblinux.la</a>'<br>
- KDRIVELINUX=yes<br>
- if test "x$KDRIVE_EVDEV" = xauto; then<br>
- KDRIVE_EVDEV=yes<br>
- fi<br>
- ;;<br>
- *)<br>
- if test "x$KDRIVE_EVDEV" = xauto; then<br>
- KDRIVE_EVDEV=no<br>
- fi<br>
- ;;<br>
- esac<br>
-<br>
- if test "x$KDRIVE_EVDEV" = xyes; then<br>
- AC_DEFINE(KDRIVE_EVDEV, 1, [Enable KDrive evdev driver])<br>
- fi<br>
-<br>
XEPHYR_REQUIRED_LIBS="xau xdmcp xcb xcb-shape xcb-render xcb-renderutil xcb-aux xcb-image xcb-icccm xcb-shm xcb-keysyms xcb-randr xcb-xkb"<br>
if test "x$XV" = xyes; then<br>
XEPHYR_REQUIRED_LIBS="$XEPHYR_<wbr>REQUIRED_LIBS xcb-xv"<br>
@@ -2452,9 +2412,6 @@ AC_SUBST([KDRIVE_PURE_LIBS])<br>
AC_SUBST([KDRIVE_MAIN_LIB])<br>
AC_SUBST([KDRIVE_LOCAL_LIBS])<br>
AC_SUBST([KDRIVE_LIBS])<br>
-AM_CONDITIONAL(KDRIVELINUX, [test "x$KDRIVELINUX" = xyes])<br>
-AM_CONDITIONAL(KDRIVE_EVDEV, [test "x$KDRIVE_EVDEV" = xyes])<br>
-AM_CONDITIONAL(TSLIB, [test "x$HAVE_TSLIB" = xyes])<br>
AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes])<br>
<br>
dnl Xwayland DDX<br>
@@ -2636,7 +2593,6 @@ hw/xquartz/xpr/Makefile<br>
hw/kdrive/Makefile<br>
hw/kdrive/ephyr/Makefile<br>
hw/kdrive/ephyr/man/Makefile<br>
-hw/kdrive/linux/Makefile<br>
hw/kdrive/src/Makefile<br>
hw/xwayland/Makefile<br>
test/Makefile<br>
diff --git a/hw/kdrive/Makefile.am b/hw/kdrive/Makefile.am<br>
index de30e51..dc71dbd 100644<br>
--- a/hw/kdrive/Makefile.am<br>
+++ b/hw/kdrive/Makefile.am<br>
@@ -2,19 +2,14 @@ if XEPHYR<br>
XEPHYR_SUBDIRS = ephyr<br>
endif<br>
<br>
-if KDRIVELINUX<br>
-LINUX_SUBDIRS = linux<br>
-endif<br>
-<br>
SERVER_SUBDIRS = \<br>
$(XEPHYR_SUBDIRS)<br>
<br>
SUBDIRS = \<br>
src \<br>
- $(LINUX_SUBDIRS) \<br>
$(SERVER_SUBDIRS)<br>
<br>
-DIST_SUBDIRS = ephyr src linux<br>
+DIST_SUBDIRS = ephyr src<br>
<br>
relink:<br>
$(AM_V_at)for i in $(SERVER_SUBDIRS) ; do $(MAKE) -C $$i relink || exit 1 ; done<br>
diff --git a/hw/kdrive/linux/Makefile.am b/hw/kdrive/linux/Makefile.am<br>
deleted file mode 100644<br>
index 97c600c..0000000<br>
--- a/hw/kdrive/linux/Makefile.am<br>
+++ /dev/null<br>
@@ -1,19 +0,0 @@<br>
-AM_CPPFLAGS = \<br>
- @KDRIVE_INCS@ \<br>
- @KDRIVE_CFLAGS@<br>
-<br>
-AM_CFLAGS = -DHAVE_DIX_CONFIG_H<br>
-<br>
-noinst_LTLIBRARIES = <a href="http://liblinux.la" rel="noreferrer" target="_blank">liblinux.la</a><br>
-<br>
-liblinux_la_SOURCES =<br>
-<br>
-liblinux_la_SOURCES += linux.c<br>
-<br>
-if KDRIVE_EVDEV<br>
-liblinux_la_SOURCES += evdev.c<br>
-endif<br>
-<br>
-if TSLIB<br>
-liblinux_la_SOURCES += tslib.c<br>
-endif<br>
diff --git a/hw/kdrive/linux/evdev.c b/hw/kdrive/linux/evdev.c<br>
deleted file mode 100644<br>
index 9590413..0000000<br>
--- a/hw/kdrive/linux/evdev.c<br>
+++ /dev/null<br>
@@ -1,530 +0,0 @@<br>
-/*<br>
- * Copyright © 2004 Keith Packard<br>
- *<br>
- * Permission to use, copy, modify, distribute, and sell this software and its<br>
- * documentation for any purpose is hereby granted without fee, provided that<br>
- * the above copyright notice appear in all copies and that both that<br>
- * copyright notice and this permission notice appear in supporting<br>
- * documentation, and that the name of Keith Packard not be used in<br>
- * advertising or publicity pertaining to distribution of the software without<br>
- * specific, written prior permission. Keith Packard makes no<br>
- * representations about the suitability of this software for any purpose. It<br>
- * is provided "as is" without express or implied warranty.<br>
- *<br>
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,<br>
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO<br>
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR<br>
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,<br>
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER<br>
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR<br>
- * PERFORMANCE OF THIS SOFTWARE.<br>
- */<br>
-<br>
-#ifdef HAVE_CONFIG_H<br>
-#include <kdrive-config.h><br>
-#endif<br>
-#include <errno.h><br>
-#include <linux/input.h><br>
-#include <X11/X.h><br>
-#include <X11/Xproto.h><br>
-#include "inputstr.h"<br>
-#include "scrnintstr.h"<br>
-#include "kdrive.h"<br>
-<br>
-#define NUM_EVENTS 128<br>
-#define ABS_UNSET -65535<br>
-<br>
-#define BITS_PER_LONG (sizeof(long) * 8)<br>
-#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)<br>
-#define ISBITSET(x,y) ((x)[LONG(y)] & BIT(y))<br>
-#define OFF(x) ((x)%BITS_PER_LONG)<br>
-#define LONG(x) ((x)/BITS_PER_LONG)<br>
-#define BIT(x) (1 << OFF(x))<br>
-<br>
-typedef struct _kevdev {<br>
- /* current device state */<br>
- int rel[REL_MAX + 1];<br>
- int abs[ABS_MAX + 1];<br>
- int prevabs[ABS_MAX + 1];<br>
- long key[NBITS(KEY_MAX + 1)];<br>
-<br>
- /* supported device info */<br>
- long relbits[NBITS(REL_MAX + 1)];<br>
- long absbits[NBITS(ABS_MAX + 1)];<br>
- long keybits[NBITS(KEY_MAX + 1)];<br>
- struct input_absinfo absinfo[ABS_MAX + 1];<br>
- int max_rel;<br>
- int max_abs;<br>
-<br>
- int fd;<br>
-} Kevdev;<br>
-<br>
-static void<br>
-EvdevPtrBtn(KdPointerInfo * pi, struct input_event *ev)<br>
-{<br>
- int flags = KD_MOUSE_DELTA | pi->buttonState;<br>
-<br>
- if (ev->code >= BTN_MOUSE && ev->code < BTN_JOYSTICK) {<br>
- switch (ev->code) {<br>
- case BTN_LEFT:<br>
- if (ev->value == 1)<br>
- flags |= KD_BUTTON_1;<br>
- else<br>
- flags &= ~KD_BUTTON_1;<br>
- break;<br>
- case BTN_MIDDLE:<br>
- if (ev->value == 1)<br>
- flags |= KD_BUTTON_2;<br>
- else<br>
- flags &= ~KD_BUTTON_2;<br>
- break;<br>
- case BTN_RIGHT:<br>
- if (ev->value == 1)<br>
- flags |= KD_BUTTON_3;<br>
- else<br>
- flags &= ~KD_BUTTON_3;<br>
- break;<br>
- default:<br>
- /* Unknow button */<br>
- break;<br>
- }<br>
-<br>
- KdEnqueuePointerEvent(pi, flags, 0, 0, 0);<br>
- }<br>
-}<br>
-<br>
-static void<br>
-EvdevPtrMotion(KdPointerInfo * pi, struct input_event *ev)<br>
-{<br>
- Kevdev *ke = pi->driverPrivate;<br>
- int i;<br>
- int flags = KD_MOUSE_DELTA | pi->buttonState;<br>
-<br>
- for (i = 0; i <= ke->max_rel; i++)<br>
- if (ke->rel[i]) {<br>
- int a;<br>
-<br>
- for (a = 0; a <= ke->max_rel; a++) {<br>
- if (ISBITSET(ke->relbits, a)) {<br>
- if (a == 0)<br>
- KdEnqueuePointerEvent(pi, flags, ke->rel[a], 0, 0);<br>
- else if (a == 1)<br>
- KdEnqueuePointerEvent(pi, flags, 0, ke->rel[a], 0);<br>
- }<br>
- ke->rel[a] = 0;<br>
- }<br>
- break;<br>
- }<br>
- for (i = 0; i < ke->max_abs; i++)<br>
- if (ke->abs[i] != ke->prevabs[i]) {<br>
- int a;<br>
-<br>
- ErrorF("abs");<br>
- for (a = 0; a <= ke->max_abs; a++) {<br>
- if (ISBITSET(ke->absbits, a))<br>
- ErrorF(" %d=%d", a, ke->abs[a]);<br>
- ke->prevabs[a] = ke->abs[a];<br>
- }<br>
- ErrorF("\n");<br>
- break;<br>
- }<br>
-<br>
- if (ev->code == REL_WHEEL) {<br>
- for (i = 0; i < abs(ev->value); i++) {<br>
- if (ev->value > 0)<br>
- flags |= KD_BUTTON_4;<br>
- else<br>
- flags |= KD_BUTTON_5;<br>
-<br>
- KdEnqueuePointerEvent(pi, flags, 0, 0, 0);<br>
-<br>
- if (ev->value > 0)<br>
- flags &= ~KD_BUTTON_4;<br>
- else<br>
- flags &= ~KD_BUTTON_5;<br>
-<br>
- KdEnqueuePointerEvent(pi, flags, 0, 0, 0);<br>
- }<br>
- }<br>
-<br>
-}<br>
-<br>
-static void<br>
-EvdevPtrRead(int evdevPort, void *closure)<br>
-{<br>
- KdPointerInfo *pi = closure;<br>
- Kevdev *ke = pi->driverPrivate;<br>
- int i;<br>
- struct input_event events[NUM_EVENTS];<br>
- int n;<br>
-<br>
- n = read(evdevPort, &events, NUM_EVENTS * sizeof(struct input_event));<br>
- if (n <= 0) {<br>
- if (errno == ENODEV)<br>
- DeleteInputDeviceRequest(pi-><wbr>dixdev);<br>
- return;<br>
- }<br>
-<br>
- n /= sizeof(struct input_event);<br>
- for (i = 0; i < n; i++) {<br>
- switch (events[i].type) {<br>
- case EV_SYN:<br>
- break;<br>
- case EV_KEY:<br>
- EvdevPtrBtn(pi, &events[i]);<br>
- break;<br>
- case EV_REL:<br>
- ke->rel[events[i].code] += events[i].value;<br>
- EvdevPtrMotion(pi, &events[i]);<br>
- break;<br>
- case EV_ABS:<br>
- ke->abs[events[i].code] = events[i].value;<br>
- EvdevPtrMotion(pi, &events[i]);<br>
- break;<br>
- }<br>
- }<br>
-}<br>
-<br>
-const char *kdefaultEvdev[] = {<br>
- "/dev/input/event0",<br>
- "/dev/input/event1",<br>
- "/dev/input/event2",<br>
- "/dev/input/event3",<br>
-};<br>
-<br>
-#define NUM_DEFAULT_EVDEV (sizeof (kdefaultEvdev) / sizeof (kdefaultEvdev[0]))<br>
-<br>
-static Status<br>
-EvdevPtrInit(KdPointerInfo * pi)<br>
-{<br>
- int i;<br>
- int fd;<br>
-<br>
- if (!pi->path) {<br>
- for (i = 0; i < NUM_DEFAULT_EVDEV; i++) {<br>
- fd = open(kdefaultEvdev[i], 2);<br>
- if (fd >= 0) {<br>
- pi->path = strdup(kdefaultEvdev[i]);<br>
- break;<br>
- }<br>
- }<br>
- }<br>
- else {<br>
- fd = open(pi->path, O_RDWR);<br>
- if (fd < 0) {<br>
- ErrorF("Failed to open evdev device %s\n", pi->path);<br>
- return BadMatch;<br>
- }<br>
- }<br>
-<br>
- close(fd);<br>
-<br>
- if (!pi->name)<br>
- pi->name = strdup("Evdev mouse");<br>
-<br>
- return Success;<br>
-}<br>
-<br>
-static Status<br>
-EvdevPtrEnable(KdPointerInfo * pi)<br>
-{<br>
- int fd;<br>
- unsigned long ev[NBITS(EV_MAX)];<br>
- Kevdev *ke;<br>
-<br>
- if (!pi || !pi->path)<br>
- return BadImplementation;<br>
-<br>
- fd = open(pi->path, 2);<br>
- if (fd < 0)<br>
- return BadMatch;<br>
-<br>
- if (ioctl(fd, EVIOCGRAB, 1) < 0)<br>
- perror("Grabbing evdev mouse device failed");<br>
-<br>
- if (ioctl(fd, EVIOCGBIT(0 /*EV*/, sizeof(ev)), ev) < 0) {<br>
- perror("EVIOCGBIT 0");<br>
- close(fd);<br>
- return BadMatch;<br>
- }<br>
- ke = calloc(1, sizeof(Kevdev));<br>
- if (!ke) {<br>
- close(fd);<br>
- return BadAlloc;<br>
- }<br>
- if (ISBITSET(ev, EV_KEY)) {<br>
- if (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(ke->keybits)), ke->keybits) < 0) {<br>
- perror("EVIOCGBIT EV_KEY");<br>
- free(ke);<br>
- close(fd);<br>
- return BadMatch;<br>
- }<br>
- }<br>
- if (ISBITSET(ev, EV_REL)) {<br>
- if (ioctl(fd, EVIOCGBIT(EV_REL, sizeof(ke->relbits)), ke->relbits) < 0) {<br>
- perror("EVIOCGBIT EV_REL");<br>
- free(ke);<br>
- close(fd);<br>
- return BadMatch;<br>
- }<br>
- for (ke->max_rel = REL_MAX; ke->max_rel >= 0; ke->max_rel--)<br>
- if (ISBITSET(ke->relbits, ke->max_rel))<br>
- break;<br>
- }<br>
- if (ISBITSET(ev, EV_ABS)) {<br>
- int i;<br>
-<br>
- if (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(ke->absbits)), ke->absbits) < 0) {<br>
- perror("EVIOCGBIT EV_ABS");<br>
- free(ke);<br>
- close(fd);<br>
- return BadMatch;<br>
- }<br>
- for (ke->max_abs = ABS_MAX; ke->max_abs >= 0; ke->max_abs--)<br>
- if (ISBITSET(ke->absbits, ke->max_abs))<br>
- break;<br>
- for (i = 0; i <= ke->max_abs; i++) {<br>
- if (ISBITSET(ke->absbits, i))<br>
- if (ioctl(fd, EVIOCGABS(i), &ke->absinfo[i]) < 0) {<br>
- perror("EVIOCGABS");<br>
- break;<br>
- }<br>
- ke->prevabs[i] = ABS_UNSET;<br>
- }<br>
- if (i <= ke->max_abs) {<br>
- free(ke);<br>
- close(fd);<br>
- return BadValue;<br>
- }<br>
- }<br>
- if (!KdRegisterFd(fd, EvdevPtrRead, pi)) {<br>
- free(ke);<br>
- close(fd);<br>
- return BadAlloc;<br>
- }<br>
- pi->driverPrivate = ke;<br>
- ke->fd = fd;<br>
-<br>
- return Success;<br>
-}<br>
-<br>
-static void<br>
-EvdevPtrDisable(KdPointerInfo * pi)<br>
-{<br>
- Kevdev *ke;<br>
-<br>
- ke = pi->driverPrivate;<br>
-<br>
- if (!pi || !pi->driverPrivate)<br>
- return;<br>
-<br>
- KdUnregisterFd(pi, ke->fd, TRUE);<br>
-<br>
- if (ioctl(ke->fd, EVIOCGRAB, 0) < 0)<br>
- perror("Ungrabbing evdev mouse device failed");<br>
-<br>
- free(ke);<br>
- pi->driverPrivate = 0;<br>
-}<br>
-<br>
-static void<br>
-EvdevPtrFini(KdPointerInfo * pi)<br>
-{<br>
-}<br>
-<br>
-/*<br>
- * Evdev keyboard functions<br>
- */<br>
-<br>
-static void<br>
-readMapping(KdKeyboardInfo * ki)<br>
-{<br>
- if (!ki)<br>
- return;<br>
-<br>
- ki->minScanCode = 0;<br>
- ki->maxScanCode = 247;<br>
-}<br>
-<br>
-static void<br>
-EvdevKbdRead(int evdevPort, void *closure)<br>
-{<br>
- KdKeyboardInfo *ki = closure;<br>
- struct input_event events[NUM_EVENTS];<br>
- int i, n;<br>
-<br>
- n = read(evdevPort, &events, NUM_EVENTS * sizeof(struct input_event));<br>
- if (n <= 0) {<br>
- if (errno == ENODEV)<br>
- DeleteInputDeviceRequest(ki-><wbr>dixdev);<br>
- return;<br>
- }<br>
-<br>
- n /= sizeof(struct input_event);<br>
- for (i = 0; i < n; i++) {<br>
- if (events[i].type == EV_KEY)<br>
- KdEnqueueKeyboardEvent(ki, events[i].code, !events[i].value);<br>
-/* FIXME: must implement other types of events<br>
- else<br>
- ErrorF("Event type (%d) not delivered\n", events[i].type);<br>
-*/<br>
- }<br>
-}<br>
-<br>
-static Status<br>
-EvdevKbdInit(KdKeyboardInfo * ki)<br>
-{<br>
- int fd;<br>
-<br>
- if (!ki->path) {<br>
- ErrorF("Couldn't find evdev device path\n");<br>
- return BadValue;<br>
- }<br>
- else {<br>
- fd = open(ki->path, O_RDWR);<br>
- if (fd < 0) {<br>
- ErrorF("Failed to open evdev device %s\n", ki->path);<br>
- return BadMatch;<br>
- }<br>
- }<br>
-<br>
- close(fd);<br>
-<br>
- if (!ki->name)<br>
- ki->name = strdup("Evdev keyboard");<br>
-<br>
- readMapping(ki);<br>
-<br>
- return Success;<br>
-}<br>
-<br>
-static Status<br>
-EvdevKbdEnable(KdKeyboardInfo * ki)<br>
-{<br>
- unsigned long ev[NBITS(EV_MAX)];<br>
- Kevdev *ke;<br>
- int fd;<br>
-<br>
- if (!ki || !ki->path)<br>
- return BadImplementation;<br>
-<br>
- fd = open(ki->path, O_RDWR);<br>
- if (fd < 0)<br>
- return BadMatch;<br>
-<br>
- if (ioctl(fd, EVIOCGRAB, 1) < 0)<br>
- perror("Grabbing evdev keyboard device failed");<br>
-<br>
- if (ioctl(fd, EVIOCGBIT(0 /*EV*/, sizeof(ev)), ev) < 0) {<br>
- perror("EVIOCGBIT 0");<br>
- close(fd);<br>
- return BadMatch;<br>
- }<br>
-<br>
- ke = calloc(1, sizeof(Kevdev));<br>
- if (!ke) {<br>
- close(fd);<br>
- return BadAlloc;<br>
- }<br>
-<br>
- if (!KdRegisterFd(fd, EvdevKbdRead, ki)) {<br>
- free(ke);<br>
- close(fd);<br>
- return BadAlloc;<br>
- }<br>
- ki->driverPrivate = ke;<br>
- ke->fd = fd;<br>
-<br>
- return Success;<br>
-}<br>
-<br>
-static void<br>
-EvdevKbdLeds(KdKeyboardInfo * ki, int leds)<br>
-{<br>
- struct input_event event;<br>
- Kevdev *ke;<br>
- int i;<br>
-<br>
- if (!ki)<br>
- return;<br>
-<br>
- ke = ki->driverPrivate;<br>
-<br>
- if (!ke)<br>
- return;<br>
-<br>
- memset(&event, 0, sizeof(event));<br>
-<br>
- event.type = EV_LED;<br>
- event.code = LED_CAPSL;<br>
- event.value = leds & (1 << 0) ? 1 : 0;<br>
- i = write(ke->fd, (char *) &event, sizeof(event));<br>
- (void) i;<br>
-<br>
- event.type = EV_LED;<br>
- event.code = LED_NUML;<br>
- event.value = leds & (1 << 1) ? 1 : 0;<br>
- i = write(ke->fd, (char *) &event, sizeof(event));<br>
- (void) i;<br>
-<br>
- event.type = EV_LED;<br>
- event.code = LED_SCROLLL;<br>
- event.value = leds & (1 << 2) ? 1 : 0;<br>
- i = write(ke->fd, (char *) &event, sizeof(event));<br>
- (void) i;<br>
-<br>
- event.type = EV_LED;<br>
- event.code = LED_COMPOSE;<br>
- event.value = leds & (1 << 3) ? 1 : 0;<br>
- i = write(ke->fd, (char *) &event, sizeof(event));<br>
- (void) i;<br>
-}<br>
-<br>
-static void<br>
-EvdevKbdBell(KdKeyboardInfo * ki, int volume, int frequency, int duration)<br>
-{<br>
-}<br>
-<br>
-static void<br>
-EvdevKbdDisable(<wbr>KdKeyboardInfo * ki)<br>
-{<br>
- Kevdev *ke;<br>
-<br>
- ke = ki->driverPrivate;<br>
-<br>
- if (!ki || !ki->driverPrivate)<br>
- return;<br>
-<br>
- KdUnregisterFd(ki, ke->fd, TRUE);<br>
-<br>
- if (ioctl(ke->fd, EVIOCGRAB, 0) < 0)<br>
- perror("Ungrabbing evdev keyboard device failed");<br>
-<br>
- free(ke);<br>
- ki->driverPrivate = 0;<br>
-}<br>
-<br>
-static void<br>
-EvdevKbdFini(KdKeyboardInfo * ki)<br>
-{<br>
-}<br>
-<br>
-KdPointerDriver LinuxEvdevMouseDriver = {<br>
- "evdev",<br>
- EvdevPtrInit,<br>
- EvdevPtrEnable,<br>
- EvdevPtrDisable,<br>
- EvdevPtrFini,<br>
- NULL,<br>
-};<br>
-<br>
-KdKeyboardDriver LinuxEvdevKeyboardDriver = {<br>
- "evdev",<br>
- EvdevKbdInit,<br>
- EvdevKbdEnable,<br>
- EvdevKbdLeds,<br>
- EvdevKbdBell,<br>
- EvdevKbdDisable,<br>
- EvdevKbdFini,<br>
- NULL,<br>
-};<br>
diff --git a/hw/kdrive/linux/linux.c b/hw/kdrive/linux/linux.c<br>
deleted file mode 100644<br>
index 20f1fce..0000000<br>
--- a/hw/kdrive/linux/linux.c<br>
+++ /dev/null<br>
@@ -1,347 +0,0 @@<br>
-/*<br>
- * Copyright © 1999 Keith Packard<br>
- *<br>
- * Permission to use, copy, modify, distribute, and sell this software and its<br>
- * documentation for any purpose is hereby granted without fee, provided that<br>
- * the above copyright notice appear in all copies and that both that<br>
- * copyright notice and this permission notice appear in supporting<br>
- * documentation, and that the name of Keith Packard not be used in<br>
- * advertising or publicity pertaining to distribution of the software without<br>
- * specific, written prior permission. Keith Packard makes no<br>
- * representations about the suitability of this software for any purpose. It<br>
- * is provided "as is" without express or implied warranty.<br>
- *<br>
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,<br>
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO<br>
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR<br>
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,<br>
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER<br>
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR<br>
- * PERFORMANCE OF THIS SOFTWARE.<br>
- */<br>
-<br>
-#ifdef HAVE_CONFIG_H<br>
-#include <kdrive-config.h><br>
-#endif<br>
-#include "kdrive.h"<br>
-#include <errno.h><br>
-#include <linux/vt.h><br>
-#include <linux/kd.h><br>
-#include <sys/stat.h><br>
-#include <sys/ioctl.h><br>
-#include <X11/keysym.h><br>
-#include <linux/apm_bios.h><br>
-<br>
-#ifdef TSLIB<br>
-extern KdPointerDriver TsDriver;<br>
-#endif<br>
-#ifdef KDRIVE_EVDEV<br>
-extern KdPointerDriver LinuxEvdevMouseDriver;<br>
-extern KdKeyboardDriver LinuxEvdevKeyboardDriver;<br>
-#endif<br>
-<br>
-static int vtno;<br>
-int LinuxConsoleFd;<br>
-int LinuxApmFd = -1;<br>
-static int activeVT;<br>
-static Bool enabled;<br>
-<br>
-static void<br>
-LinuxVTRequest(int sig)<br>
-{<br>
- kdSwitchPending = TRUE;<br>
-}<br>
-<br>
-/* Check before chowning -- this avoids touching the file system */<br>
-static void<br>
-LinuxCheckChown(const char *file)<br>
-{<br>
- struct stat st;<br>
- __uid_t u;<br>
- __gid_t g;<br>
- int r;<br>
-<br>
- if (stat(file, &st) < 0)<br>
- return;<br>
- u = getuid();<br>
- g = getgid();<br>
- if (st.st_uid != u || st.st_gid != g) {<br>
- r = chown(file, u, g);<br>
- (void) r;<br>
- }<br>
-}<br>
-<br>
-static int<br>
-LinuxInit(void)<br>
-{<br>
- int fd = -1;<br>
- char vtname[11];<br>
- struct vt_stat vts;<br>
-<br>
- LinuxConsoleFd = -1;<br>
- /* check if we're run with euid==0 */<br>
- if (geteuid() != 0) {<br>
- FatalError("LinuxInit: Server must be suid root\n");<br>
- }<br>
-<br>
- if (kdVirtualTerminal >= 0)<br>
- vtno = kdVirtualTerminal;<br>
- else {<br>
- if ((fd = open("/dev/tty0", O_WRONLY, 0)) < 0) {<br>
- FatalError("LinuxInit: Cannot open /dev/tty0 (%s)\n",<br>
- strerror(errno));<br>
- }<br>
- if ((ioctl(fd, VT_OPENQRY, &vtno) < 0) || (vtno == -1)) {<br>
- FatalError("xf86OpenConsole: Cannot find a free VT\n");<br>
- }<br>
- close(fd);<br>
- }<br>
-<br>
- snprintf(vtname, sizeof(vtname), "/dev/tty%d", vtno); /* /dev/tty1-64 */<br>
-<br>
- if ((LinuxConsoleFd = open(vtname, O_RDWR | O_NDELAY, 0)) < 0) {<br>
- FatalError("LinuxInit: Cannot open %s (%s)\n", vtname, strerror(errno));<br>
- }<br>
-<br>
- /* change ownership of the vt */<br>
- LinuxCheckChown(vtname);<br>
-<br>
- /*<br>
- * the current VT device we're running on is not "console", we want<br>
- * to grab all consoles too<br>
- *<br>
- * Why is this needed?<br>
- */<br>
- LinuxCheckChown("/dev/tty0");<br>
- /*<br>
- * Linux doesn't switch to an active vt after the last close of a vt,<br>
- * so we do this ourselves by remembering which is active now.<br>
- */<br>
- memset(&vts, '\0', sizeof(vts)); /* valgrind */<br>
- if (ioctl(LinuxConsoleFd, VT_GETSTATE, &vts) == 0) {<br>
- activeVT = vts.v_active;<br>
- }<br>
-<br>
- return 1;<br>
-}<br>
-<br>
-static void<br>
-LinuxSetSwitchMode(int mode)<br>
-{<br>
- struct sigaction act;<br>
- struct vt_mode VT;<br>
-<br>
- if (ioctl(LinuxConsoleFd, VT_GETMODE, &VT) < 0) {<br>
- FatalError("LinuxInit: VT_GETMODE failed\n");<br>
- }<br>
-<br>
- if (mode == VT_PROCESS) {<br>
- act.sa_handler = LinuxVTRequest;<br>
- sigemptyset(&act.sa_mask);<br>
- act.sa_flags = 0;<br>
- sigaction(SIGUSR1, &act, 0);<br>
-<br>
- VT.mode = mode;<br>
- VT.relsig = SIGUSR1;<br>
- VT.acqsig = SIGUSR1;<br>
- }<br>
- else {<br>
- act.sa_handler = SIG_IGN;<br>
- sigemptyset(&act.sa_mask);<br>
- act.sa_flags = 0;<br>
- sigaction(SIGUSR1, &act, 0);<br>
-<br>
- VT.mode = mode;<br>
- VT.relsig = 0;<br>
- VT.acqsig = 0;<br>
- }<br>
- if (ioctl(LinuxConsoleFd, VT_SETMODE, &VT) < 0) {<br>
- FatalError("LinuxInit: VT_SETMODE failed\n");<br>
- }<br>
-}<br>
-<br>
-static Bool LinuxApmRunning;<br>
-<br>
-static void<br>
-LinuxApmNotify(int fd, int mask, void *blockData)<br>
-{<br>
- apm_event_t event;<br>
- Bool running = LinuxApmRunning;<br>
- int cmd = APM_IOC_SUSPEND;<br>
-<br>
- while (read(fd, &event, sizeof(event)) == sizeof(event)) {<br>
- switch (event) {<br>
- case APM_SYS_STANDBY:<br>
- case APM_USER_STANDBY:<br>
- running = FALSE;<br>
- cmd = APM_IOC_STANDBY;<br>
- break;<br>
- case APM_SYS_SUSPEND:<br>
- case APM_USER_SUSPEND:<br>
- case APM_CRITICAL_SUSPEND:<br>
- running = FALSE;<br>
- cmd = APM_IOC_SUSPEND;<br>
- break;<br>
- case APM_NORMAL_RESUME:<br>
- case APM_CRITICAL_RESUME:<br>
- case APM_STANDBY_RESUME:<br>
- running = TRUE;<br>
- break;<br>
- }<br>
- }<br>
- if (running && !LinuxApmRunning) {<br>
- KdResume();<br>
- LinuxApmRunning = TRUE;<br>
- }<br>
- else if (!running && LinuxApmRunning) {<br>
- KdSuspend();<br>
- LinuxApmRunning = FALSE;<br>
- ioctl(fd, cmd, 0);<br>
- }<br>
-}<br>
-<br>
-#ifdef FNONBLOCK<br>
-#define NOBLOCK FNONBLOCK<br>
-#else<br>
-#define NOBLOCK FNDELAY<br>
-#endif<br>
-<br>
-static void<br>
-LinuxEnable(void)<br>
-{<br>
- if (enabled)<br>
- return;<br>
- if (kdSwitchPending) {<br>
- kdSwitchPending = FALSE;<br>
- ioctl(LinuxConsoleFd, VT_RELDISP, VT_ACKACQ);<br>
- }<br>
- /*<br>
- * Open the APM driver<br>
- */<br>
- LinuxApmFd = open("/dev/apm_bios", 2);<br>
- if (LinuxApmFd < 0 && errno == ENOENT)<br>
- LinuxApmFd = open("/dev/misc/apm_bios", 2);<br>
- if (LinuxApmFd >= 0) {<br>
- LinuxApmRunning = TRUE;<br>
- fcntl(LinuxApmFd, F_SETFL, fcntl(LinuxApmFd, F_GETFL) | NOBLOCK);<br>
- SetNotifyFd(LinuxApmFd, LinuxApmNotify, X_NOTIFY_READ, NULL);<br>
- }<br>
-<br>
- /*<br>
- * now get the VT<br>
- */<br>
- LinuxSetSwitchMode(VT_AUTO);<br>
- if (ioctl(LinuxConsoleFd, VT_ACTIVATE, vtno) != 0) {<br>
- FatalError("LinuxInit: VT_ACTIVATE failed\n");<br>
- }<br>
- if (ioctl(LinuxConsoleFd, VT_WAITACTIVE, vtno) != 0) {<br>
- FatalError("LinuxInit: VT_WAITACTIVE failed\n");<br>
- }<br>
- LinuxSetSwitchMode(VT_PROCESS)<wbr>;<br>
- if (ioctl(LinuxConsoleFd, KDSETMODE, KD_GRAPHICS) < 0) {<br>
- FatalError("LinuxInit: KDSETMODE KD_GRAPHICS failed\n");<br>
- }<br>
- enabled = TRUE;<br>
-}<br>
-<br>
-static void<br>
-LinuxDisable(void)<br>
-{<br>
- ioctl(LinuxConsoleFd, KDSETMODE, KD_TEXT); /* Back to text mode ... */<br>
- if (kdSwitchPending) {<br>
- kdSwitchPending = FALSE;<br>
- ioctl(LinuxConsoleFd, VT_RELDISP, 1);<br>
- }<br>
- enabled = FALSE;<br>
- if (LinuxApmFd >= 0) {<br>
- RemoveNotifyFd(LinuxApmFd);<br>
- close(LinuxApmFd);<br>
- LinuxApmFd = -1;<br>
- }<br>
-}<br>
-<br>
-static void<br>
-LinuxFini(void)<br>
-{<br>
- struct vt_mode VT;<br>
- struct vt_stat vts;<br>
- int fd;<br>
-<br>
- if (LinuxConsoleFd < 0)<br>
- return;<br>
-<br>
- if (ioctl(LinuxConsoleFd, VT_GETMODE, &VT) != -1) {<br>
- VT.mode = VT_AUTO;<br>
- ioctl(LinuxConsoleFd, VT_SETMODE, &VT); /* set dflt vt handling */<br>
- }<br>
- memset(&vts, '\0', sizeof(vts)); /* valgrind */<br>
- ioctl(LinuxConsoleFd, VT_GETSTATE, &vts);<br>
- if (vtno == vts.v_active) {<br>
- /*<br>
- * Find a legal VT to switch to, either the one we started from<br>
- * or the lowest active one that isn't ours<br>
- */<br>
- if (activeVT < 0 ||<br>
- activeVT == vts.v_active || !(vts.v_state & (1 << activeVT))) {<br>
- for (activeVT = 1; activeVT < 16; activeVT++)<br>
- if (activeVT != vtno && (vts.v_state & (1 << activeVT)))<br>
- break;<br>
- if (activeVT == 16)<br>
- activeVT = -1;<br>
- }<br>
- /*<br>
- * Perform a switch back to the active VT when we were started<br>
- */<br>
- if (activeVT >= -1) {<br>
- ioctl(LinuxConsoleFd, VT_ACTIVATE, activeVT);<br>
- ioctl(LinuxConsoleFd, VT_WAITACTIVE, activeVT);<br>
- activeVT = -1;<br>
- }<br>
- }<br>
- close(LinuxConsoleFd); /* make the vt-manager happy */<br>
- LinuxConsoleFd = -1;<br>
- fd = open("/dev/tty0", O_RDWR | O_NDELAY, 0);<br>
- if (fd >= 0) {<br>
- memset(&vts, '\0', sizeof(vts)); /* valgrind */<br>
- ioctl(fd, VT_GETSTATE, &vts);<br>
- if (ioctl(fd, VT_DISALLOCATE, vtno) < 0)<br>
- fprintf(stderr, "Can't deallocate console %d %s\n", vtno,<br>
- strerror(errno));<br>
- close(fd);<br>
- }<br>
- return;<br>
-}<br>
-<br>
-void<br>
-KdOsAddInputDrivers(void)<br>
-{<br>
-#ifdef TSLIB<br>
- KdAddPointerDriver(&TsDriver);<br>
-#endif<br>
-#ifdef KDRIVE_EVDEV<br>
- KdAddPointerDriver(&<wbr>LinuxEvdevMouseDriver);<br>
- KdAddKeyboardDriver(&<wbr>LinuxEvdevKeyboardDriver);<br>
-#endif<br>
-}<br>
-<br>
-static void<br>
-LinuxBell(int volume, int pitch, int duration)<br>
-{<br>
- if (volume && pitch)<br>
- ioctl(LinuxConsoleFd, KDMKTONE, ((1193190 / pitch) & 0xffff) |<br>
- (((unsigned long) duration * volume / 50) << 16));<br>
-}<br>
-<br>
-KdOsFuncs LinuxFuncs = {<br>
- .Init = LinuxInit,<br>
- .Enable = LinuxEnable,<br>
- .Disable = LinuxDisable,<br>
- .Fini = LinuxFini,<br>
- .Bell = LinuxBell,<br>
-};<br>
-<br>
-void<br>
-OsVendorInit(void)<br>
-{<br>
- KdOsInit(&LinuxFuncs);<br>
-}<br>
diff --git a/hw/kdrive/linux/tslib.c b/hw/kdrive/linux/tslib.c<br>
deleted file mode 100644<br>
index 0cdb4ea..0000000<br>
--- a/hw/kdrive/linux/tslib.c<br>
+++ /dev/null<br>
@@ -1,194 +0,0 @@<br>
-/*<br>
- * TSLIB based touchscreen driver for KDrive<br>
- * Porting to new input API and event queueing by Daniel Stone.<br>
- * Derived from ts.c by Keith Packard<br>
- * Derived from ps2.c by Jim Gettys<br>
- *<br>
- * Copyright © 1999 Keith Packard<br>
- * Copyright © 2000 Compaq Computer Corporation<br>
- * Copyright © 2002 MontaVista Software Inc.<br>
- * Copyright © 2005 OpenedHand Ltd.<br>
- * Copyright © 2006 Nokia Corporation<br>
- *<br>
- * Permission to use, copy, modify, distribute, and sell this software and its<br>
- * documentation for any purpose is hereby granted without fee, provided that<br>
- * the above copyright notice appear in all copies and that both that<br>
- * copyright notice and this permission notice appear in supporting<br>
- * documentation, and that the name of the authors and/or copyright holders<br>
- * not be used in advertising or publicity pertaining to distribution of the<br>
- * software without specific, written prior permission. The authors and/or<br>
- * copyright holders make no representations about the suitability of this<br>
- * software for any purpose. It is provided "as is" without express or<br>
- * implied warranty.<br>
- *<br>
- * THE AUTHORS AND/OR COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD<br>
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY<br>
- * AND FITNESS, IN NO EVENT SHALL THE AUTHORS AND/OR COPYRIGHT HOLDERS BE<br>
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES<br>
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN<br>
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF<br>
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.<br>
- */<br>
-<br>
-#ifdef HAVE_KDRIVE_CONFIG_H<br>
-#include <kdrive-config.h><br>
-#endif<br>
-<br>
-#include <X11/X.h><br>
-#include <X11/Xproto.h><br>
-#include "inputstr.h"<br>
-#include "scrnintstr.h"<br>
-#include "kdrive.h"<br>
-#include <sys/ioctl.h><br>
-#include <tslib.h><br>
-#include <dirent.h><br>
-#include <linux/input.h><br>
-<br>
-struct TslibPrivate {<br>
- int fd;<br>
- int lastx, lasty;<br>
- struct tsdev *tsDev;<br>
- void (*raw_event_hook) (int x, int y, int pressure, void *closure);<br>
- void *raw_event_closure;<br>
- int phys_screen;<br>
-};<br>
-<br>
-static void<br>
-TsRead(int fd, void *closure)<br>
-{<br>
- KdPointerInfo *pi = closure;<br>
- struct TslibPrivate *private = pi->driverPrivate;<br>
- struct ts_sample event;<br>
- long x = 0, y = 0;<br>
- unsigned long flags;<br>
-<br>
- if (private->raw_event_hook) {<br>
- while (ts_read_raw(private->tsDev, &event, 1) == 1)<br>
- private->raw_event_hook(event.<wbr>x, event.y, event.pressure,<br>
- private->raw_event_closure);<br>
- return;<br>
- }<br>
-<br>
- while (ts_read(private->tsDev, &event, 1) == 1) {<br>
- if (event.pressure) {<br>
- flags = KD_BUTTON_1;<br>
-<br>
- /*<br>
- * Here we test for the touch screen driver actually being on the<br>
- * touch screen, if it is we send absolute coordinates. If not,<br>
- * then we send delta's so that we can track the entire vga screen.<br>
- */<br>
- if (KdCurScreen == private->phys_screen) {<br>
- x = event.x;<br>
- y = event.y;<br>
- }<br>
- else {<br>
- flags |= KD_MOUSE_DELTA;<br>
- if ((private->lastx == 0) || (private->lasty == 0)) {<br>
- x = event.x;<br>
- y = event.y;<br>
- }<br>
- else {<br>
- x = event.x - private->lastx;<br>
- y = event.y - private->lasty;<br>
- }<br>
- }<br>
- private->lastx = event.x;<br>
- private->lasty = event.y;<br>
- }<br>
- else {<br>
- flags = 0;<br>
- x = private->lastx;<br>
- y = private->lasty;<br>
- }<br>
-<br>
- KdEnqueuePointerEvent(pi, flags, x, y, event.pressure);<br>
- }<br>
-}<br>
-<br>
-static Status<br>
-TslibEnable(KdPointerInfo * pi)<br>
-{<br>
- struct TslibPrivate *private = pi->driverPrivate;<br>
-<br>
- private->raw_event_hook = NULL;<br>
- private->raw_event_closure = NULL;<br>
- if (!pi->path) {<br>
- pi->path = strdup("/dev/input/<wbr>touchscreen0");<br>
- ErrorF("[tslib/TslibEnable] no device path given, trying %s\n",<br>
- pi->path);<br>
- }<br>
-<br>
- private->tsDev = ts_open(pi->path, 0);<br>
- if (!private->tsDev) {<br>
- ErrorF("[tslib/TslibEnable] failed to open %s\n", pi->path);<br>
- return BadAlloc;<br>
- }<br>
-<br>
- if (ts_config(private->tsDev)) {<br>
- ErrorF("[tslib/TslibEnable] failed to load configuration\n");<br>
- ts_close(private->tsDev);<br>
- private->tsDev = NULL;<br>
- return BadValue;<br>
- }<br>
-<br>
- private->fd = ts_fd(private->tsDev);<br>
-<br>
- KdRegisterFd(private->fd, TsRead, pi);<br>
-<br>
- return Success;<br>
-}<br>
-<br>
-static void<br>
-TslibDisable(KdPointerInfo * pi)<br>
-{<br>
- struct TslibPrivate *private = pi->driverPrivate;<br>
-<br>
- if (private->fd)<br>
- KdUnregisterFd(pi, private->fd, TRUE);<br>
-<br>
- if (private->tsDev)<br>
- ts_close(private->tsDev);<br>
-<br>
- private->fd = 0;<br>
- private->tsDev = NULL;<br>
-}<br>
-<br>
-static Status<br>
-TslibInit(KdPointerInfo * pi)<br>
-{<br>
- struct TslibPrivate *private = NULL;<br>
-<br>
- if (!pi || !pi->dixdev)<br>
- return !Success;<br>
-<br>
- pi->driverPrivate = (struct TslibPrivate *)<br>
- calloc(sizeof(struct TslibPrivate), 1);<br>
- if (!pi->driverPrivate)<br>
- return !Success;<br>
-<br>
- private = pi->driverPrivate;<br>
- /* hacktastic */<br>
- private->phys_screen = 0;<br>
- pi->nAxes = 3;<br>
- pi->name = strdup("Touchscreen");<br>
- pi->inputClass = KD_TOUCHSCREEN;<br>
-<br>
- return Success;<br>
-}<br>
-<br>
-static void<br>
-TslibFini(KdPointerInfo * pi)<br>
-{<br>
- free(pi->driverPrivate);<br>
- pi->driverPrivate = NULL;<br>
-}<br>
-<br>
-KdPointerDriver TsDriver = {<br>
- "tslib",<br>
- TslibInit,<br>
- TslibEnable,<br>
- TslibDisable,<br>
- TslibFini,<br>
- NULL,<br>
-};<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.9.3<br>
<br>
______________________________<wbr>_________________<br>
<a href="mailto:xorg-devel@lists.x.org">xorg-devel@lists.x.org</a>: X.Org development<br>
Archives: <a href="http://lists.x.org/archives/xorg-devel" rel="noreferrer" target="_blank">http://lists.x.org/archives/<wbr>xorg-devel</a><br>
Info: <a href="https://lists.x.org/mailman/listinfo/xorg-devel" rel="noreferrer" target="_blank">https://lists.x.org/mailman/<wbr>listinfo/xorg-devel</a></font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><div style="font-size:12.8px"><b>Laércio de Sousa</b><br></div><div style="font-size:12.8px;text-align:center"><div style="text-align:left"><i>Orientador de Informática<br></i></div><div style="text-align:left"><i style="font-size:12.8px"><i><img src="https://docs.google.com/uc?export=download&id=0B_0RrXAKZ1hbZFdINFpGU2x5NDQ&revid=0B_0RrXAKZ1hbanY1RVZYR29ZV1lHOSswdzc1SlBPd2dnRXhRPQ" width="420" height="47"><br></i>Rua Ismael da Silva Mello, 559, Mogi Moderno, </i><i style="font-size:12.8px;text-align:center">Mogi das Cruzes - SP</i></div></div><div style="font-size:12.8px"><div style="font-size:12.8px;text-align:center"><i><div style="text-align:left"><i>CEP 08717-390</i></div></i></div><div style="font-size:12.8px"><span style="font-family:arial;font-size:small">Telefone: (11) 4726-8313 / 4796-5656</span></div></div><div style="font-size:12.8px"><span style="font-family:arial;font-size:small">Facebook: <a href="https://www.facebook.com/egruppi" target="_blank">https://www.facebook.com/egruppi</a></span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>