summaryrefslogtreecommitdiffstats
path: root/meta/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-01-30 22:10:02 +0000
committerRichard Purdie <richard@openedhand.com>2007-01-30 22:10:02 +0000
commit0e937cbeb792e5df2975888b6f102a62d0b57126 (patch)
treeb61315810919fffb6a120e4880eebf9613a6e239 /meta/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch
parent0eefd09740ae45e32223646066ded0bd8725c01d (diff)
downloadpoky-0e937cbeb792e5df2975888b6f102a62d0b57126.tar.gz
Add xserver-kdrive-xomap
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1225 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch')
-rw-r--r--meta/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch137
1 files changed, 137 insertions, 0 deletions
diff --git a/meta/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch b/meta/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch
new file mode 100644
index 0000000000..df5bbe2abf
--- /dev/null
+++ b/meta/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch
@@ -0,0 +1,137 @@
1---
2 configure |38107 -----------------------------------------------------------
3 configure.ac | 2 -
4 hw/kdrive/linux/tslib.c | 68 ++++++++++++++++++++++++++----------------------
5 2 files changed, 39 insertions(+), 31 deletions(-)
6
7
8Index: xorg-server-1.1.99.3/configure.ac
9===================================================================
10--- xorg-server-1.1.99.3.orig/configure.ac 2007-01-30 00:22:41.000000000 +0000
11+++ xorg-server-1.1.99.3/configure.ac 2007-01-30 00:22:41.000000000 +0000
12@@ -717,7 +717,7 @@ fi
13
14 if test "x$XCALIBRATE" = xyes && test "$KDRIVE" = yes; then
15 AC_DEFINE(XCALIBRATE, 1, [Build XCalibrate extension])
16- REQUIRED_MODULES="$REQUIRED_MODULES xcalibrateproto"
17+ REQUIRED_MODULES="$REQUIRED_MODULES xcalibrateext"
18 else
19 XCALIBRATE=no
20 fi
21Index: xorg-server-1.1.99.3/hw/kdrive/linux/tslib.c
22===================================================================
23--- xorg-server-1.1.99.3.orig/hw/kdrive/linux/tslib.c 2007-01-30 00:44:13.000000000 +0000
24+++ xorg-server-1.1.99.3/hw/kdrive/linux/tslib.c 2007-01-30 21:55:52.000000000 +0000
25@@ -47,6 +47,10 @@
26
27 #define TSLIB_QUEUE_SIZE 3
28
29+/* For XCalibrate extension */
30+void (*tslib_raw_event_hook)(int x, int y, int pressure, void *closure);
31+void *tslib_raw_event_closure;
32+
33 struct TslibPrivate {
34 int fd;
35 int lastx, lasty;
36@@ -76,6 +80,19 @@ TsRead (int fd, void *closure)
37 unsigned long flags = 0;
38 int discard = 0;
39
40+ if (tslib_raw_event_hook)
41+ {
42+ /* XCalibrate Ext */
43+ if (ts_read_raw(private->tsDev, &event, 1) == 1)
44+ {
45+ tslib_raw_event_hook (event.x,
46+ event.y,
47+ event.pressure,
48+ tslib_raw_event_closure);
49+ }
50+ return;
51+ }
52+
53 if (!private->tsDev) {
54 DebugF("[tslib] EXTREME BADNESS: TsRead called while tsDev is null!\n");
55 return;
56@@ -322,14 +339,14 @@ TsRead (int fd, void *closure)
57 }
58 }
59
60-/* must always be NULL-terminated. */
61-char *valid_ts_names[] = {
62- "ADS784x Touchscreen",
63- "omap-ts",
64- "TSC2301 touchscreen",
65- NULL
66+static char *TsNames[] = {
67+ NULL, /* set via TSLIB_TSDEVICE */
68+ "/dev/ts",
69+ "/dev/touchscreen/0",
70 };
71
72+#define NUM_TS_NAMES (sizeof (TsNames) / sizeof (TsNames[0]))
73+
74 #define TS_NAME_SIZE 32
75
76 static Status
77@@ -383,11 +400,10 @@ TslibDisable (KdPointerInfo *pi)
78 private->tsDev = NULL;
79 }
80
81-
82 static Status
83 TslibInit (KdPointerInfo *pi)
84 {
85- int fd = 0, i = 0;
86+ int fd = 0, i = 0, j = 0;
87 char devpath[PATH_MAX], devname[TS_NAME_SIZE];
88 DIR *inputdir = NULL;
89 struct dirent *inputent = NULL;
90@@ -397,33 +413,25 @@ TslibInit (KdPointerInfo *pi)
91 return !Success;
92
93 if (!pi->path || strcmp(pi->path, "auto") == 0) {
94- if (!(inputdir = opendir("/dev/input"))) {
95- ErrorF("[tslib/TslibInit]: couldn't open /dev/input!\n");
96- return BadMatch;
97- }
98
99- while ((inputent = readdir(inputdir))) {
100- if (strncmp(inputent->d_name, "event", 5) != 0)
101- continue;
102+ if ((TsNames[0] = getenv("TSLIB_TSDEVICE")) == NULL)
103+ j++;
104+
105+ for (i = j; i < NUM_TS_NAMES; i++)
106+ {
107+ struct tsdev *tsDev;
108
109- snprintf(devpath, PATH_MAX, "/dev/input/%s", inputent->d_name);
110- fd = open(devpath, O_RDWR);
111+ if(!(tsDev = ts_open(TsNames[i], 0)))
112+ continue;
113
114- if (!ioctl(fd, EVIOCGNAME(sizeof(devname)), devname)) {
115- close(fd);
116+ if (ts_config(tsDev))
117 continue;
118- }
119- close(fd);
120
121- for (i = 0; valid_ts_names[i]; i++) {
122- if (strcmp(devname, valid_ts_names[i]) == 0) {
123- pi->path = KdSaveString(devpath);
124- break;
125- }
126- }
127- }
128-
129- closedir(inputdir);
130+ ts_close(tsDev);
131+
132+ pi->path = KdSaveString(TsNames[i]);
133+ break;
134+ }
135 }
136
137 if (!pi->path || strcmp(pi->path, "auto") == 0) {