View | Details | Raw Unified | Return to bug 216271
Collapse All | Expand All

(-)x11-drivers/xf86-input-elographics/Makefile (-1 / +1 lines)
Lines 2-8 Link Here
2
2
3
PORTNAME=	xf86-input-elographics
3
PORTNAME=	xf86-input-elographics
4
PORTVERSION=	1.4.1
4
PORTVERSION=	1.4.1
5
PORTREVISION=	4
5
PORTREVISION=	5
6
CATEGORIES=	x11-drivers
6
CATEGORIES=	x11-drivers
7
7
8
MAINTAINER=	x11@FreeBSD.org
8
MAINTAINER=	x11@FreeBSD.org
(-)x11-drivers/xf86-input-elographics/files/patch-git_01_0d3ec2e (+80 lines)
Line 0 Link Here
1
From 0d3ec2e97c99431cdbaea8e958a75ff2e748da41 Mon Sep 17 00:00:00 2001
2
From: Jaska Kivela <jaska@kivela.net>
3
Date: Wed, 16 Jan 2013 11:51:04 +0200
4
Subject: Added axis inversion functionality.
5
6
The module would previously log a message if min > max, but not do anything
7
about it. Keep the original min/max around, swap on-the-fly.
8
9
Signed-off-by: Jaska Kivela <jaska@kivela.net>
10
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
11
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
12
13
diff --git a/src/xf86Elo.c b/src/xf86Elo.c
14
index cb1699e..c37cf9a 100644
15
--- src/xf86Elo.c
16
+++ src/xf86Elo.c
17
@@ -360,6 +360,22 @@ xf86EloReadInput(InputInfoPtr	pInfo)
18
           cur_y = WORD_ASSEMBLY(priv->packet_buf[5], priv->packet_buf[6]);
19
           state = priv->packet_buf[2] & 0x07;
20
 
21
+          DBG(5, ErrorF("ELO got: x(%d), y(%d), %s\n",
22
+                      cur_x, cur_y,
23
+                      (state == ELO_PRESS) ? "Press" :
24
+			((state == ELO_RELEASE) ? "Release" : "Stream")));
25
+
26
+          if (priv->min_y > priv->max_y) {
27
+            /* inverted y axis */
28
+            cur_y = priv->max_y - cur_y + priv->min_y;
29
+          }
30
+
31
+          if (priv->min_x > priv->max_x) {
32
+            /* inverted x axis */
33
+            cur_x = priv->max_x - cur_x + priv->min_x;
34
+          }
35
+
36
+
37
           /*
38
            * Send events.
39
            *
40
@@ -676,6 +692,7 @@ xf86EloControl(DeviceIntPtr	dev,
41
   unsigned char		reply[ELO_PACKET_SIZE];
42
   Atom btn_label;
43
   Atom axis_labels[2] = { 0, 0 };
44
+  int x0, x1, y0, y1;
45
 
46
   switch(mode) {
47
 
48
@@ -719,17 +736,27 @@ xf86EloControl(DeviceIntPtr	dev,
49
 	return !Success;
50
       }
51
       else {
52
+
53
+	/* Correct the coordinates for possibly inverted axis.
54
+	   Leave priv->variables untouched so we can check for
55
+	   inversion on incoming events.
56
+	 */
57
+	y0 = min(priv->min_y, priv->max_y);
58
+	y1 = max(priv->min_y, priv->max_y);
59
+	x0 = min(priv->min_x, priv->max_x);
60
+	x1 = max(priv->min_x, priv->max_x);
61
+
62
 	/* I will map coordinates myself */
63
 	InitValuatorAxisStruct(dev, 0,
64
 			       axis_labels[0],
65
-			       priv->min_x, priv->max_x,
66
+			       x0, x1,
67
 			       9500,
68
 			       0     /* min_res */,
69
 			       9500  /* max_res */,
70
 			       Absolute);
71
 	InitValuatorAxisStruct(dev, 1,
72
 			       axis_labels[1],
73
-			       priv->min_y, priv->max_y,
74
+			       y0, y1,
75
 			       10500,
76
 			       0     /* min_res */,
77
 			       10500 /* max_res */,
78
-- 
79
cgit v0.10.2
80
(-)x11-drivers/xf86-input-elographics/files/patch-git_02_c666c78 (+28 lines)
Line 0 Link Here
1
From c666c78c764d0b97fa25bd9f0796a83b77761f7d Mon Sep 17 00:00:00 2001
2
From: Peter Hutterer <peter.hutterer@who-t.net>
3
Date: Wed, 30 Jan 2013 11:47:03 +1000
4
Subject: Handle DEVICE_ABORT on input ABI 19.1
5
6
Don't do anything, but don't print a warning either.
7
8
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
9
10
diff --git a/src/xf86Elo.c b/src/xf86Elo.c
11
index c37cf9a..ef2186f 100644
12
--- src/xf86Elo.c
13
+++ src/xf86Elo.c
14
@@ -875,6 +875,11 @@ xf86EloControl(DeviceIntPtr	dev,
15
     DBG(2, ErrorF("Done\n"));
16
     return Success;
17
 
18
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) * 100 + GET_ABI_MINOR(ABI_XINPUT_VERSION) >= 1901
19
+  case DEVICE_ABORT:
20
+    return Success;
21
+#endif
22
+
23
   default:
24
       ErrorF("unsupported mode=%d\n", mode);
25
       return BadValue;
26
-- 
27
cgit v0.10.2
28

Return to bug 216271