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
This commit is contained in:
parent
473f98a44d
commit
78abc8a578
@ -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
|
||||
|
@ -1,29 +0,0 @@
|
||||
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) {
|
@ -1,39 +0,0 @@
|
||||
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;
|
||||
}
|
||||
|
@ -1,51 +0,0 @@
|
||||
commit b80f653bf33ed0ec23223a9877068cba97850ed1
|
||||
Author: Lars-Peter Clausen <lars@metafoo.de>
|
||||
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 <exevents.h> /* Needed for InitValuator/Proximity stuff */
|
||||
#include <X11/keysym.h>
|
||||
#include <mipointer.h>
|
||||
+#include <randrstr.h>
|
||||
|
||||
#include <tslib.h>
|
||||
|
||||
@@ -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;
|
@ -1,24 +0,0 @@
|
||||
commit b6ff79c07806789a12ca3c5260c5d0b12e212eef
|
||||
Author: Lars-Peter Clausen <lars@metafoo.de>
|
||||
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);
|
||||
}
|
@ -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;
|
@ -1,91 +0,0 @@
|
||||
--- a/src/tslib.c
|
||||
+++ b/src/tslib.c
|
||||
@@ -49,6 +49,7 @@
|
||||
#include <X11/keysym.h>
|
||||
#include <mipointer.h>
|
||||
#include <randrstr.h>
|
||||
+#include <xserver-properties.h>
|
||||
|
||||
#include <tslib.h>
|
||||
|
||||
@@ -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");
|
||||
|
@ -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");
|
@ -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);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user