From 78abc8a578e7cc7c9940082d51f95d9eb61b761f Mon Sep 17 00:00:00 2001 From: mb Date: Thu, 27 Jan 2011 22:00:15 +0000 Subject: [PATCH] xf86-input-tslib: Update to 0.0.6. This fixes touchscreen on linux-2.6.37. git-svn-id: svn://svn.openwrt.org/openwrt/packages@25177 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- Xorg/driver/xf86-input-tslib/Makefile | 4 +- ...-rename-tslibdevice-option-to-device.patch | 29 ------ .../patches/012-deleteinput.patch | 39 -------- .../patches/015-add-randr-support.patch | 51 ----------- ...sdevice-when-module-is-uninitialized.patch | 24 ----- .../xf86-input-tslib/patches/025-XI3.patch | 14 --- .../patches/030-xserver-1.7.patch | 91 ------------------- .../patches/035-fix-wrong-free.patch | 18 ---- ...put.patch => 100-ifdef-debug-output.patch} | 20 ++-- 9 files changed, 12 insertions(+), 278 deletions(-) delete mode 100644 Xorg/driver/xf86-input-tslib/patches/010-rename-tslibdevice-option-to-device.patch delete mode 100644 Xorg/driver/xf86-input-tslib/patches/012-deleteinput.patch delete mode 100644 Xorg/driver/xf86-input-tslib/patches/015-add-randr-support.patch delete mode 100644 Xorg/driver/xf86-input-tslib/patches/020-close-tsdevice-when-module-is-uninitialized.patch delete mode 100644 Xorg/driver/xf86-input-tslib/patches/025-XI3.patch delete mode 100644 Xorg/driver/xf86-input-tslib/patches/030-xserver-1.7.patch delete mode 100644 Xorg/driver/xf86-input-tslib/patches/035-fix-wrong-free.patch rename Xorg/driver/xf86-input-tslib/patches/{011-ifdef-debug-output.patch => 100-ifdef-debug-output.patch} (68%) diff --git a/Xorg/driver/xf86-input-tslib/Makefile b/Xorg/driver/xf86-input-tslib/Makefile index 980d4e65f..998224592 100644 --- a/Xorg/driver/xf86-input-tslib/Makefile +++ b/Xorg/driver/xf86-input-tslib/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xf86-input-tslib -PKG_VERSION:=0.0.5 +PKG_VERSION:=0.0.6 PKG_RELEASE:=3 PKG_SOURCE_URL:=http://www.pengutronix.de/software/xf86-input-tslib/download/ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_BUILD_DIR=$(BUILD_DIR)/Xorg/$(_CATEGORY)/$(PKG_NAME)-$(PKG_VERSION)/ -PKG_MD5SUM:=4231b517d216e9f80ba66f13a0f30afd +PKG_MD5SUM:=b7a4d2f11637ee3fcf432e044b1d017f PKG_BUILD_DEPENDS:=randrproto inputproto xproto PKG_FIXUP:=libtool 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 deleted file mode 100644 index dd36fa2e9..000000000 --- a/Xorg/driver/xf86-input-tslib/patches/010-rename-tslibdevice-option-to-device.patch +++ /dev/null @@ -1,29 +0,0 @@ -commit fe65976e2f006643950e70d33684b91c33a87e3a -Author: Lars-Peter Clausen -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/012-deleteinput.patch b/Xorg/driver/xf86-input-tslib/patches/012-deleteinput.patch deleted file mode 100644 index b8460d381..000000000 --- a/Xorg/driver/xf86-input-tslib/patches/012-deleteinput.patch +++ /dev/null @@ -1,39 +0,0 @@ -commit de4ec145ea88253dc469ee81f094fa73de36b773 -Author: Lars-Peter Clausen -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; - } - diff --git a/Xorg/driver/xf86-input-tslib/patches/015-add-randr-support.patch b/Xorg/driver/xf86-input-tslib/patches/015-add-randr-support.patch deleted file mode 100644 index 88c85ae16..000000000 --- a/Xorg/driver/xf86-input-tslib/patches/015-add-randr-support.patch +++ /dev/null @@ -1,51 +0,0 @@ -commit b80f653bf33ed0ec23223a9877068cba97850ed1 -Author: Lars-Peter Clausen -Date: Wed Feb 18 23:08:14 2009 +0100 - - Transform touchscreen coordinates according to randr rotation. - -diff --git a/src/tslib.c b/src/tslib.c -index 3eba078..6091006 100644 ---- a/src/tslib.c -+++ b/src/tslib.c -@@ -48,6 +48,7 @@ - #include /* Needed for InitValuator/Proximity stuff */ - #include - #include -+#include - - #include - -@@ -128,6 +129,8 @@ static void ReadInput (LocalDevicePtr local) - struct ts_sample samp; - int ret; - int x,y; -+ ScrnInfoPtr pScrn = xf86Screens[priv->screen_num]; -+ Rotation rotation = rrGetScrPriv (pScrn->pScreen) ? RRGetRotation(pScrn->pScreen) : RR_Rotate_0; - - ret = ts_read(priv->ts, &samp, 1); - -@@ -154,6 +157,23 @@ static void ReadInput (LocalDevicePtr local) - default: break; - } - -+ tmp_x = samp.x; -+ -+ switch(rotation) { -+ case RR_Rotate_90: -+ samp.x = (priv->height - samp.y - 1) * priv->width / priv->height; -+ samp.y = tmp_x * priv->height / priv->width; -+ break; -+ case RR_Rotate_180: -+ samp.x = priv->width - samp.x - 1; -+ samp.y = priv->height - samp.y - 1; -+ break; -+ case RR_Rotate_270: -+ samp.x = samp.y * priv->width / priv->height; -+ samp.y = (priv->width - tmp_x - 1) * priv->height / priv->width; -+ break; -+ } -+ - priv->lastx = samp.x; - priv->lasty = samp.y; - x = samp.x; diff --git a/Xorg/driver/xf86-input-tslib/patches/020-close-tsdevice-when-module-is-uninitialized.patch b/Xorg/driver/xf86-input-tslib/patches/020-close-tsdevice-when-module-is-uninitialized.patch deleted file mode 100644 index 2af911118..000000000 --- a/Xorg/driver/xf86-input-tslib/patches/020-close-tsdevice-when-module-is-uninitialized.patch +++ /dev/null @@ -1,24 +0,0 @@ -commit b6ff79c07806789a12ca3c5260c5d0b12e212eef -Author: Lars-Peter Clausen -Date: Sat Apr 25 18:00:09 2009 +0200 - - Close tslib device when the module is unloaded. Closes a memory leak and allows - the device to be reopended when the xserver is restarted. - -diff --git a/src/tslib.c b/src/tslib.c -index 50596b7..e7a2766 100644 ---- a/src/tslib.c -+++ b/src/tslib.c -@@ -286,10 +286,12 @@ xf86TslibControlProc(DeviceIntPtr device, int what) - static void - xf86TslibUninit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) - { -+ struct ts_priv *priv = (struct ts_priv *)(pInfo->private); - #ifdef DEBUG - ErrorF("%s\n", __FUNCTION__); - #endif - xf86TslibControlProc(pInfo->dev, DEVICE_OFF); -+ ts_close(priv->ts); - xfree(pInfo->private); - xf86DeleteInput(pInfo, 0); - } diff --git a/Xorg/driver/xf86-input-tslib/patches/025-XI3.patch b/Xorg/driver/xf86-input-tslib/patches/025-XI3.patch deleted file mode 100644 index af8af79e5..000000000 --- a/Xorg/driver/xf86-input-tslib/patches/025-XI3.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/src/tslib.c b/src/tslib.c -index e7a2766..884167d 100644 ---- a/src/tslib.c -+++ b/src/tslib.c -@@ -234,7 +234,9 @@ xf86TslibControlProc(DeviceIntPtr device, int what) - - if (InitValuatorClassDeviceStruct(device, - 2, -+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3 - xf86GetMotionEvents, -+#endif - 0, Absolute) == FALSE) { - ErrorF("unable to allocate Valuator class device\n"); - return !Success; diff --git a/Xorg/driver/xf86-input-tslib/patches/030-xserver-1.7.patch b/Xorg/driver/xf86-input-tslib/patches/030-xserver-1.7.patch deleted file mode 100644 index d96e32358..000000000 --- a/Xorg/driver/xf86-input-tslib/patches/030-xserver-1.7.patch +++ /dev/null @@ -1,91 +0,0 @@ ---- a/src/tslib.c -+++ b/src/tslib.c -@@ -49,6 +49,7 @@ - #include - #include - #include -+#include - - #include - -@@ -211,6 +212,15 @@ xf86TslibControlProc(DeviceIntPtr device, int what) - unsigned char map[MAXBUTTONS + 1]; - int i; - struct ts_priv *priv; -+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 -+ Atom buttons[MAXBUTTONS]; -+ Atom axes[2]; -+ -+ axes[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X); -+ axes[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y); -+ -+ buttons[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT); -+#endif - - #ifdef DEBUG - ErrorF("%s\n", __FUNCTION__); -@@ -226,33 +236,45 @@ xf86TslibControlProc(DeviceIntPtr device, int what) - map[i + 1] = i + 1; - } - -- if (InitButtonClassDeviceStruct(device, -- MAXBUTTONS, map) == FALSE) { -+ if (InitButtonClassDeviceStruct(device, MAXBUTTONS, -+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 -+ buttons, -+#endif -+ map) == FALSE) { - ErrorF("unable to allocate Button class device\n"); - return !Success; - } - -- if (InitValuatorClassDeviceStruct(device, -- 2, --#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3 -- xf86GetMotionEvents, -+ if (InitValuatorClassDeviceStruct(device, 2, -+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 -+ axes, -+#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3 -+ xf86GetMotionEvents, - #endif -- 0, Absolute) == FALSE) { -+ 0, Absolute) == FALSE) { - ErrorF("unable to allocate Valuator class device\n"); - return !Success; - } - -- InitValuatorAxisStruct(device, 0, 0, /* min val */ -- priv->width - 1, /* max val */ -- priv->width, /* resolution */ -- 0, /* min_res */ -- priv->width); /* max_res */ -- -- InitValuatorAxisStruct(device, 1, 0, /* min val */ -- priv->height - 1,/* max val */ -- priv->height, /* resolution */ -- 0, /* min_res */ -- priv->height); /* max_res */ -+ InitValuatorAxisStruct(device, 0, -+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 -+ axes[0], -+#endif -+ 0, /* min val */ -+ priv->width - 1, /* max val */ -+ priv->width, /* resolution */ -+ 0, /* min_res */ -+ priv->width); /* max_res */ -+ -+ InitValuatorAxisStruct(device, 1, -+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 -+ axes[1], -+#endif -+ 0, /* min val */ -+ priv->height - 1, /* max val */ -+ priv->height, /* resolution */ -+ 0, /* min_res */ -+ priv->height); /* max_res */ - - if (InitProximityClassDeviceStruct (device) == FALSE) { - ErrorF ("Unable to allocate EVTouch touchscreen ProximityClassDeviceStruct\n"); - diff --git a/Xorg/driver/xf86-input-tslib/patches/035-fix-wrong-free.patch b/Xorg/driver/xf86-input-tslib/patches/035-fix-wrong-free.patch deleted file mode 100644 index 3643b0486..000000000 --- a/Xorg/driver/xf86-input-tslib/patches/035-fix-wrong-free.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/src/tslib.c -+++ b/src/tslib.c -@@ -372,13 +394,14 @@ 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); -+ xfree(s); - return NULL; - } -+ xfree(s); - - if (ts_config(priv->ts)) { - ErrorF("ts_config failed\n"); diff --git a/Xorg/driver/xf86-input-tslib/patches/011-ifdef-debug-output.patch b/Xorg/driver/xf86-input-tslib/patches/100-ifdef-debug-output.patch similarity index 68% rename from Xorg/driver/xf86-input-tslib/patches/011-ifdef-debug-output.patch rename to Xorg/driver/xf86-input-tslib/patches/100-ifdef-debug-output.patch index 83b2bc5a4..c836359c8 100644 --- a/Xorg/driver/xf86-input-tslib/patches/011-ifdef-debug-output.patch +++ b/Xorg/driver/xf86-input-tslib/patches/100-ifdef-debug-output.patch @@ -4,11 +4,11 @@ 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[] = { +Index: xf86-input-tslib-0.0.6/src/tslib.c +=================================================================== +--- xf86-input-tslib-0.0.6.orig/src/tslib.c 2009-10-19 17:07:18.000000000 +0200 ++++ xf86-input-tslib-0.0.6/src/tslib.c 2011-01-27 22:36:41.772784019 +0100 +@@ -89,21 +89,27 @@ static void BellProc(int percent, DeviceIntPtr pDev, pointer ctrl, int unused) { @@ -36,8 +36,8 @@ index e91a949..ad43abb 100644 return; } -@@ -186,7 +192,9 @@ xf86TslibControlProc(DeviceIntPtr device, int what) - int i; +@@ -327,7 +333,9 @@ + int i, axiswidth, axisheight; struct ts_priv *priv; +#ifdef DEBUG @@ -46,13 +46,13 @@ index e91a949..ad43abb 100644 pInfo = device->public.devicePrivate; priv = pInfo->private; -@@ -258,7 +266,9 @@ xf86TslibControlProc(DeviceIntPtr device, int what) - static void +@@ -431,7 +439,9 @@ xf86TslibUninit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) { + struct ts_priv *priv = (struct ts_priv *)(pInfo->private); +#ifdef DEBUG ErrorF("%s\n", __FUNCTION__); +#endif xf86TslibControlProc(pInfo->dev, DEVICE_OFF); + ts_close(priv->ts); xfree(pInfo->private); - }