.gitignore | 3 ChangeLog | 39 -- Makefile.am | 12 README | 20 + configure.ac | 35 - man/elographics.man | 6 src/Makefile.am | 2 src/xf86Elo.c | 942 +++++++++------------------------------------------- 8 files changed, 220 insertions(+), 839 deletions(-)
New commits: commit 607aed76023e71509b260dc23da7c150c1eff825 Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Wed Jun 9 12:18:14 2010 +1000 elographics 1.2.4 Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/configure.ac b/configure.ac index d1b776c..c778134 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-input-elographics], - 1.2.3, + 1.2.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-input-elographics) commit ac31d3e2d16f2b037d1c4e42aef76ddbd2fa1d20 Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Wed Jun 9 12:17:16 2010 +1000 Remove libcwrappers for malloc and free. Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/src/xf86Elo.c b/src/xf86Elo.c index 4077b22..6887a66 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -990,14 +990,14 @@ xf86EloAllocate(InputDriverPtr drv, IDevPtr dev) LocalDevicePtr local; EloPrivatePtr priv; - priv = xalloc(sizeof(EloPrivateRec)); + priv = malloc(sizeof(EloPrivateRec)); if (!priv) return NULL; local = xf86AllocateInput(drv, 0); if (!local) { - xfree(priv); + free(priv); return NULL; } @@ -1044,8 +1044,8 @@ xf86EloUninit(InputDriverPtr drv, { EloPrivatePtr priv = (EloPrivatePtr) local->private; - xfree(priv->input_dev); - xfree(priv); + free(priv->input_dev); + free(priv); local->private = NULL; xf86DeleteInput(local, 0); } @@ -1090,9 +1090,9 @@ xf86EloInit(InputDriverPtr drv, dev->identifier); if (priv) { if (priv->input_dev) { - xfree(priv->input_dev); + free(priv->input_dev); } - xfree(priv); + free(priv); } return local; } commit ac5366d6e1f26e6ceef3d062ab7df301d623cf54 Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Fri Dec 18 08:42:26 2009 +1000 Added support for GeneralTouch serial touchscreens. Signed-off-by: Ivan Afonichev <ivan.afonic...@gmail.com> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/src/xf86Elo.c b/src/xf86Elo.c index dbe1747..4077b22 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -907,8 +907,7 @@ xf86EloControl(DeviceIntPtr dev, xf86EloPrintIdent(reply, priv); } else { - ErrorF("Unable to ask Elographics touchscreen identification\n"); - goto not_success; + DBG(2, ErrorF("Unable to ask Elographics touchscreen identification... Maybe it's GeneralTouch touchscreen...\n")); } /* @@ -920,8 +919,7 @@ xf86EloControl(DeviceIntPtr dev, req[3] = ELO_TOUCH_MODE | ELO_STREAM_MODE | ELO_UNTOUCH_MODE; req[4] = ELO_TRACKING_MODE; if (xf86EloSendControl(req, local->fd) != Success) { - ErrorF("Unable to change Elographics touchscreen operating mode\n"); - goto not_success; + DBG(2, ErrorF("Unable to change Elographics touchscreen operating mode... Maybe it's GeneralTouch touchscreen...\n")); } /* @@ -932,12 +930,7 @@ xf86EloControl(DeviceIntPtr dev, req[2] = priv->untouch_delay; req[3] = priv->report_delay; if (xf86EloSendControl(req, local->fd) != Success) { - ErrorF("Unable to change Elographics touchscreen reports timings\n"); - -not_success: - SYSCALL(close(local->fd)); - local->fd = -1; - return !Success; + DBG(2, ErrorF("Unable to change Elographics touchscreen reports timings... Maybe it's GeneralTouch touchscreen...\n")); } } xf86AddEnabledDevice(local); commit b9531248d1b5d00b2ba941f576fc160ea5e1444b Author: Michael Smith <msm...@cbnco.com> Date: Tue Dec 15 15:01:29 2009 -0500 xf86EloReadInput(): fix xserver unresponsiveness during touch The fix for bug #14109 ensures all bytes are emptied from the OS buffer by looping until xf86WaitForInput returns 0. This patch just changes the timeout from 1 millisecond to 0: we don't want the X server to block if there's no more serial data. It also removes the Vmin and Vtime options, which were making the calls to read() block until a complete 10-byte packet buffer could be filled. At 9600 bps, this could pause the X server for up to 9 ms. The code can already handle partial buffers, so all we have to do is get rid of the Vmin. Also, if xf86EloGetPacket() returns !Success, we should continue rather than break so the xf86WaitForInput call can decide whether to exit, in case there's more data in the buffer. Before the fix, glxgears was giving me about 390 FPS normally and down to 140 FPS when dragging an empty area of the touchscreen. Now it's basically unchanged when the touchscreen is in use (390 -> 385 FPS). X.Org Bug 14109 <https://bugs.freedesktop.org/show_bug.cgi?id=14109> Signed-off-by: Michael Smith <msm...@cbnco.com> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/src/xf86Elo.c b/src/xf86Elo.c index ad88621..dbe1747 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -421,15 +421,17 @@ xf86EloReadInput(LocalDevicePtr local) #endif DBG(4, ErrorF("Entering ReadInput\n")); + /* - * Try to get a packet. + * Read bytes until there's no data left. We may have more or less than + * one packet worth of data in the OS buffer. */ - while (xf86WaitForInput(local->fd, ELO_MAX_WAIT/100) > 0) { + do { if(xf86EloGetPacket(priv->packet_buf, &priv->packet_buf_p, &priv->checksum, local->fd) != Success) - break; + continue; /* * Process only ELO_TOUCHs here. @@ -488,6 +490,7 @@ xf86EloReadInput(LocalDevicePtr local) (state == ELO_PRESS) ? "Press" : ((state == ELO_RELEASE) ? "Release" : "Stream"))); } } + while (xf86WaitForInput(local->fd, 0) > 0); /* don't wait, just check */ } @@ -1059,8 +1062,6 @@ static const char *default_options[] = { "StopBits", "1", "DataBits", "8", "Parity", "None", - "Vmin", "10", - "Vtime", "1", "FlowControl", "None", NULL }; commit 60927fee86100e803f438036daeb94ba0b8e5db7 Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Fri Nov 20 09:12:22 2009 +1000 Remove unused bits from configure.ac Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/configure.ac b/configure.ac index ee0e0a6..d1b776c 100644 --- a/configure.ac +++ b/configure.ac @@ -45,24 +45,6 @@ XORG_CWARNFLAGS AH_TOP([#include "xorg-server.h"]) -#AC_DEFINE(XFree86LOADER,1,[Stub define for loadable drivers]) -# -#AC_ARG_ENABLE(XINPUT, AS_HELP_STRING([--enable-xinput], -# [Build XInput support (default: yes)]), -# [XINPUT=$enableval],[XINPUT=yes]) -#AM_CONDITIONAL(XINPUT, test "x$XINPUT" = "xyes") -#if test "x$XINPUT" = "xyes" ; then -# AC_DEFINE(XINPUT,1,[Enable XInput support]) -#fi -# -#AC_ARG_ENABLE(XKB, AS_HELP_STRING([--enable-xkb], -# [Build XKB support (default: yes)]), -# [XKB=$enableval],[XKB=yes]) -#AM_CONDITIONAL(XKB, test "x$XKB" = "xyes") -#if test "x$XKB" = "xyes" ; then -# AC_DEFINE(XKB,1,[Enable XKB support]) -#fi - AC_ARG_WITH(xorg-module-dir, AC_HELP_STRING([--with-xorg-module-dir=DIR], [Default xorg module directory [[default=$libdir/xorg/modules]]]), commit 36d6b8efe232cc20afb74799f013c03cbb79a68b Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Tue Aug 18 15:36:07 2009 +1000 Reset local->private to NULL to avoid double-frees. (#23239) X.Org Bug 23239 <http://bugs.freedesktop.org/show_bug.cgi?id=23239> Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/src/xf86Elo.c b/src/xf86Elo.c index 495a43c..ad88621 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -1050,7 +1050,7 @@ xf86EloUninit(InputDriverPtr drv, xfree(priv->input_dev); xfree(priv); - + local->private = NULL; xf86DeleteInput(local, 0); } commit a18af14b1df5271fbe3100df3fcb3a8811981ddf Author: Peter Hutterer <peter.hutte...@who-t.net> Date: Fri Jul 17 14:44:55 2009 +1000 Cope with XINPUT ABI 7. Signed-off-by: Peter Hutterer <peter.hutte...@who-t.net> diff --git a/src/xf86Elo.c b/src/xf86Elo.c index 4ca60f1..495a43c 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -780,6 +780,10 @@ xf86EloControl(DeviceIntPtr dev, unsigned char map[] = { 0, 1 }; unsigned char req[ELO_PACKET_SIZE]; unsigned char reply[ELO_PACKET_SIZE]; +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + Atom btn_label; + Atom axis_labels[2] = { 0, 0 }; +#endif switch(mode) { @@ -797,7 +801,11 @@ xf86EloControl(DeviceIntPtr dev, /* * Device reports button press for up to 1 button. */ - if (InitButtonClassDeviceStruct(dev, 1, map) == FALSE) { + if (InitButtonClassDeviceStruct(dev, 1, +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + &btn_label, +#endif + map) == FALSE) { ErrorF("Unable to allocate Elographics touchscreen ButtonClassDeviceStruct\n"); return !Success; } @@ -818,6 +826,9 @@ xf86EloControl(DeviceIntPtr dev, * screen to fit one meter. */ if (InitValuatorClassDeviceStruct(dev, 2, +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + axis_labels, +#endif #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3 xf86GetMotionEvents, #endif @@ -827,11 +838,19 @@ xf86EloControl(DeviceIntPtr dev, } else { /* I will map coordinates myself */ - InitValuatorAxisStruct(dev, 0, -1, -1, + InitValuatorAxisStruct(dev, 0, +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + axis_labels[0], +#endif + -1, -1, 9500, 0 /* min_res */, 9500 /* max_res */); - InitValuatorAxisStruct(dev, 1, -1, -1, + InitValuatorAxisStruct(dev, 1, +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 + axis_labels[1], +#endif + -1, -1, 10500, 0 /* min_res */, 10500 /* max_res */); commit c97c9f470636e6caf4374a6930e5fe380f58b8bb Author: Paulo Cesar Pereira de Andrade <p...@mandriva.com.br> Date: Mon Feb 2 19:06:55 2009 -0200 Janitor: make distcheck, .gitignore. diff --git a/.gitignore b/.gitignore index 2df4a8d..eb2be95 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,6 @@ ltmain.sh missing stamp-h1 *~ +xf86-input-elographics-*.tar.* +ChangeLog +tags diff --git a/Makefile.am b/Makefile.am index 36867bd..183adde 100644 --- a/Makefile.am +++ b/Makefile.am @@ -28,8 +28,7 @@ MAINTAINERCLEANFILES = ChangeLog .PHONY: ChangeLog ChangeLog: - (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || \ - (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2) + $(CHANGELOG_CMD) dist-hook: ChangeLog diff --git a/configure.ac b/configure.ac index 4801a9c..ee0e0a6 100644 --- a/configure.ac +++ b/configure.ac @@ -32,15 +32,16 @@ AM_INIT_AUTOMAKE([dist-bzip2]) AM_MAINTAINER_MODE -DRIVER_NAME=elographics -AC_SUBST([DRIVER_NAME]) - +# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG +m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.2) AM_CONFIG_HEADER([config.h]) # Checks for programs. AC_DISABLE_STATIC AC_PROG_LIBTOOL AC_PROG_CC +XORG_CWARNFLAGS AH_TOP([#include "xorg-server.h"]) @@ -77,16 +78,18 @@ XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) # Checks for pkg-config packages PKG_CHECK_MODULES(XORG, xorg-server xproto $REQUIRED_MODULES) sdkdir=$(pkg-config --variable=sdkdir xorg-server) - -CFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src' -AC_SUBST([CFLAGS]) +XORG_CFLAGS="$CWARNFLAGS $XORG_CFLAGS" # Checks for libraries. # Checks for header files. AC_HEADER_STDC +DRIVER_NAME=elographics +AC_SUBST([DRIVER_NAME]) + XORG_MANPAGE_SECTIONS XORG_RELEASE_VERSION +XORG_CHANGELOG AC_OUTPUT([Makefile src/Makefile man/Makefile]) diff --git a/src/Makefile.am b/src/Makefile.am index c1d44bf..cfc8bb2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,6 +24,8 @@ # -avoid-version prevents gratuitous .0.0.0 version numbers on the end # _ladir passes a dummy rpath to libtool so the thing will actually link # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. +AM_CFLAGS = $(XORG_CFLAGS) + @driver_n...@_drv_la_ltlibraries = @driver_n...@_drv.la @driver_n...@_drv_la_ldflags = -module -avoid-version @driver_n...@_drv_ladir = @inputdir@ commit 8230f8bb1f51adc038451fc124394ac72279b5ff Author: Alan Coopersmith <alan.coopersm...@sun.com> Date: Fri Jan 30 20:18:17 2009 -0800 Add README with pointers to mailing list, bugzilla & git repos diff --git a/README b/README new file mode 100644 index 0000000..279c320 --- /dev/null +++ b/README @@ -0,0 +1,20 @@ +xf86-input-elographics - Elographics input driver for the Xorg X server + +Please submit bugs & patches to the Xorg bugzilla: + + https://bugs.freedesktop.org/enter_bug.cgi?product=xorg + +All questions regarding this software should be directed at the +Xorg mailing list: + + http://lists.freedesktop.org/mailman/listinfo/xorg + +The master development code repository can be found at: + + git://anongit.freedesktop.org/git/xorg/driver/xf86-input-elographics + + http://cgit.freedesktop.org/xorg/driver/xf86-input-elographics + +For more information on the git code manager, see: + + http://wiki.x.org/wiki/GitPage commit e98045e8101b13720690352b757cdcc3bc806b02 Author: Matthieu Herrb <matthieu.he...@laas.fr> Date: Thu Jan 29 17:19:42 2009 +0100 Fix InputDriverRec allocation and freeing. This caused X server to access free()'d memory on exit path. Thanks to msys.ch for providing a test machine. diff --git a/src/xf86Elo.c b/src/xf86Elo.c index 1620e44..4ca60f1 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -970,7 +970,7 @@ not_success: *************************************************************************** */ static LocalDevicePtr -xf86EloAllocate(InputDriverPtr drv) +xf86EloAllocate(InputDriverPtr drv, IDevPtr dev) { LocalDevicePtr local; EloPrivatePtr priv; @@ -1002,7 +1002,7 @@ xf86EloAllocate(InputDriverPtr drv) priv->packet_buf_p = 0; priv->swap_axes = 0; - local->name = XI_TOUCHSCREEN; + local->name = xstrdup(dev->identifier); local->flags = 0 /* XI86_NO_OPEN_ON_INIT */; local->device_control = xf86EloControl; local->read_input = xf86EloReadInput; @@ -1029,12 +1029,8 @@ xf86EloUninit(InputDriverPtr drv, { EloPrivatePtr priv = (EloPrivatePtr) local->private; - xf86EloControl(local->dev, DEVICE_OFF); - xfree(priv->input_dev); xfree(priv); - xfree(local->name); - xfree(local); xf86DeleteInput(local, 0); } @@ -1064,7 +1060,7 @@ xf86EloInit(InputDriverPtr drv, Model* model; - local = xf86EloAllocate(drv); + local = xf86EloAllocate(drv, dev); if (!local) { return NULL; } commit 6f3ca866c821b8fa49e2278cc1538352a95bb2a9 Author: Alan Coopersmith <alan.coopersm...@sun.com> Date: Fri Jan 9 16:12:34 2009 -0800 Remove xorgconfig & xorgcfg from See Also list in man page diff --git a/man/elographics.man b/man/elographics.man index 3a3e84e..7ce590a 100644 --- a/man/elographics.man +++ b/man/elographics.man @@ -75,7 +75,7 @@ Delay between report packets. Default: 1 (10ms). .BI "Option \*qModel\*q \*q" string \*q The touchscreen model. Default: unset. Supported models: "Sunit dSeries". .SH "SEE ALSO" -__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__). +__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__). .SH AUTHORS Authors include: Patrick Lecoanet commit 37cd09e99c7f5fa4ce7511b8ed171a3ae130300f Author: Peter Hutterer <peter.hutte...@redhat.com> Date: Tue Oct 21 15:33:43 2008 +1030 elographics 1.2.3 diff --git a/configure.ac b/configure.ac index 599c5a0..4801a9c 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-input-elographics], - 1.2.2, + 1.2.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-input-elographics) commit 117a54598043df6497fbc1ae4f047cc248441072 Author: Peter Hutterer <peter.hutte...@redhat.com> Date: Tue Oct 14 10:22:29 2008 +1030 Add special handling for Sunit dSeries. RH #445193 This model does not reply to queries about touchscreen identification. After opening the fd, we can skip right to enabling the device. Red Hat Bug <https://bugzilla.redhat.com/show_bug.cgi?id=445193> diff --git a/man/elographics.man b/man/elographics.man index 9f59941..3a3e84e 100644 --- a/man/elographics.man +++ b/man/elographics.man @@ -73,7 +73,7 @@ event to occur. Default: 5 (50ms). Delay between report packets. Default: 1 (10ms). .TP .BI "Option \*qModel\*q \*q" string \*q -The touchscreen model. Default: unset. +The touchscreen model. Default: unset. Supported models: "Sunit dSeries". .SH "SEE ALSO" __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__). .SH AUTHORS diff --git a/src/xf86Elo.c b/src/xf86Elo.c index d1c89e5..1620e44 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -69,6 +69,7 @@ * models to be treated specially. */ #define MODEL_UNKNOWN -1 +#define MODEL_SUNIT_D 1 typedef struct { int type; @@ -77,6 +78,7 @@ typedef struct { static Model SupportedModels[] = { + {MODEL_SUNIT_D, "Sunit dSeries"}, /* sunit dSeries models don't reply to queries */ {MODEL_UNKNOWN, NULL} }; /* @@ -860,57 +862,61 @@ xf86EloControl(DeviceIntPtr dev, Error("Unable to open Elographics touchscreen device"); return !Success; } - /* - * Try to see if the link is at the specified rate and - * ask the controller to report various infos. - */ - memset(req, 0, ELO_PACKET_SIZE); - req[1] = tolower(ELO_PARAMETER); - if (xf86EloSendQuery(req, reply, local->fd) != Success) { - priv->is_a_2310 = 1; - ErrorF("Not at the specified rate or model 2310, will continue\n"); - } - /* - * Ask the controller to report various infos. - */ - memset(req, 0, ELO_PACKET_SIZE); - req[1] = tolower(ELO_ID); - if (xf86EloSendQuery(req, reply, local->fd) == Success) { - xf86EloPrintIdent(reply, priv); - } - else { - ErrorF("Unable to ask Elographics touchscreen identification\n"); - goto not_success; - } + if (priv->model != MODEL_SUNIT_D) + { + /* + * Try to see if the link is at the specified rate and + * ask the controller to report various infos. + */ + memset(req, 0, ELO_PACKET_SIZE); + req[1] = tolower(ELO_PARAMETER); + if (xf86EloSendQuery(req, reply, local->fd) != Success) { + priv->is_a_2310 = 1; + ErrorF("Not at the specified rate or model 2310, will continue\n"); + } - /* - * Set the operating mode: Stream, no scaling, no calibration, - * no range checking, no trim, tracking enabled. - */ - memset(req, 0, ELO_PACKET_SIZE); - req[1] = ELO_MODE; - req[3] = ELO_TOUCH_MODE | ELO_STREAM_MODE | ELO_UNTOUCH_MODE; - req[4] = ELO_TRACKING_MODE; - if (xf86EloSendControl(req, local->fd) != Success) { - ErrorF("Unable to change Elographics touchscreen operating mode\n"); - goto not_success; - } + /* + * Ask the controller to report various infos. + */ + memset(req, 0, ELO_PACKET_SIZE); + req[1] = tolower(ELO_ID); + if (xf86EloSendQuery(req, reply, local->fd) == Success) { + xf86EloPrintIdent(reply, priv); + } + else { + ErrorF("Unable to ask Elographics touchscreen identification\n"); + goto not_success; + } - /* - * Set the touch reports timings from configuration data. - */ - memset(req, 0, ELO_PACKET_SIZE); - req[1] = ELO_REPORT; - req[2] = priv->untouch_delay; - req[3] = priv->report_delay; - if (xf86EloSendControl(req, local->fd) != Success) { - ErrorF("Unable to change Elographics touchscreen reports timings\n"); - - not_success: - SYSCALL(close(local->fd)); - local->fd = -1; - return !Success; + /* + * Set the operating mode: Stream, no scaling, no calibration, + * no range checking, no trim, tracking enabled. + */ + memset(req, 0, ELO_PACKET_SIZE); + req[1] = ELO_MODE; + req[3] = ELO_TOUCH_MODE | ELO_STREAM_MODE | ELO_UNTOUCH_MODE; + req[4] = ELO_TRACKING_MODE; + if (xf86EloSendControl(req, local->fd) != Success) { + ErrorF("Unable to change Elographics touchscreen operating mode\n"); + goto not_success; + } + + /* + * Set the touch reports timings from configuration data. + */ + memset(req, 0, ELO_PACKET_SIZE); + req[1] = ELO_REPORT; + req[2] = priv->untouch_delay; + req[3] = priv->report_delay; + if (xf86EloSendControl(req, local->fd) != Success) { + ErrorF("Unable to change Elographics touchscreen reports timings\n"); + +not_success: + SYSCALL(close(local->fd)); + local->fd = -1; + return !Success; + } } xf86AddEnabledDevice(local); dev->public.on = TRUE; commit d0aa1083c0130861a2c78509b72847fc3f7ee5f3 Author: Peter Hutterer <peter.hutte...@redhat.com> Date: Tue Oct 14 10:11:11 2008 +1030 Add Option "Model" to supported list of options. Some touchscreens supported by this driver need special handling, hence the explicit specification of the model. Note that this commit does not actually do anything with the information, it just sets some internal state. Signed-off-by: Peter Hutterer <peter.hutte...@redhat.com> diff --git a/man/elographics.man b/man/elographics.man index 8dac6b5..9f59941 100644 --- a/man/elographics.man +++ b/man/elographics.man @@ -71,6 +71,9 @@ event to occur. Default: 5 (50ms). .TP .BI "Option \*qReportDelay\*q \*q" integer \*q Delay between report packets. Default: 1 (10ms). +.TP +.BI "Option \*qModel\*q \*q" string \*q +The touchscreen model. Default: unset. .SH "SEE ALSO" __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__). .SH AUTHORS diff --git a/src/xf86Elo.c b/src/xf86Elo.c index dfb05d1..d1c89e5 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -65,6 +65,20 @@ #include "xf86Module.h" #endif +/** + * models to be treated specially. + */ +#define MODEL_UNKNOWN -1 + +typedef struct { + int type; + char *name; +} Model; + +static Model SupportedModels[] = +{ + {MODEL_UNKNOWN, NULL} +}; /* *************************************************************************** * @@ -186,6 +200,7 @@ typedef struct _EloPrivateRec { int packet_buf_p; /* Assembly buffer pointer */ int swap_axes; /* Swap X an Y axes if != 0 */ unsigned char packet_buf[ELO_PACKET_SIZE]; /* Assembly buffer */ + int model; /* one of MODEL_... */ } EloPrivateRec, *EloPrivatePtr; /* @@ -1039,6 +1054,9 @@ xf86EloInit(InputDriverPtr drv, char *str; int portrait = 0; int height, width; + char *opt_model; + Model* model; + local = xf86EloAllocate(drv); if (!local) { @@ -1065,6 +1083,19 @@ xf86EloInit(InputDriverPtr drv, } priv->input_dev = strdup(str); + opt_model = xf86SetStrOption(local->options, "Model", NULL); + model = SupportedModels; + priv->model = MODEL_UNKNOWN; + while(model->type != MODEL_UNKNOWN && opt_model) + { + if (!strcmp(model->name, opt_model)) + { + priv->model = model->type; + break; + } + model++; + } + local->name = xf86SetStrOption(local->options, "DeviceName", XI_TOUCHSCREEN); xf86Msg(X_CONFIG, "Elographics X device name: %s\n", local->name); priv->screen_no = xf86SetIntOption(local->options, "ScreenNo", 0); commit bf0e1bf915cb679bd425712300f5dc5c80ed190a Author: Peter Hutterer <peter.hutte...@redhat.com> Date: Thu Aug 14 15:34:51 2008 +0930 Fix build, xf86Version.h -> xorgVersion.h diff --git a/src/xf86Elo.c b/src/xf86Elo.c index 923cf63..dfb05d1 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -47,7 +47,7 @@ #include "config.h" #endif -#include "xf86Version.h" +#include "xorgVersion.h" #ifndef XFree86LOADER commit 038798931482575adb411129f016e207034e2dee Author: William Brack <wbr...@mmm.com.hk> Date: Wed Jun 18 13:42:44 2008 +0930 Don't convert coordinates for servers 1.4 and above. These servers do the coordinate conversion themselves, so no need to do it in the driver. Signed-off-by: Peter Hutterer <pe...@cs.unisa.edu.au> diff --git a/src/xf86Elo.c b/src/xf86Elo.c index ada6584..923cf63 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -392,6 +392,7 @@ xf86EloReadInput(LocalDevicePtr local) EloPrivatePtr priv = (EloPrivatePtr)(local->private); int cur_x, cur_y; int state; +#if GET_ABI_MAJOR(XINPUT_ABI) == 0 int first = 0; /* since convert is expecting 0 */ int num = 2; /* since convert is expecting 0 */ int v0 = 0; /* = cur_x - based on the debug output this is what v0 is */ @@ -400,14 +401,13 @@ xf86EloReadInput(LocalDevicePtr local) int v3 = 0; /* not used in convert */ int v4 = 0; /* not used in convert */ int v5 = 0; /* not used in convert */ - int x; /* output */ - int y; /* output */ +#endif DBG(4, ErrorF("Entering ReadInput\n")); /* * Try to get a packet. */ - while (xf86WaitForInput(local->fd, ELO_MAX_WAIT) > 0) { + while (xf86WaitForInput(local->fd, ELO_MAX_WAIT/100) > 0) { if(xf86EloGetPacket(priv->packet_buf, &priv->packet_buf_p, &priv->checksum, @@ -424,7 +424,7 @@ xf86EloReadInput(LocalDevicePtr local) cur_x = WORD_ASSEMBLY(priv->packet_buf[3], priv->packet_buf[4]); cur_y = WORD_ASSEMBLY(priv->packet_buf[5], priv->packet_buf[6]); state = priv->packet_buf[2] & 0x07; - +#if GET_ABI_MAJOR(XINPUT_ABI) == 0 /* * MHALAS: Based on the description in xf86XInputSetScreen * this code must be called from ReadInput BEFORE any events @@ -437,17 +437,18 @@ xf86EloReadInput(LocalDevicePtr local) * calib and before posting the event. */ - DBG(3, ErrorF("EloConvert Before Fix: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, x, y)); + DBG(3, ErrorF("EloConvert Before Fix: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, cur_x, cur_y)); v0 = cur_x; /* based on the debug output this is what v0 is */ - v1 = cur_y; /* based on the debug output this is what v0 is */ + v1 = cur_y; /* based on the debug output this is what v1 is */ /* * Use the conversion method to send correct coordinates * since it contains all necessary logic */ - xf86EloConvert(local, first, num, v0, v1, v2, v3, v4, v5, &x, &y); - DBG(3, ErrorF("EloConvert During Fix: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, x, y)); - xf86XInputSetScreen(local, priv->screen_no, x, y); - DBG(3, ErrorF("EloConvert After Fix: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, x, y)); + xf86EloConvert(local, first, num, v0, v1, v2, v3, v4, v5, &cur_x, &cur_y); + DBG(3, ErrorF("EloConvert During Fix: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, cur_x, cur_y)); + xf86XInputSetScreen(local, priv->screen_no, cur_x, cur_y); + DBG(3, ErrorF("EloConvert After Fix: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, cur_x, cur_y)); +#endif /* * Send events. @@ -456,13 +457,13 @@ xf86EloReadInput(LocalDevicePtr local) * location has changed as DIX assumes this. This is why we always * emit a motion, regardless of the kind of packet processed. */ - xf86PostMotionEvent(local->dev, TRUE, 0, 2, x, y); + xf86PostMotionEvent(local->dev, TRUE, 0, 2, cur_x, cur_y); /* * Emit a button press or release. */ if (state == ELO_PRESS || state == ELO_RELEASE) { - xf86PostButtonEvent(local->dev, TRUE, 1, state == ELO_PRESS, 0, 2, x, y); + xf86PostButtonEvent(local->dev, TRUE, 1, state == ELO_PRESS, 0, 2, cur_x, cur_y); } DBG(3, ErrorF("TouchScreen: x(%d), y(%d), %s\n", commit c73c44d8f68448737695a112b2e9d15b785ade2f Author: Peter Hutterer <pe...@cs.unisa.edu.au> Date: Tue Jun 17 14:11:58 2008 +0930 Remove RCS tags. diff --git a/man/elographics.man b/man/elographics.man index f47aaa1..8dac6b5 100644 --- a/man/elographics.man +++ b/man/elographics.man @@ -1,4 +1,3 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/input/elographics/elographics.man,v 1.1 2001/01/24 00:06:36 dawes Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH elographics __drivermansuffix__ __vendorversion__ diff --git a/src/xf86Elo.c b/src/xf86Elo.c index cda2545..ada6584 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -1,4 +1,3 @@ -/* $XConsortium: xf86Elo.c /main/13 1996/10/25 14:11:31 kaleb $ */ /* * Copyright 1995, 1999 by Patrick Lecoanet, France. <lecoa...@cena.dgac.fr> * @@ -22,8 +21,6 @@ * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/input/elographics/xf86Elo.c,v 1.13 2001/04/01 14:00:13 tsi Exp $ */ - /* ******************************************************************************* ******************************************************************************* commit a932fd4174ae4bf511e1418055f1470ba2860b43 Author: Peter Hutterer <pe...@cs.unisa.edu.au> Date: Tue Jun 17 14:18:31 2008 +0930 Remove XFREE_V4 define and all code that expects it to be unset. If you're still not running something more recent than X11 3, then you have other issues anyway. diff --git a/src/xf86Elo.c b/src/xf86Elo.c index 9bca907..cda2545 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -51,11 +51,7 @@ #endif #include "xf86Version.h" -#if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(3,9,0,0,0) -#define XFREE86_V4 -#endif -#ifdef XFREE86_V4 #ifndef XFree86LOADER #include <unistd.h> @@ -72,134 +68,6 @@ #include "xf86Module.h" #endif -#else /* XFREE86_V4 */ - -#include <X11/Xos.h> -#include <signal.h> -#include <stdio.h> - -#define NEED_EVENTS -#include <X11/X.h> -#include <X11/Xproto.h> -#include "inputstr.h" -#include "scrnintstr.h" -#include <X11/extensions/XI.h> -#include <X11/extensions/XIproto.h> - -#if defined(sun) && !defined(i386) -#include <errno.h> -#include <termio.h> -#include <fcntl.h> -#include <ctype.h> - -#include "extio.h" -#else /* defined(sun) && !defined(i386) */ -#include "compiler.h" - -#include "xf86.h" -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/e1p7u0w-000248...@alioth.debian.org