Some stability and cleanup patches.
authorLars-Peter Clausen <lars@metafoo.de>
Sun, 1 Feb 2009 16:14:02 +0000 (16:14 +0000)
committerLars-Peter Clausen <lars@metafoo.de>
Sun, 1 Feb 2009 16:14:02 +0000 (16:14 +0000)
SVN-Revision: 14341

Xorg/driver/xf86-input-tslib/patches/010-rename-tslibdevice-option-to-device.patch [new file with mode: 0644]
Xorg/driver/xf86-input-tslib/patches/011-ifdef-debug-output.patch [new file with mode: 0644]
Xorg/driver/xf86-input-tslib/patches/012-deleteinput.patch [new file with mode: 0644]

diff --git a/Xorg/driver/xf86-input-tslib/patches/010-rename-tslibdevice-option-to-device.patch b/Xorg/driver/xf86-input-tslib/patches/010-rename-tslibdevice-option-to-device.patch
new file mode 100644 (file)
index 0000000..dd36fa2
--- /dev/null
@@ -0,0 +1,29 @@
+commit fe65976e2f006643950e70d33684b91c33a87e3a
+Author: Lars-Peter Clausen <lars@metafoo.de>
+Date:   Sun Feb 1 16:42:27 2009 +0100
+
+    Rename "TslibDevice" option to "Device" to be more consistant with other
+    drivers.
+
+diff --git a/src/tslib.c b/src/tslib.c
+index edc14b2..e91a949 100644
+--- a/src/tslib.c
++++ b/src/tslib.c
+@@ -73,7 +73,7 @@ struct ts_priv {
+ };
+ static const char *DEFAULTS[] = {
+-      "TslibDevice", "/dev/event0",
++      "Device", "/dev/event0",
+       NULL
+ };
+@@ -334,7 +334,7 @@ xf86TslibInit(InputDriverPtr drv, IDevPtr dev, int flags)
+               priv->rotate = TSLIB_ROTATE_NONE;
+       }
+-      s = xf86SetStrOption(pInfo->options, "TslibDevice", NULL);
++      s = xf86SetStrOption(pInfo->options, "Device", NULL);
+       priv->ts = ts_open(s, 0);
+       if (!priv->ts) {
diff --git a/Xorg/driver/xf86-input-tslib/patches/011-ifdef-debug-output.patch b/Xorg/driver/xf86-input-tslib/patches/011-ifdef-debug-output.patch
new file mode 100644 (file)
index 0000000..83b2bc5
--- /dev/null
@@ -0,0 +1,58 @@
+commit 69fcc78ea931f8a84497f4ee9021f4493f45a778
+Author: Lars-Peter Clausen <lars@metafoo.de>
+Date:   Sun Feb 1 16:44:24 2009 +0100
+
+    Put #ifdef DEBUG around debug output.
+
+diff --git a/src/tslib.c b/src/tslib.c
+index e91a949..ad43abb 100644
+--- a/src/tslib.c
++++ b/src/tslib.c
+@@ -80,21 +80,27 @@ static const char *DEFAULTS[] = {
+ static void
+ BellProc(int percent, DeviceIntPtr pDev, pointer ctrl, int unused)
+ {
++#ifdef DEBUG
+       ErrorF("%s\n", __FUNCTION__);
++#endif
+       return;
+ }
+ static void
+ KeyControlProc(DeviceIntPtr pDev, KeybdCtrl * ctrl)
+ {
++#ifdef DEBUG
+       ErrorF("%s\n", __FUNCTION__);
++#endif
+       return;
+ }
+ static void
+ PointerControlProc(DeviceIntPtr dev, PtrCtrl * ctrl)
+ {
++#ifdef DEBUG
+       ErrorF("%s\n", __FUNCTION__);
++#endif
+       return;
+ }
+@@ -186,7 +192,9 @@ xf86TslibControlProc(DeviceIntPtr device, int what)
+       int i;
+       struct ts_priv *priv;
++#ifdef DEBUG
+       ErrorF("%s\n", __FUNCTION__);
++#endif
+       pInfo = device->public.devicePrivate;
+       priv = pInfo->private;
+@@ -258,7 +266,9 @@ xf86TslibControlProc(DeviceIntPtr device, int what)
+ static void
+ xf86TslibUninit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+ {
++#ifdef DEBUG
+       ErrorF("%s\n", __FUNCTION__);
++#endif
+       xf86TslibControlProc(pInfo->dev, DEVICE_OFF);
+       xfree(pInfo->private);
+ }
diff --git a/Xorg/driver/xf86-input-tslib/patches/012-deleteinput.patch b/Xorg/driver/xf86-input-tslib/patches/012-deleteinput.patch
new file mode 100644 (file)
index 0000000..b8460d3
--- /dev/null
@@ -0,0 +1,39 @@
+commit de4ec145ea88253dc469ee81f094fa73de36b773
+Author: Lars-Peter Clausen <lars@metafoo.de>
+Date:   Sun Feb 1 16:54:55 2009 +0100
+
+    Call xf86DeleteInput in UnInit or if something goes wrong in the Init procedure.
+    If xf86DeleteInput is not called the server will end up with corrupted memory.
+
+diff --git a/src/tslib.c b/src/tslib.c
+index ad43abb..3eba078 100644
+--- a/src/tslib.c
++++ b/src/tslib.c
+@@ -271,6 +271,7 @@ xf86TslibUninit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+ #endif
+       xf86TslibControlProc(pInfo->dev, DEVICE_OFF);
+       xfree(pInfo->private);
++    xf86DeleteInput(pInfo, 0);
+ }
+ /*
+@@ -347,15 +348,17 @@ xf86TslibInit(InputDriverPtr drv, IDevPtr dev, int flags)
+       s = xf86SetStrOption(pInfo->options, "Device", NULL);
+       priv->ts = ts_open(s, 0);
++      xfree(s);
++
+       if (!priv->ts) {
+               ErrorF("ts_open failed (device=%s)\n",s);
++        xf86DeleteInput(pInfo, 0);
+               return NULL;
+       }
+-      xfree(s);
+-
+       if (ts_config(priv->ts)) {
+               ErrorF("ts_config failed\n");
++        xf86DeleteInput(pInfo, 0);
+               return NULL;
+       }