diff options
Diffstat (limited to 'meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch')
-rw-r--r-- | meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch b/meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch new file mode 100644 index 0000000000..c5997c2ffa --- /dev/null +++ b/meta-extras/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch | |||
@@ -0,0 +1,124 @@ | |||
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 | |||
8 | Index: xorg-server-1.1.99.3/hw/kdrive/linux/tslib.c | ||
9 | =================================================================== | ||
10 | --- xorg-server-1.1.99.3.orig/hw/kdrive/linux/tslib.c 2007-01-30 00:44:13.000000000 +0000 | ||
11 | +++ xorg-server-1.1.99.3/hw/kdrive/linux/tslib.c 2007-01-30 21:55:52.000000000 +0000 | ||
12 | @@ -47,6 +47,10 @@ | ||
13 | |||
14 | #define TSLIB_QUEUE_SIZE 3 | ||
15 | |||
16 | +/* For XCalibrate extension */ | ||
17 | +void (*tslib_raw_event_hook)(int x, int y, int pressure, void *closure); | ||
18 | +void *tslib_raw_event_closure; | ||
19 | + | ||
20 | struct TslibPrivate { | ||
21 | int fd; | ||
22 | int lastx, lasty; | ||
23 | @@ -76,6 +80,19 @@ TsRead (int fd, void *closure) | ||
24 | unsigned long flags = 0; | ||
25 | int discard = 0; | ||
26 | |||
27 | + if (tslib_raw_event_hook) | ||
28 | + { | ||
29 | + /* XCalibrate Ext */ | ||
30 | + if (ts_read_raw(private->tsDev, &event, 1) == 1) | ||
31 | + { | ||
32 | + tslib_raw_event_hook (event.x, | ||
33 | + event.y, | ||
34 | + event.pressure, | ||
35 | + tslib_raw_event_closure); | ||
36 | + } | ||
37 | + return; | ||
38 | + } | ||
39 | + | ||
40 | if (!private->tsDev) { | ||
41 | DebugF("[tslib] EXTREME BADNESS: TsRead called while tsDev is null!\n"); | ||
42 | return; | ||
43 | @@ -322,14 +339,14 @@ TsRead (int fd, void *closure) | ||
44 | } | ||
45 | } | ||
46 | |||
47 | -/* must always be NULL-terminated. */ | ||
48 | -char *valid_ts_names[] = { | ||
49 | - "ADS784x Touchscreen", | ||
50 | - "omap-ts", | ||
51 | - "TSC2301 touchscreen", | ||
52 | - NULL | ||
53 | +static char *TsNames[] = { | ||
54 | + NULL, /* set via TSLIB_TSDEVICE */ | ||
55 | + "/dev/ts", | ||
56 | + "/dev/touchscreen/0", | ||
57 | }; | ||
58 | |||
59 | +#define NUM_TS_NAMES (sizeof (TsNames) / sizeof (TsNames[0])) | ||
60 | + | ||
61 | #define TS_NAME_SIZE 32 | ||
62 | |||
63 | static Status | ||
64 | @@ -383,11 +400,10 @@ TslibDisable (KdPointerInfo *pi) | ||
65 | private->tsDev = NULL; | ||
66 | } | ||
67 | |||
68 | - | ||
69 | static Status | ||
70 | TslibInit (KdPointerInfo *pi) | ||
71 | { | ||
72 | - int fd = 0, i = 0; | ||
73 | + int fd = 0, i = 0, j = 0; | ||
74 | char devpath[PATH_MAX], devname[TS_NAME_SIZE]; | ||
75 | DIR *inputdir = NULL; | ||
76 | struct dirent *inputent = NULL; | ||
77 | @@ -397,33 +413,25 @@ TslibInit (KdPointerInfo *pi) | ||
78 | return !Success; | ||
79 | |||
80 | if (!pi->path || strcmp(pi->path, "auto") == 0) { | ||
81 | - if (!(inputdir = opendir("/dev/input"))) { | ||
82 | - ErrorF("[tslib/TslibInit]: couldn't open /dev/input!\n"); | ||
83 | - return BadMatch; | ||
84 | - } | ||
85 | |||
86 | - while ((inputent = readdir(inputdir))) { | ||
87 | - if (strncmp(inputent->d_name, "event", 5) != 0) | ||
88 | - continue; | ||
89 | + if ((TsNames[0] = getenv("TSLIB_TSDEVICE")) == NULL) | ||
90 | + j++; | ||
91 | + | ||
92 | + for (i = j; i < NUM_TS_NAMES; i++) | ||
93 | + { | ||
94 | + struct tsdev *tsDev; | ||
95 | |||
96 | - snprintf(devpath, PATH_MAX, "/dev/input/%s", inputent->d_name); | ||
97 | - fd = open(devpath, O_RDWR); | ||
98 | + if(!(tsDev = ts_open(TsNames[i], 0))) | ||
99 | + continue; | ||
100 | |||
101 | - if (!ioctl(fd, EVIOCGNAME(sizeof(devname)), devname)) { | ||
102 | - close(fd); | ||
103 | + if (ts_config(tsDev)) | ||
104 | continue; | ||
105 | - } | ||
106 | - close(fd); | ||
107 | |||
108 | - for (i = 0; valid_ts_names[i]; i++) { | ||
109 | - if (strcmp(devname, valid_ts_names[i]) == 0) { | ||
110 | - pi->path = KdSaveString(devpath); | ||
111 | - break; | ||
112 | - } | ||
113 | - } | ||
114 | - } | ||
115 | - | ||
116 | - closedir(inputdir); | ||
117 | + ts_close(tsDev); | ||
118 | + | ||
119 | + pi->path = KdSaveString(TsNames[i]); | ||
120 | + break; | ||
121 | + } | ||
122 | } | ||
123 | |||
124 | if (!pi->path || strcmp(pi->path, "auto") == 0) { | ||