summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2007-06-30 15:27:45 +0000
committerRichard Purdie <richard@openedhand.com>2007-06-30 15:27:45 +0000
commita863497347198c0c6968ff02148ac766085d6d12 (patch)
treed19660610a8aff5d0b9cf65c58df46884647bbcb /meta
parentd5ba636e35b3f8ef200dae9c1450146f00699ebe (diff)
downloadpoky-a863497347198c0c6968ff02148ac766085d6d12.tar.gz
X calibration changes. Add functionality to the xcalibrate protocol (and X) to convert screen coordinates to mouse coordinates. xtscal can then be massively simplified removing a stack of bugs. Also remove stale cvs versions of xcalibrate.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2067 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta')
-rw-r--r--meta/packages/xcalibrate/xcalibrate/xextproto.patch11
-rw-r--r--meta/packages/xcalibrate/xcalibrate_20060312.bb17
-rw-r--r--meta/packages/xcalibrate/xcalibrate_cvs.bb16
-rw-r--r--meta/packages/xcalibrateext/xcalibrateext_cvs.bb13
-rw-r--r--meta/packages/xorg-lib/libxcalibrate/coords.patch50
-rw-r--r--meta/packages/xorg-lib/libxcalibrate_git.bb4
-rw-r--r--meta/packages/xorg-proto/calibrateproto/coords.patch56
-rw-r--r--meta/packages/xorg-proto/calibrateproto_git.bb4
-rw-r--r--meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch122
-rw-r--r--meta/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch13
-rw-r--r--meta/packages/xorg-xserver/xserver-kdrive-xomap/xcalibrate_coords.patch122
-rw-r--r--meta/packages/xorg-xserver/xserver-kdrive-xomap_X11R7.1-1.1.99.3.bb7
-rw-r--r--meta/packages/xorg-xserver/xserver-kdrive_1.3.0.0.bb5
-rw-r--r--meta/packages/xorg-xserver/xserver-kdrive_X11R7.1-1.1.0.bb2
-rw-r--r--meta/packages/xorg-xserver/xserver-kdrive_git.bb2
-rw-r--r--meta/packages/xtscal/xtscal/cleanup.patch555
-rw-r--r--meta/packages/xtscal/xtscal/formfactor.patch30
-rw-r--r--meta/packages/xtscal/xtscal_0.6.3.bb6
18 files changed, 902 insertions, 133 deletions
diff --git a/meta/packages/xcalibrate/xcalibrate/xextproto.patch b/meta/packages/xcalibrate/xcalibrate/xextproto.patch
deleted file mode 100644
index cb190c073b..0000000000
--- a/meta/packages/xcalibrate/xcalibrate/xextproto.patch
+++ /dev/null
@@ -1,11 +0,0 @@
1--- XCalibrate/configure.ac.orig 2006-03-08 14:57:07.000000000 +0100
2+++ XCalibrate/configure.ac 2006-03-08 14:57:14.000000000 +0100
3@@ -7,7 +7,7 @@
4 AC_PROG_LIBTOOL
5
6 # Check for X
7-PKG_CHECK_MODULES(XCALIBRATE, x11 xextensions xcalibrateext)
8+PKG_CHECK_MODULES(XCALIBRATE, x11 xextproto xcalibrateext)
9
10 AC_OUTPUT([Makefile
11 xcalibrate.pc])
diff --git a/meta/packages/xcalibrate/xcalibrate_20060312.bb b/meta/packages/xcalibrate/xcalibrate_20060312.bb
deleted file mode 100644
index 1de87c04eb..0000000000
--- a/meta/packages/xcalibrate/xcalibrate_20060312.bb
+++ /dev/null
@@ -1,17 +0,0 @@
1PV = "0.0+cvs${FIXEDSRCDATE}"
2FIXEDSRCDATE = "${@bb.data.getVar('FILE', d, 1).split('_')[-1].split('.')[0]}"
3LICENSE = "BSD-X"
4SECTION = "x11/libs"
5PRIORITY = "optional"
6DEPENDS = "virtual/libx11 xcalibrateext libxext"
7DESCRIPTION = "XCalibrate client-side library"
8
9SRC_URI = "${FREEDESKTOP_CVS}/xlibs;module=XCalibrate \
10 file://xextproto.patch;patch=1"
11S = "${WORKDIR}/XCalibrate"
12
13inherit autotools pkgconfig
14
15do_stage() {
16 autotools_stage_all
17}
diff --git a/meta/packages/xcalibrate/xcalibrate_cvs.bb b/meta/packages/xcalibrate/xcalibrate_cvs.bb
deleted file mode 100644
index a5b435795a..0000000000
--- a/meta/packages/xcalibrate/xcalibrate_cvs.bb
+++ /dev/null
@@ -1,16 +0,0 @@
1PV = "0.0+cvs${SRCDATE}"
2LICENSE = "BSD-X"
3SECTION = "x11/libs"
4PRIORITY = "optional"
5DEPENDS = "virtual/libx11 xcalibrateext libxext"
6DESCRIPTION = "XCalibrate client-side library"
7
8SRC_URI = "${FREEDESKTOP_CVS}/xlibs;module=XCalibrate \
9 file://xextproto.patch;patch=1"
10S = "${WORKDIR}/XCalibrate"
11
12inherit autotools pkgconfig
13
14do_stage() {
15 autotools_stage_all
16}
diff --git a/meta/packages/xcalibrateext/xcalibrateext_cvs.bb b/meta/packages/xcalibrateext/xcalibrateext_cvs.bb
deleted file mode 100644
index 4e47c1677e..0000000000
--- a/meta/packages/xcalibrateext/xcalibrateext_cvs.bb
+++ /dev/null
@@ -1,13 +0,0 @@
1PV = "0.0+cvs${SRCDATE}"
2SECTION = "x11/libs"
3LICENSE = "BSD-X"
4DESCRIPTION = "XCalibrate extension headers"
5
6SRC_URI = "${FREEDESKTOP_CVS}/xlibs;module=XCalibrateExt"
7S = "${WORKDIR}/XCalibrateExt"
8
9inherit autotools pkgconfig
10
11do_stage() {
12 autotools_stage_all
13}
diff --git a/meta/packages/xorg-lib/libxcalibrate/coords.patch b/meta/packages/xorg-lib/libxcalibrate/coords.patch
new file mode 100644
index 0000000000..19cf1639f6
--- /dev/null
+++ b/meta/packages/xorg-lib/libxcalibrate/coords.patch
@@ -0,0 +1,50 @@
1---
2 xcalibrate.c | 26 ++++++++++++++++++++++++++
3 xcalibrate.h | 2 ++
4 2 files changed, 28 insertions(+)
5
6Index: XCalibrate/xcalibrate.c
7===================================================================
8--- XCalibrate.orig/xcalibrate.c 2007-06-30 14:12:22.000000000 +0100
9+++ XCalibrate/xcalibrate.c 2007-06-30 14:18:10.000000000 +0100
10@@ -227,3 +227,29 @@ XCalibrateSetRawMode (Display *dpy, Bool
11 SyncHandle ();
12 return 0;
13 }
14+
15+Status
16+XCalibrateScreenToCoord (Display *dpy, int *x, int *y)
17+{
18+ XExtDisplayInfo *info = XCalibrateFindDisplay (dpy);
19+ xXCalibrateScreenToCoordReq *req;
20+ xXCalibrateScreenToCoordReply rep;
21+ LockDisplay (dpy);
22+ GetReq (XCalibrateScreenToCoord, req);
23+ req->reqType = info->codes->major_opcode;
24+ req->xCalibrateReqType = X_XCalibrateScreenToCoord;
25+ req->x = *x;
26+ req->y = *y;
27+ if (!_XReply (dpy, (xReply *) &rep, 0, xFalse))
28+ {
29+ UnlockDisplay (dpy);
30+ SyncHandle ();
31+ return 1;
32+ }
33+ *x = rep.x;
34+ *y = rep.y;
35+ UnlockDisplay (dpy);
36+ SyncHandle ();
37+ return 0;
38+}
39+
40Index: XCalibrate/xcalibrate.h
41===================================================================
42--- XCalibrate.orig/xcalibrate.h 2007-06-30 14:16:16.000000000 +0100
43+++ XCalibrate/xcalibrate.h 2007-06-30 14:16:38.000000000 +0100
44@@ -43,4 +43,6 @@ Status XCalibrateQueryVersion (Display *
45
46 Status XCalibrateSetRawMode (Display *dpy, Bool enable);
47
48+Status XCalibrateScreenToCoord (Display *dpy, int *x, int *y);
49+
50 #endif
diff --git a/meta/packages/xorg-lib/libxcalibrate_git.bb b/meta/packages/xorg-lib/libxcalibrate_git.bb
index e4df6a1cbf..aa4b77b39d 100644
--- a/meta/packages/xorg-lib/libxcalibrate_git.bb
+++ b/meta/packages/xorg-lib/libxcalibrate_git.bb
@@ -4,12 +4,14 @@ PRIORITY = "optional"
4LICENSE = "BSD-X" 4LICENSE = "BSD-X"
5 5
6PV = "0.0+git${SRCDATE}" 6PV = "0.0+git${SRCDATE}"
7PR = "r1"
7 8
8DEPENDS = "virtual/libx11 calibrateproto libxext" 9DEPENDS = "virtual/libx11 calibrateproto libxext"
9 10
10FILES_${PN}-locale += "${datadir}/X11/locale" 11FILES_${PN}-locale += "${datadir}/X11/locale"
11 12
12SRC_URI = "git://anongit.freedesktop.org/git/xorg/lib/libXCalibrate;protocol=git;tag=4be232e30cd33a44a1ce6d3ec429ee6101540c62" 13SRC_URI = "git://anongit.freedesktop.org/git/xorg/lib/libXCalibrate;protocol=git;tag=4be232e30cd33a44a1ce6d3ec429ee6101540c62 \
14 file://coords.patch;patch=1"
13S = "${WORKDIR}/git" 15S = "${WORKDIR}/git"
14 16
15inherit autotools pkgconfig 17inherit autotools pkgconfig
diff --git a/meta/packages/xorg-proto/calibrateproto/coords.patch b/meta/packages/xorg-proto/calibrateproto/coords.patch
new file mode 100644
index 0000000000..8f44b029c5
--- /dev/null
+++ b/meta/packages/xorg-proto/calibrateproto/coords.patch
@@ -0,0 +1,56 @@
1---
2 xcalibrateproto.h | 25 +++++++++++++++++++++++++
3 xcalibratewire.h | 3 ++-
4 2 files changed, 27 insertions(+), 1 deletion(-)
5
6Index: XCalibrateExt/xcalibrateproto.h
7===================================================================
8--- XCalibrateExt.orig/xcalibrateproto.h 2004-06-02 20:18:47.000000000 +0100
9+++ XCalibrateExt/xcalibrateproto.h 2007-06-30 14:17:29.000000000 +0100
10@@ -78,6 +78,31 @@ typedef struct {
11
12 #define sz_xXCalibrateRawModeReply 32
13
14+typedef struct {
15+ CARD8 reqType;
16+ CARD8 xCalibrateReqType;
17+ CARD16 length B16;
18+ CARD32 x B32;
19+ CARD32 y B32;
20+} xXCalibrateScreenToCoordReq;
21+
22+#define sz_xXCalibrateScreenToCoordReq 12
23+
24+typedef struct {
25+ BYTE type; /* X_Reply */
26+ BYTE pad1;
27+ CARD16 sequenceNumber B16;
28+ CARD32 x;
29+ CARD32 y;
30+ CARD32 pad2 B32;
31+ CARD32 pad3 B32;
32+ CARD32 pad4 B32;
33+ CARD32 pad5 B32;
34+ CARD32 pad6 B32;
35+} xXCalibrateScreenToCoordReply;
36+
37+#define sz_xXCalibrateScreenToCoordReply 32
38+
39 /* Events */
40
41 typedef struct {
42Index: XCalibrateExt/xcalibratewire.h
43===================================================================
44--- XCalibrateExt.orig/xcalibratewire.h 2004-06-02 20:18:47.000000000 +0100
45+++ XCalibrateExt/xcalibratewire.h 2007-06-30 14:17:29.000000000 +0100
46@@ -31,8 +31,9 @@
47
48 #define X_XCalibrateQueryVersion 0
49 #define X_XCalibrateRawMode 1
50+#define X_XCalibrateScreenToCoord 2
51
52-#define XCalibrateNumberRequests (X_XCalibrateSetRawMode + 1)
53+#define XCalibrateNumberRequests (X_XCalibrateScreenToCoord + 1)
54
55 #define X_XCalibrateRawTouchscreen 0
56
diff --git a/meta/packages/xorg-proto/calibrateproto_git.bb b/meta/packages/xorg-proto/calibrateproto_git.bb
index dc03f02bf2..68c57ff3c7 100644
--- a/meta/packages/xorg-proto/calibrateproto_git.bb
+++ b/meta/packages/xorg-proto/calibrateproto_git.bb
@@ -3,7 +3,9 @@ require xorg-proto-common.inc
3DESCRIPTION = " Touchscreen calibration protocol" 3DESCRIPTION = " Touchscreen calibration protocol"
4 4
5PV = "0.0+git${SRCDATE}" 5PV = "0.0+git${SRCDATE}"
6PR = "r1"
6 7
7SRC_URI = "git://anongit.freedesktop.org/git/xorg/proto/calibrateproto;protocol=git;tag=a1d5ef0c73fbef3e758c51b57ac69ba9567bae04" 8SRC_URI = "git://anongit.freedesktop.org/git/xorg/proto/calibrateproto;protocol=git;tag=a1d5ef0c73fbef3e758c51b57ac69ba9567bae04 \
9 file://coords.patch;patch=1"
8S = "${WORKDIR}/git" 10S = "${WORKDIR}/git"
9 11
diff --git a/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch
new file mode 100644
index 0000000000..e0cca5428b
--- /dev/null
+++ b/meta/packages/xorg-xserver/xserver-kdrive-1.3.0.0/xcalibrate_coords.patch
@@ -0,0 +1,122 @@
1---
2 Xext/xcalibrate.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
3 hw/kdrive/src/kdrive.h | 3 +++
4 hw/kdrive/src/kinput.c | 12 ++++++++++++
5 3 files changed, 61 insertions(+), 1 deletion(-)
6
7Index: xorg-server-1.3.0.0/Xext/xcalibrate.c
8===================================================================
9--- xorg-server-1.3.0.0.orig/Xext/xcalibrate.c 2007-06-29 17:30:03.000000000 +0100
10+++ xorg-server-1.3.0.0/Xext/xcalibrate.c 2007-06-30 14:04:40.000000000 +0100
11@@ -166,7 +166,6 @@ ProcXCalibrateSetRawMode (ClientPtr clie
12 return (client->noClientException);
13 }
14
15-
16 static int
17 SProcXCalibrateSetRawMode (ClientPtr client)
18 {
19@@ -180,6 +179,47 @@ SProcXCalibrateSetRawMode (ClientPtr cli
20 return ProcXCalibrateSetRawMode(client);
21 }
22
23+static int
24+ProcXCalibrateScreenToCoord (ClientPtr client)
25+{
26+ REQUEST(xXCalibrateScreenToCoordReq);
27+ xXCalibrateScreenToCoordReply rep;
28+
29+ REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq);
30+
31+ memset (&rep, 0, sizeof (rep));
32+ rep.type = X_Reply;
33+ rep.sequenceNumber = client->sequence;
34+ rep.x = stuff->x;
35+ rep.y = stuff->y;
36+
37+ KdScreenToMouseCoords(&rep.x, &rep.y);
38+
39+ if (client->swapped)
40+ {
41+ int n;
42+
43+ swaps (&rep.x, n);
44+ swaps (&rep.y, n);
45+ }
46+ WriteToClient(client, sizeof (rep), (char *) &rep);
47+ return (client->noClientException);
48+}
49+
50+static int
51+SProcXCalibrateScreenToCoord (ClientPtr client)
52+{
53+ REQUEST(xXCalibrateScreenToCoordReq);
54+ int n;
55+
56+ REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq);
57+
58+ swaps(&stuff->x, n);
59+ swaps(&stuff->y, n);
60+
61+ return ProcXCalibrateScreenToCoord(client);
62+}
63+
64 static void
65 XCalibrateResetProc (ExtensionEntry *extEntry)
66 {
67@@ -194,6 +234,9 @@ ProcXCalibrateDispatch (ClientPtr client
68 return ProcXCalibrateQueryVersion(client);
69 case X_XCalibrateRawMode:
70 return ProcXCalibrateSetRawMode(client);
71+ case X_XCalibrateScreenToCoord:
72+ return ProcXCalibrateScreenToCoord(client);
73+
74 default: break;
75 }
76
77@@ -213,6 +256,8 @@ SProcXCalibrateDispatch (ClientPtr clien
78 return SProcXCalibrateQueryVersion(client);
79 case X_XCalibrateRawMode:
80 return SProcXCalibrateSetRawMode(client);
81+ case X_XCalibrateScreenToCoord:
82+ return SProcXCalibrateScreenToCoord(client);
83
84 default: break;
85 }
86Index: xorg-server-1.3.0.0/hw/kdrive/src/kdrive.h
87===================================================================
88--- xorg-server-1.3.0.0.orig/hw/kdrive/src/kdrive.h 2007-06-30 13:43:45.000000000 +0100
89+++ xorg-server-1.3.0.0/hw/kdrive/src/kdrive.h 2007-06-30 13:45:03.000000000 +0100
90@@ -746,6 +746,9 @@ void
91 KdSetMouseMatrix (KdMouseMatrix *matrix);
92
93 void
94+KdScreenToMouseCoords (int *x, int *y);
95+
96+void
97 KdComputeMouseMatrix (KdMouseMatrix *matrix, Rotation randr, int width, int height);
98
99 void
100Index: xorg-server-1.3.0.0/hw/kdrive/src/kinput.c
101===================================================================
102--- xorg-server-1.3.0.0.orig/hw/kdrive/src/kinput.c 2007-06-29 17:30:16.000000000 +0100
103+++ xorg-server-1.3.0.0/hw/kdrive/src/kinput.c 2007-06-30 15:52:16.000000000 +0100
104@@ -381,6 +381,18 @@ KdSetMouseMatrix (KdMouseMatrix *matrix)
105 }
106
107 void
108+KdScreenToMouseCoords (int *x, int *y)
109+{
110+ int (*m)[3] = kdMouseMatrix.matrix;
111+ int div = m[0][1] * m[1][0] - m[1][1] * m[0][0];
112+ int sx = *x;
113+ int sy = *y;
114+
115+ *x = (m[0][1] * sy - m[0][1] * m[1][2] + m[1][1] * m[0][2] - m[1][1] * sx) / div;
116+ *y = (m[1][0] * sx + m[0][0] * m[1][2] - m[1][0] * m[0][2] - m[0][0] * sy) / div;
117+}
118+
119+void
120 KdComputeMouseMatrix (KdMouseMatrix *m, Rotation randr, int width, int height)
121 {
122 int x_dir = 1, y_dir = 1;
diff --git a/meta/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch b/meta/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch
index df5bbe2abf..c5997c2ffa 100644
--- a/meta/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch
+++ b/meta/packages/xorg-xserver/xserver-kdrive-xomap/calibrateext.patch
@@ -5,19 +5,6 @@
5 2 files changed, 39 insertions(+), 31 deletions(-) 5 2 files changed, 39 insertions(+), 31 deletions(-)
6 6
7 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 8Index: xorg-server-1.1.99.3/hw/kdrive/linux/tslib.c
22=================================================================== 9===================================================================
23--- xorg-server-1.1.99.3.orig/hw/kdrive/linux/tslib.c 2007-01-30 00:44:13.000000000 +0000 10--- xorg-server-1.1.99.3.orig/hw/kdrive/linux/tslib.c 2007-01-30 00:44:13.000000000 +0000
diff --git a/meta/packages/xorg-xserver/xserver-kdrive-xomap/xcalibrate_coords.patch b/meta/packages/xorg-xserver/xserver-kdrive-xomap/xcalibrate_coords.patch
new file mode 100644
index 0000000000..fbe89b16b1
--- /dev/null
+++ b/meta/packages/xorg-xserver/xserver-kdrive-xomap/xcalibrate_coords.patch
@@ -0,0 +1,122 @@
1---
2 Xext/xcalibrate.c | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
3 hw/kdrive/src/kdrive.h | 3 +++
4 hw/kdrive/src/kinput.c | 12 ++++++++++++
5 3 files changed, 61 insertions(+), 1 deletion(-)
6
7Index: xorg-server-1.1.99.3/Xext/xcalibrate.c
8===================================================================
9--- xorg-server-1.1.99.3.orig/Xext/xcalibrate.c 2007-06-30 16:27:13.000000000 +0100
10+++ xorg-server-1.1.99.3/Xext/xcalibrate.c 2007-06-30 16:27:15.000000000 +0100
11@@ -166,7 +166,6 @@ ProcXCalibrateSetRawMode (ClientPtr clie
12 return (client->noClientException);
13 }
14
15-
16 static int
17 SProcXCalibrateSetRawMode (ClientPtr client)
18 {
19@@ -180,6 +179,47 @@ SProcXCalibrateSetRawMode (ClientPtr cli
20 return ProcXCalibrateSetRawMode(client);
21 }
22
23+static int
24+ProcXCalibrateScreenToCoord (ClientPtr client)
25+{
26+ REQUEST(xXCalibrateScreenToCoordReq);
27+ xXCalibrateScreenToCoordReply rep;
28+
29+ REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq);
30+
31+ memset (&rep, 0, sizeof (rep));
32+ rep.type = X_Reply;
33+ rep.sequenceNumber = client->sequence;
34+ rep.x = stuff->x;
35+ rep.y = stuff->y;
36+
37+ KdScreenToMouseCoords(&rep.x, &rep.y);
38+
39+ if (client->swapped)
40+ {
41+ int n;
42+
43+ swaps (&rep.x, n);
44+ swaps (&rep.y, n);
45+ }
46+ WriteToClient(client, sizeof (rep), (char *) &rep);
47+ return (client->noClientException);
48+}
49+
50+static int
51+SProcXCalibrateScreenToCoord (ClientPtr client)
52+{
53+ REQUEST(xXCalibrateScreenToCoordReq);
54+ int n;
55+
56+ REQUEST_SIZE_MATCH (xXCalibrateScreenToCoordReq);
57+
58+ swaps(&stuff->x, n);
59+ swaps(&stuff->y, n);
60+
61+ return ProcXCalibrateScreenToCoord(client);
62+}
63+
64 static void
65 XCalibrateResetProc (ExtensionEntry *extEntry)
66 {
67@@ -194,6 +234,9 @@ ProcXCalibrateDispatch (ClientPtr client
68 return ProcXCalibrateQueryVersion(client);
69 case X_XCalibrateRawMode:
70 return ProcXCalibrateSetRawMode(client);
71+ case X_XCalibrateScreenToCoord:
72+ return ProcXCalibrateScreenToCoord(client);
73+
74 default: break;
75 }
76
77@@ -213,6 +256,8 @@ SProcXCalibrateDispatch (ClientPtr clien
78 return SProcXCalibrateQueryVersion(client);
79 case X_XCalibrateRawMode:
80 return SProcXCalibrateSetRawMode(client);
81+ case X_XCalibrateScreenToCoord:
82+ return SProcXCalibrateScreenToCoord(client);
83
84 default: break;
85 }
86Index: xorg-server-1.1.99.3/hw/kdrive/src/kdrive.h
87===================================================================
88--- xorg-server-1.1.99.3.orig/hw/kdrive/src/kdrive.h 2007-06-30 16:27:13.000000000 +0100
89+++ xorg-server-1.1.99.3/hw/kdrive/src/kdrive.h 2007-06-30 16:30:40.000000000 +0100
90@@ -851,6 +851,9 @@ void
91 KdSetPointerMatrix (KdPointerMatrix *pointer);
92
93 void
94+KdScreenToMouseCoords (int *x, int *y);
95+
96+void
97 KdComputePointerMatrix (KdPointerMatrix *pointer, Rotation randr, int width, int height);
98
99 void
100Index: xorg-server-1.1.99.3/hw/kdrive/src/kinput.c
101===================================================================
102--- xorg-server-1.1.99.3.orig/hw/kdrive/src/kinput.c 2007-06-30 16:27:14.000000000 +0100
103+++ xorg-server-1.1.99.3/hw/kdrive/src/kinput.c 2007-06-30 16:30:16.000000000 +0100
104@@ -570,6 +570,18 @@ KdSetPointerMatrix (KdPointerMatrix *mat
105 }
106
107 void
108+KdScreenToMouseCoords (int *x, int *y)
109+{
110+ int (*m)[3] = kdPointerMatrix.matrix;
111+ int div = m[0][1] * m[1][0] - m[1][1] * m[0][0];
112+ int sx = *x;
113+ int sy = *y;
114+
115+ *x = (m[0][1] * sy - m[0][1] * m[1][2] + m[1][1] * m[0][2] - m[1][1] * sx) / div;
116+ *y = (m[1][0] * sx + m[0][0] * m[1][2] - m[1][0] * m[0][2] - m[0][0] * sy) / div;
117+}
118+
119+void
120 KdComputePointerMatrix (KdPointerMatrix *m, Rotation randr, int width,
121 int height)
122 {
diff --git a/meta/packages/xorg-xserver/xserver-kdrive-xomap_X11R7.1-1.1.99.3.bb b/meta/packages/xorg-xserver/xserver-kdrive-xomap_X11R7.1-1.1.99.3.bb
index 683fbc6067..2ca4fab50b 100644
--- a/meta/packages/xorg-xserver/xserver-kdrive-xomap_X11R7.1-1.1.99.3.bb
+++ b/meta/packages/xorg-xserver/xserver-kdrive-xomap_X11R7.1-1.1.99.3.bb
@@ -1,5 +1,5 @@
1LICENSE = "MIT" 1LICENSE = "MIT"
2DEPENDS = "tslib xproto libxdmcp xextproto xtrans libxau virtual/libx11 libxext libxrandr fixesproto damageproto libxfont resourceproto compositeproto xcalibrateext recordproto videoproto scrnsaverproto xpext xsp libxkbfile dbus" 2DEPENDS = "tslib xproto libxdmcp xextproto xtrans libxau virtual/libx11 libxext libxrandr fixesproto damageproto libxfont resourceproto compositeproto calibrateproto recordproto videoproto scrnsaverproto xpext xsp libxkbfile dbus"
3 3
4PROVIDES = "virtual/xserver" 4PROVIDES = "virtual/xserver"
5PACKAGES =+ "xserver-kdrive-xomap" 5PACKAGES =+ "xserver-kdrive-xomap"
@@ -7,7 +7,7 @@ SECTION = "x11/base"
7DESCRIPTION = "X server from freedesktop.org" 7DESCRIPTION = "X server from freedesktop.org"
8DESCRIPTION_xserver-kdrive-xomap = "X server for the OMAP in the Nokia 800" 8DESCRIPTION_xserver-kdrive-xomap = "X server for the OMAP in the Nokia 800"
9 9
10PR = "r4" 10PR = "r5"
11 11
12COMPATIBLE_MACHINE = "nokia(800|770)" 12COMPATIBLE_MACHINE = "nokia(800|770)"
13 13
@@ -22,7 +22,8 @@ SRC_URI = "http://repository.maemo.org/pool/maemo3.1/free/source/xorg-server_1.1
22 file://xcalibrate.patch;patch=1 \ 22 file://xcalibrate.patch;patch=1 \
23 file://fixups.patch;patch=1 \ 23 file://fixups.patch;patch=1 \
24 file://button_only.patch;patch=1 \ 24 file://button_only.patch;patch=1 \
25 file://calibrateext.patch;patch=1" 25 file://calibrateext.patch;patch=1 \
26 file://xcalibrate_coords.patch;patch=1"
26# file://kdrive-evdev.patch;patch=1 \ 27# file://kdrive-evdev.patch;patch=1 \
27# file://kdrive-use-evdev.patch;patch=1 \ 28# file://kdrive-use-evdev.patch;patch=1 \
28# file://optional-xkb.patch;patch=1 \ 29# file://optional-xkb.patch;patch=1 \
diff --git a/meta/packages/xorg-xserver/xserver-kdrive_1.3.0.0.bb b/meta/packages/xorg-xserver/xserver-kdrive_1.3.0.0.bb
index a10690416e..6982bccb81 100644
--- a/meta/packages/xorg-xserver/xserver-kdrive_1.3.0.0.bb
+++ b/meta/packages/xorg-xserver/xserver-kdrive_1.3.0.0.bb
@@ -3,12 +3,13 @@ require xserver-kdrive-common.inc
3DEPENDS += "libxkbfile libxcalibrate" 3DEPENDS += "libxkbfile libxcalibrate"
4 4
5PE = "1" 5PE = "1"
6PR = "r11" 6PR = "r12"
7 7
8SRC_URI = "${XORG_MIRROR}/individual/xserver/xorg-server-${PV}.tar.bz2 \ 8SRC_URI = "${XORG_MIRROR}/individual/xserver/xorg-server-${PV}.tar.bz2 \
9 ${KDRIVE_COMMON_PATCHES} \ 9 ${KDRIVE_COMMON_PATCHES} \
10 file://fix_default_mode.patch;patch=1 \ 10 file://fix_default_mode.patch;patch=1 \
11 file://enable-xcalibrate.patch;patch=1 \ 11 file://enable-xcalibrate.patch;patch=1 \
12 file://hide-cursor-and-ppm-root.patch;patch=1" 12 file://hide-cursor-and-ppm-root.patch;patch=1 \
13 file://xcalibrate_coords.patch;patch=1"
13 14
14S = "${WORKDIR}/xorg-server-${PV}" 15S = "${WORKDIR}/xorg-server-${PV}"
diff --git a/meta/packages/xorg-xserver/xserver-kdrive_X11R7.1-1.1.0.bb b/meta/packages/xorg-xserver/xserver-kdrive_X11R7.1-1.1.0.bb
index 1182d7d441..053c0abf06 100644
--- a/meta/packages/xorg-xserver/xserver-kdrive_X11R7.1-1.1.0.bb
+++ b/meta/packages/xorg-xserver/xserver-kdrive_X11R7.1-1.1.0.bb
@@ -1,5 +1,5 @@
1LICENSE = "MIT" 1LICENSE = "MIT"
2DEPENDS = "tslib xproto libxdmcp xextproto xtrans libxau virtual/libx11 libxext libxrandr fixesproto damageproto libxfont resourceproto compositeproto xcalibrateext recordproto videoproto scrnsaverproto" 2DEPENDS = "tslib xproto libxdmcp xextproto xtrans libxau virtual/libx11 libxext libxrandr fixesproto damageproto libxfont resourceproto compositeproto calibrateproto recordproto videoproto scrnsaverproto"
3 3
4PROVIDES = "virtual/xserver" 4PROVIDES = "virtual/xserver"
5# RPROVIDES = "virtual/xserver" 5# RPROVIDES = "virtual/xserver"
diff --git a/meta/packages/xorg-xserver/xserver-kdrive_git.bb b/meta/packages/xorg-xserver/xserver-kdrive_git.bb
index 491e486b3d..74323cd320 100644
--- a/meta/packages/xorg-xserver/xserver-kdrive_git.bb
+++ b/meta/packages/xorg-xserver/xserver-kdrive_git.bb
@@ -2,7 +2,7 @@ PV = "1.1.0+git${SRCDATE}"
2DEFAULT_PREFERENCE = "-2" 2DEFAULT_PREFERENCE = "-2"
3 3
4LICENSE = "MIT" 4LICENSE = "MIT"
5DEPENDS = "tslib xproto libxdmcp xextproto xtrans libxau virtual/libx11 libxext libxrandr fixesproto damageproto libxfont resourceproto compositeproto xcalibrateext recordproto videoproto scrnsaverproto" 5DEPENDS = "tslib xproto libxdmcp xextproto xtrans libxau virtual/libx11 libxext libxrandr fixesproto damageproto libxfont resourceproto compositeproto calibrateproto recordproto videoproto scrnsaverproto"
6 6
7PROVIDES = "virtual/xserver" 7PROVIDES = "virtual/xserver"
8RPROVIDES = "virtual/xserver" 8RPROVIDES = "virtual/xserver"
diff --git a/meta/packages/xtscal/xtscal/cleanup.patch b/meta/packages/xtscal/xtscal/cleanup.patch
index fc3ae8b10c..50ce0de884 100644
--- a/meta/packages/xtscal/xtscal/cleanup.patch
+++ b/meta/packages/xtscal/xtscal/cleanup.patch
@@ -1,13 +1,53 @@
1--- 1Index: xtscal-0.6.3/xtscal.in
2 main.c | 45 +++++---------------------------------------- 2===================================================================
3 1 file changed, 5 insertions(+), 40 deletions(-) 3--- xtscal-0.6.3.orig/xtscal.in 2004-09-10 20:10:36.000000000 +0100
4 4+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
5@@ -1,19 +0,0 @@
6-#!/bin/sh
7-
8-module_id() {
9- # Get model name
10- echo `grep "^Hardware" /proc/cpuinfo | sed -e "s/.*: *//" | tr a-z A-Z`
11-}
12-
13-case `module_id` in
14- "HP IPAQ H3100" | "HP IPAQ H3800" )
15- ARGS="-rotate 90" ;;
16- "HP IPAQ H3600" | "HP IPAQ H3700" | "HP IPAQ H3900" | *COLLIE | *POODLE)
17- ARGS="-rotate 270" ;;
18- # H2200: works without rotation
19-esac
20-
21-# the things we do for autoconf
22-prefix=@prefix@
23-exec_prefix=@exec_prefix@
24-exec @libexecdir@/xtscal.bin $ARGS $*
5Index: xtscal-0.6.3/main.c 25Index: xtscal-0.6.3/main.c
6=================================================================== 26===================================================================
7--- xtscal-0.6.3.orig/main.c 2007-06-29 16:49:14.000000000 +0100 27--- xtscal-0.6.3.orig/main.c 2007-06-30 15:46:03.000000000 +0100
8+++ xtscal-0.6.3/main.c 2007-06-29 16:53:11.000000000 +0100 28+++ xtscal-0.6.3/main.c 2007-06-30 15:46:03.000000000 +0100
9@@ -52,8 +52,6 @@ int flag_debug; 29@@ -22,12 +22,10 @@
10 int rotation = 0; 30 #include <X11/Xlib.h>
31
32 #include <X11/extensions/Xrender.h>
33-#include <X11/extensions/Xrandr.h>
34 #include <X11/Xft/Xft.h>
35 #include <X11/extensions/xcalibrate.h>
36 #include <X11/keysym.h>
37
38-#include "h3600_ts.h"
39 #include "calibrate.h"
40
41 Display *dpy;
42@@ -45,15 +43,11 @@ XftColor xftcol;
43 XftDraw *xftdraw;
44 XftFont *xftfont;
45 int screen_x, screen_y;
46-int ts_fd;
47 int samples;
48 Pixmap bg_pixmap;
49 int flag_debug;
50-int rotation = 0;
11 int error_base, event_base; 51 int error_base, event_base;
12 52
13-int using_xcalibrate; 53-int using_xcalibrate;
@@ -15,7 +55,7 @@ Index: xtscal-0.6.3/main.c
15 int moving; 55 int moving;
16 56
17 #define CROSSHAIR_SIZE 25 57 #define CROSSHAIR_SIZE 25
18@@ -63,7 +61,6 @@ int moving; 58@@ -63,7 +57,6 @@ int moving;
19 #define ENOUGH 5 59 #define ENOUGH 5
20 #define MAX_SAMPLES 40 60 #define MAX_SAMPLES 40
21 61
@@ -23,8 +63,12 @@ Index: xtscal-0.6.3/main.c
23 #define FONTNAME "sans-10" 63 #define FONTNAME "sans-10"
24 64
25 struct point 65 struct point
26@@ -291,8 +288,6 @@ set_calibration (calibration *cal) 66@@ -287,12 +280,8 @@ sort_by_y (const void* a, const void *b)
27 int xtrans, ytrans, xscale, yscale, xyscale, yxscale; 67 void
68 set_calibration (calibration *cal)
69 {
70- TS_CAL tc;
71- int xtrans, ytrans, xscale, yscale, xyscale, yxscale;
28 calibration ocal = *cal; 72 calibration ocal = *cal;
29 73
30- if (using_xcalibrate) 74- if (using_xcalibrate)
@@ -32,7 +76,7 @@ Index: xtscal-0.6.3/main.c
32 FILE *fp; 76 FILE *fp;
33 if (flag_debug) 77 if (flag_debug)
34 printf ("constants are: %d %d %d %d %d %d %d\n", cal->a[1], cal->a[2], cal->a[0], cal->a[4], cal->a[5], cal->a[3], cal->a[6]); 78 printf ("constants are: %d %d %d %d %d %d %d\n", cal->a[1], cal->a[2], cal->a[0], cal->a[4], cal->a[5], cal->a[3], cal->a[6]);
35@@ -304,29 +299,6 @@ set_calibration (calibration *cal) 79@@ -304,29 +293,6 @@ set_calibration (calibration *cal)
36 } 80 }
37 fprintf (fp, "%d %d %d %d %d %d %d\n", cal->a[1], cal->a[2], cal->a[0], cal->a[4], cal->a[5], cal->a[3], cal->a[6]); 81 fprintf (fp, "%d %d %d %d %d %d %d\n", cal->a[1], cal->a[2], cal->a[0], cal->a[4], cal->a[5], cal->a[3], cal->a[6]);
38 fclose (fp); 82 fclose (fp);
@@ -62,21 +106,204 @@ Index: xtscal-0.6.3/main.c
62 } 106 }
63 107
64 void 108 void
65@@ -531,8 +503,11 @@ main (int argc, char *argv[]) 109@@ -398,80 +364,13 @@ handle_ts_event (int x, int y, int press
110 }
111
112 void
113-read_ts (void)
114-{
115- TS_EVENT ts_ev;
116- int r;
117-
118- r = read (ts_fd, &ts_ev, sizeof (ts_ev));
119- if (r == sizeof (ts_ev))
120- handle_ts_event (ts_ev.x, ts_ev.y, ts_ev.pressure);
121-}
122-
123-void
124-do_cal (char **args)
125-{
126- TS_CAL tc;
127-
128- tc.xscale = atoi (args[0]);
129- tc.xtrans = atoi (args[1]);
130- tc.yscale = atoi (args[2]);
131- tc.ytrans = atoi (args[3]);
132- tc.xyswap = atoi (args[4]);
133-
134- if (flag_debug)
135- fprintf (stderr, "setting: %d %d %d %d %d\n",
136- tc.xtrans, tc.ytrans, tc.xscale, tc.yscale, tc.xyswap);
137-
138- if (ioctl (ts_fd, TS_SET_CAL, (void *)&tc) != 0)
139- {
140- perror ("TS_SET_CAL");
141- exit (1);
142- }
143-
144- exit (0);
145-}
146-
147-void
148-show_cal (void)
149-{
150- TS_CAL tc;
151-
152- if (ioctl (ts_fd, TS_GET_CAL, (void *)&tc) != 0)
153- {
154- perror ("TS_GET_CAL");
155- exit (1);
156- }
157-
158- printf ("%d %d %d %d %d\n", tc.xscale, tc.xtrans, tc.yscale, tc.ytrans, tc.xyswap);
159-}
160-
161-void
162 usage (const char *name)
163 {
164- fprintf (stderr, "usage: %s -view\n", name);
165- fprintf (stderr, " %s [-rotate <0 | 90 | 180 | 270>]\n", name);
166- fprintf (stderr, " %s -cal <xs> <xt> <ys> <yt> <xyswap>\n", name);
167-
168+ fprintf (stderr, "usage: %s [-debug]\n", name);
169 exit (1);
170 }
171
172 int
173-xrr_supported (void)
174-{
175- int xrr_event_base, xrr_error_base;
176- int xrr_major, xrr_minor;
177-
178- if (XRRQueryExtension (dpy, &xrr_event_base, &xrr_error_base) == False
179- || XRRQueryVersion (dpy, &xrr_major, &xrr_minor) == 0
180- || xrr_major != 1
181- || xrr_minor < 1)
182- return 0;
183-
184- return 1;
185-}
186-
187-int
188 main (int argc, char *argv[])
189 {
190 XSetWindowAttributes attributes;
191@@ -480,31 +379,11 @@ main (int argc, char *argv[])
192 int max_fd;
193 GC bg_gc;
194 int i;
195- int have_xrandr;
196
197 for (i = 1; i < argc; i++)
198 {
199- if (!strcmp (argv[i], "-view"))
200- {
201- show_cal ();
202- exit (0);
203- }
204- else if (!strcmp (argv[i], "-debug"))
205+ if (!strcmp (argv[i], "-debug"))
206 flag_debug = 1;
207- else if (!strcmp (argv[i], "-cal"))
208- {
209- if (argc > (i + 5))
210- do_cal (argv + i + 1);
211- else
212- usage (argv[0]);
213- }
214- else if (!strcmp (argv[i], "-rotate"))
215- {
216- if (argc > (i + 1))
217- rotation = atoi (argv[++i]);
218- else
219- usage (argv[0]);
220- }
221 else
222 usage (argv[0]);
223 }
224@@ -531,48 +410,11 @@ main (int argc, char *argv[])
66 fprintf (stderr, "failed to set raw mode: error %d\n", r); 225 fprintf (stderr, "failed to set raw mode: error %d\n", r);
67 exit (1); 226 exit (1);
68 } 227 }
69- 228-
70- using_xcalibrate = 1; 229- using_xcalibrate = 1;
71+ } 230- }
72+ else 231-
73+ { 232- have_xrandr = xrr_supported ();
233- if (have_xrandr)
234- {
235- XRRScreenConfiguration *rr_screen;
236- Rotation current_rotation;
237-
238- if (flag_debug)
239- fprintf (stderr, "XRANDR is supported\n");
240-
241- rr_screen = XRRGetScreenInfo (dpy, RootWindow (dpy, screen));
242-
243- XRRRotations (dpy, screen, &current_rotation);
244-
245- XRRFreeScreenConfigInfo (rr_screen);
246-
247- if (flag_debug)
248- fprintf (stderr, "Current RANDR rotation is %d\n", current_rotation);
249-
250- switch (current_rotation)
251- {
252- case RR_Rotate_270:
253- rotation += 90;
254- case RR_Rotate_180:
255- rotation += 90;
256- case RR_Rotate_90:
257- rotation += 90;
258- rotation %= 360;
259- case RR_Rotate_0:
260- break;
261- default:
262- fprintf (stderr, "Unknown RANDR rotation: %d\n", current_rotation);
263- break;
264- }
265 }
266 else
267 {
268- if (flag_debug)
269- fprintf (stderr, "XRANDR not supported\n");
74+ perror ("XCALIBRATE extension missing"); 270+ perror ("XCALIBRATE extension missing");
75+ exit (1); 271+ exit (1);
76 } 272 }
77 273
78 have_xrandr = xrr_supported (); 274 attributes.override_redirect = flag_debug ? False : True;
79@@ -693,16 +668,6 @@ main (int argc, char *argv[]) 275@@ -666,45 +508,17 @@ main (int argc, char *argv[])
276
277 for (i = 0; i < NR_POINTS; i++)
278 {
279- switch (rotation)
280- {
281- case 0:
282- cal.xfb[i] = cal.xscr[i];
283- cal.yfb[i] = cal.yscr[i];
284- break;
285- case 90:
286- cal.xfb[i] = cal.yscr[i];
287- cal.yfb[i] = screen_x - cal.xscr[i];
288- break;
289- case 180:
290- cal.xfb[i] = screen_x - cal.xscr[i];
291- cal.yfb[i] = screen_y - cal.yscr[i];
292- break;
293- case 270:
294- cal.xfb[i] = screen_y - cal.yscr[i];
295- cal.yfb[i] = cal.xscr[i];
296- break;
297- }
298+ cal.xfb[i] = cal.xscr[i];
299+ cal.yfb[i] = cal.yscr[i];
300+ XCalibrateScreenToCoord (dpy, &cal.xfb[i], &cal.yfb[i]);
301
302 if (flag_debug)
303- printf ("rotation %d: (%d,%d) -> (%d,%d)\n", rotation,
304+ printf ("rotation conversion: (%d,%d) -> (%d,%d)\n",
305 cal.xscr[i], cal.yscr[i], cal.xfb[i], cal.yfb[i]);
306 }
80 307
81 next_event (); 308 next_event ();
82 309
@@ -90,6 +317,294 @@ Index: xtscal-0.6.3/main.c
90- } 317- }
91- } 318- }
92- 319-
93 max_fd = (xfd > ts_fd) ? xfd : ts_fd; 320- max_fd = (xfd > ts_fd) ? xfd : ts_fd;
94 321-
95 for (;;) 322 for (;;)
323 {
324 fd_set fds;
325@@ -713,12 +527,8 @@ main (int argc, char *argv[])
326
327 FD_ZERO (&fds);
328 FD_SET (xfd, &fds);
329- if (ts_fd != -1)
330- FD_SET (ts_fd, &fds);
331
332- select (max_fd + 1, &fds, NULL, NULL, NULL);
333-
334- if (ts_fd != -1 && FD_ISSET (ts_fd, &fds))
335- read_ts ();
336+ select (xfd + 1, &fds, NULL, NULL, NULL);
337 }
338 }
339+
340Index: xtscal-0.6.3/configure.ac
341===================================================================
342--- xtscal-0.6.3.orig/configure.ac 2004-09-10 20:11:12.000000000 +0100
343+++ xtscal-0.6.3/configure.ac 2007-06-30 15:46:03.000000000 +0100
344@@ -9,8 +9,7 @@ AM_INIT_AUTOMAKE([foreign dist-bzip2])
345 # Checks for programs.
346 AC_PROG_CC
347
348-PKG_CHECK_MODULES(XTSCAL, x11 xft xext xrandr xcalibrate)
349+PKG_CHECK_MODULES(XTSCAL, x11 xft xext xcalibrate)
350
351 AC_CONFIG_FILES([Makefile])
352-AC_CONFIG_FILES([xtscal])
353 AC_OUTPUT
354Index: xtscal-0.6.3/gpe-dist.am
355===================================================================
356--- xtscal-0.6.3.orig/gpe-dist.am 2004-06-02 23:07:13.000000000 +0100
357+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
358@@ -1,12 +0,0 @@
359-CVSTAG := $(shell echo $(PACKAGE)-$(VERSION) | tr [a-z.] [A-Z_])
360-
361-dist-upload: dist
362- scp $(PACKAGE)-$(VERSION).tar.bz2 $(USER)@handhelds.org:/home/ftp/pub/projects/gpe/source/
363-
364-tag:
365- cvs tag $(CVSTAG)
366-
367-retag:
368- cvs tag -F $(CVSTAG)
369-
370-source: tag dist-upload
371Index: xtscal-0.6.3/h3600_ts.h
372===================================================================
373--- xtscal-0.6.3.orig/h3600_ts.h 2003-07-05 17:27:10.000000000 +0100
374+++ /dev/null 1970-01-01 00:00:00.000000000 +0000
375@@ -1,216 +0,0 @@
376-/*
377-*
378-* Driver for the H3600 Touch Screen and other Atmel controlled devices.
379-*
380-* Copyright 2000 Compaq Computer Corporation.
381-*
382-* Use consistent with the GNU GPL is permitted,
383-* provided that this copyright notice is
384-* preserved in its entirety in all copies and derived works.
385-*
386-* COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
387-* AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
388-* FITNESS FOR ANY PARTICULAR PURPOSE.
389-*
390-* Author: Charles Flynn.
391-*
392-*/
393-
394-
395-#ifndef __H3600_TS_H__
396-#define __H3600_TS_H__
397-
398-#include <linux/ioctl.h>
399-
400-enum h3600_ts_minor_devices {
401- TS_MINOR = 0,
402- TSRAW_MINOR = 1,
403- KEY_MINOR = 2
404-};
405-
406-typedef struct h3600_ts_calibration {
407- int xscale;
408- int xtrans;
409- int yscale;
410- int ytrans;
411- int xyswap;
412-} TS_CAL;
413-
414-typedef struct h3600_ts_event {
415- unsigned short pressure;
416- unsigned short x;
417- unsigned short y;
418- unsigned short pad;
419-} TS_EVENT;
420-
421-/* Deprecated - do not use */
422-typedef struct h3600_ts_return {
423- unsigned short pressure;
424- unsigned short x;
425- unsigned short y;
426- unsigned short pad;
427-} TS_RET;
428-
429-enum power_button_mode {
430- PBM_SUSPEND = 0,
431- PBM_GENERATE_KEYPRESS = 1
432-};
433-
434-
435-/* ++++++++++++++ +++++++++++++++++++++++++++++++++++++ */
436-
437-typedef struct therm_dev {
438- short data;
439-} THERM_DEV;
440-
441-#define H3600_BATT_CHEM_ALKALINE 0x01
442-#define H3600_BATT_CHEM_NICD 0x02
443-#define H3600_BATT_CHEM_NIMH 0x03
444-#define H3600_BATT_CHEM_LION 0x04
445-#define H3600_BATT_CHEM_LIPOLY 0x05
446-#define H3600_BATT_CHEM_NOT_INSTALLED 0x06
447-#define H3600_BATT_CHEM_UNKNOWN 0xff
448-
449-/* These should match the apm_bios.h definitions */
450-#define H3600_AC_STATUS_AC_OFFLINE 0x00
451-#define H3600_AC_STATUS_AC_ONLINE 0x01
452-#define H3600_AC_STATUS_AC_BACKUP 0x02 /* What does this mean? */
453-#define H3600_AC_STATUS_AC_UNKNOWN 0xff
454-
455-/* These bitfields are rarely "or'd" together */
456-#define H3600_BATT_STATUS_HIGH 0x01
457-#define H3600_BATT_STATUS_LOW 0x02
458-#define H3600_BATT_STATUS_CRITICAL 0x04
459-#define H3600_BATT_STATUS_CHARGING 0x08
460-#define H3600_BATT_STATUS_CHARGE_MAIN 0x10
461-#define H3600_BATT_STATUS_DEAD 0x20 /* Battery will not charge */
462-#define H3600_BATT_NOT_INSTALLED 0x20 /* For expansion pack batteries */
463-#define H3600_BATT_STATUS_FULL 0x40 /* Battery fully charged (and connected to AC) */
464-#define H3600_BATT_STATUS_NOBATT 0x80
465-#define H3600_BATT_STATUS_UNKNOWN 0xff
466-
467-struct battery_data {
468- unsigned char chemistry;
469- unsigned char status;
470- unsigned short voltage; /* Voltage for battery #0; unknown for battery #1 */
471- unsigned short percentage; /* Percentage of full charge */
472- unsigned short life; /* Life remaining in minutes */
473-};
474-
475-struct h3600_battery {
476- unsigned char ac_status;
477- unsigned char battery_count; /* How many batteries we have */
478- struct battery_data battery[2];
479-};
480-
481-/* -------- EEPROM and SPI Interfaces ---------------*/
482-
483-#define EEPROM_RD_BUFSIZ 6 /* EEPROM reads are 16 bits */
484-#define EEPROM_WR_BUFSIZ 5 /* Allow room for 8bit 'addr' field in buffer*/
485-#define SPI_RD_BUFSIZ 16 /* SPI reads are 8 bits */
486-#define SPI_WR_BUFSIZ 7
487-
488-/* The EEPROM is where internal programs are stored on the Amtel.
489- You probably don't want to read or write these values */
490-
491-typedef struct h3600_eeprom_read_request {
492- unsigned char addr; /* 8bit Address Offset 0-255 */
493- unsigned char len; /* Number of 16bit words to read 0-128 */
494- unsigned short buff[EEPROM_RD_BUFSIZ];
495-} EEPROM_READ;
496-
497-typedef struct h3600_eeprom_write_request {
498- unsigned char len; /* used only to compute the number of bytes to send */
499- unsigned char addr; /* 0-128 */
500- unsigned short buff[EEPROM_WR_BUFSIZ];
501-} EEPROM_WRITE;
502-
503-/* The SPI bus connects to EEPROMs located on sleeves plugged into
504- the iPAQ. You may want to read these values */
505-
506-typedef struct h3600_spi_read_request {
507- unsigned short addr; /* 16bit Address Offset 0-128 */
508- unsigned char len; /* Number of bytes to read */
509- unsigned char buff[SPI_RD_BUFSIZ];
510-} SPI_READ;
511-
512-#define SPI_READ_STATUS_BYTE 0xffff /* Use this address to read the status byte */
513-
514-typedef struct h3600_spi_write_request {
515- unsigned short len; /* used only to compute the number of bytes to send */
516- unsigned short addr; /* this 16bit address accesses a single byte */
517- unsigned char buff[SPI_WR_BUFSIZ];
518-} SPI_WRITE;
519-
520-
521-/* -------- end of EEPROM and SPI Interfaces ---------------*/
522-
523-/* User space structures for IOCTL calls */
524-
525-typedef struct h3600_ts_version {
526- unsigned char host_version[8]; /* ascii "x.yy" */
527- unsigned char pack_version[8]; /* ascii "x.yy" */
528- unsigned char boot_type; /* TODO ?? */
529-} VER_RET;
530-
531-typedef struct h3600_ts_led {
532- unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */
533- unsigned char TotalTime; /* Units of 5 seconds */
534- unsigned char OnTime; /* units of 100m/s */
535- unsigned char OffTime; /* units of 100m/s */
536-} LED_IN;
537-
538-enum flite_mode {
539- FLITE_MODE1 = 1,
540- FLITE_AUTO_MODE = 1, /* for reference only */
541- FLITE_MANUAL_MODE = 2, /* Use this normally? */
542- FLITE_GET_LIGHT_SENSOR = 3 /* Returns light reading in "brightness" field */
543-};
544-enum flite_pwr {
545- FLITE_PWR_OFF = 0,
546- FLITE_PWR_ON = 1
547-};
548-
549-typedef struct h3600_ts_flite {
550- unsigned char mode;
551- unsigned char pwr;
552- unsigned char brightness;
553-} FLITE_IN;
554-
555-/*************************** Updated "universal" structures *******************/
556-
557-/* Sets backlight for both H3100 and H3600 models - technically "frontlight" for H3600 */
558-struct h3600_ts_backlight {
559- enum flite_pwr power; /* 0 = off, 1 = on */
560- unsigned char brightness; /* 0 - 255 */
561-};
562-
563-struct h3600_ts_contrast { /* Only useful on H3100 model */
564- unsigned char contrast; /* 0 - 255 */
565-};
566-
567-/* IOCTL cmds user or kernel space */
568-
569-/* Use 'f' as magic number */
570-#define IOC_H3600_TS_MAGIC 'f'
571-
572-/* TODO: Some of these IOWR values are just plain wrong */
573-#define GET_VERSION _IOR(IOC_H3600_TS_MAGIC, 1, struct h3600_ts_version )
574-#define READ_EEPROM _IOWR(IOC_H3600_TS_MAGIC, 2, struct h3600_eeprom_read_request)
575-#define WRITE_EEPROM _IOWR(IOC_H3600_TS_MAGIC, 3, struct h3600_eeprom_write_request)
576-#define GET_THERMAL _IOR(IOC_H3600_TS_MAGIC, 4, struct therm_dev)
577-#define LED_ON _IOW(IOC_H3600_TS_MAGIC, 5, struct h3600_ts_led)
578-#define GET_BATTERY_STATUS _IOR(IOC_H3600_TS_MAGIC, 6, struct h3600_battery)
579-#define FLITE_ON _IOW(IOC_H3600_TS_MAGIC, 7, struct h3600_ts_flite)
580-#define READ_SPI _IOWR(IOC_H3600_TS_MAGIC, 8, struct h3600_spi_read_request)
581-#define WRITE_SPI _IOWR(IOC_H3600_TS_MAGIC, 9, struct h3600_spi_write_request)
582-#define TS_GET_CAL _IOR(IOC_H3600_TS_MAGIC, 10, struct h3600_ts_calibration)
583-#define TS_SET_CAL _IOW(IOC_H3600_TS_MAGIC, 11, struct h3600_ts_calibration)
584-
585-/* New IOCTL interfaces - defined to be more user friendly */
586-#define TS_GET_BACKLIGHT _IOR(IOC_H3600_TS_MAGIC, 20, struct h3600_ts_backlight)
587-#define TS_SET_BACKLIGHT _IOW(IOC_H3600_TS_MAGIC, 20, struct h3600_ts_backlight)
588-#define TS_GET_CONTRAST _IOR(IOC_H3600_TS_MAGIC, 21, struct h3600_ts_contrast)
589-#define TS_SET_CONTRAST _IOW(IOC_H3600_TS_MAGIC, 21, struct h3600_ts_contrast)
590-
591-#endif
592Index: xtscal-0.6.3/Makefile.am
593===================================================================
594--- xtscal-0.6.3.orig/Makefile.am 2004-06-02 23:07:13.000000000 +0100
595+++ xtscal-0.6.3/Makefile.am 2007-06-30 15:46:03.000000000 +0100
596@@ -1,11 +1,8 @@
597-libexec_PROGRAMS = xtscal.bin
598-bin_SCRIPTS = xtscal
599+libexec_PROGRAMS = xtscal
600
601-xtscal_bin_SOURCES = main.c calibrate.c calibrate.h h3600_ts.h
602+xtscal_SOURCES = main.c calibrate.c calibrate.h
603
604-xtscal_bin_LDADD = @XTSCAL_LIBS@
605+xtscal_LDADD = @XTSCAL_LIBS@
606
607 INCLUDES = @XTSCAL_CFLAGS@ -DNR_POINTS=5
608
609-include gpe-dist.am
610-
diff --git a/meta/packages/xtscal/xtscal/formfactor.patch b/meta/packages/xtscal/xtscal/formfactor.patch
deleted file mode 100644
index 79548000bc..0000000000
--- a/meta/packages/xtscal/xtscal/formfactor.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1---
2 xtscal.in | 17 ++---------------
3 1 file changed, 2 insertions(+), 15 deletions(-)
4
5Index: xtscal-0.6.3/xtscal.in
6===================================================================
7--- xtscal-0.6.3.orig/xtscal.in 2007-06-29 16:46:18.000000000 +0100
8+++ xtscal-0.6.3/xtscal.in 2007-06-29 16:48:18.000000000 +0100
9@@ -1,19 +1,6 @@
10 #!/bin/sh
11
12-module_id() {
13- # Get model name
14- echo `grep "^Hardware" /proc/cpuinfo | sed -e "s/.*: *//" | tr a-z A-Z`
15-}
16-
17-case `module_id` in
18- "HP IPAQ H3100" | "HP IPAQ H3800" )
19- ARGS="-rotate 90" ;;
20- "HP IPAQ H3600" | "HP IPAQ H3700" | "HP IPAQ H3900" | *COLLIE | *POODLE)
21- ARGS="-rotate 270" ;;
22- # H2200: works without rotation
23-esac
24+. /etc/formfactor/config
25
26 # the things we do for autoconf
27-prefix=@prefix@
28-exec_prefix=@exec_prefix@
29-exec @libexecdir@/xtscal.bin $ARGS $*
30+exec @libexecdir@/xtscal.bin -rotate ${DISPLAY_ORIENTATION} $*
diff --git a/meta/packages/xtscal/xtscal_0.6.3.bb b/meta/packages/xtscal/xtscal_0.6.3.bb
index 19732101d4..6c6cd063ea 100644
--- a/meta/packages/xtscal/xtscal_0.6.3.bb
+++ b/meta/packages/xtscal/xtscal_0.6.3.bb
@@ -2,14 +2,12 @@ LICENSE = "GPL"
2DESCRIPTION = "Touchscreen calibration utility" 2DESCRIPTION = "Touchscreen calibration utility"
3SECTION = "x11/base" 3SECTION = "x11/base"
4 4
5DEPENDS = "virtual/libx11 libxft libxrandr xcalibrate" 5DEPENDS = "virtual/libx11 libxft libxcalibrate"
6RDEPENDS = "formfactor"
7 6
8PR = "r3" 7PR = "r5"
9 8
10SRC_URI = "${GPE_MIRROR}/xtscal-${PV}.tar.bz2 \ 9SRC_URI = "${GPE_MIRROR}/xtscal-${PV}.tar.bz2 \
11 file://change-cross.patch;patch=1 \ 10 file://change-cross.patch;patch=1 \
12 file://formfactor.patch;patch=1 \
13 file://cleanup.patch;patch=1" 11 file://cleanup.patch;patch=1"
14 12
15inherit autotools 13inherit autotools