summaryrefslogtreecommitdiffstats
path: root/patches
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2012-06-14 23:28:40 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2012-06-14 23:28:49 +0200
commit57020be09fa1fa8672fca30dc3326ef3d75df900 (patch)
tree908e819083a2cf0a18f983925d1695c24bdde8e0 /patches
parent0a29e2164a07680a6459cd3b663d99032aa08d3c (diff)
downloadptxdist-57020be09fa1fa8672fca30dc3326ef3d75df900.tar.gz
ptxdist-57020be09fa1fa8672fca30dc3326ef3d75df900.tar.xz
xorg-driver-input-tslib: fix building with latest xorg
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches')
-rw-r--r--patches/xf86-input-tslib-0.0.6/0001-fix-segfault.patch41
-rw-r--r--patches/xf86-input-tslib-0.0.6/0002-add-support-for-ABI-12.patch213
-rw-r--r--patches/xf86-input-tslib-0.0.6/series5
3 files changed, 259 insertions, 0 deletions
diff --git a/patches/xf86-input-tslib-0.0.6/0001-fix-segfault.patch b/patches/xf86-input-tslib-0.0.6/0001-fix-segfault.patch
new file mode 100644
index 000000000..aa2b747c5
--- /dev/null
+++ b/patches/xf86-input-tslib-0.0.6/0001-fix-segfault.patch
@@ -0,0 +1,41 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Thu, 14 Jun 2012 23:27:04 +0200
+Subject: [PATCH] fix segfault
+
+Based on a patch from Debian.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ src/tslib.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/tslib.c b/src/tslib.c
+index 08923b2..065e6cf 100644
+--- a/src/tslib.c
++++ b/src/tslib.c
+@@ -103,8 +103,6 @@ KeyControlProc(DeviceIntPtr pDev, KeybdCtrl * ctrl)
+ static void
+ PointerControlProc(DeviceIntPtr dev, PtrCtrl * ctrl)
+ {
+- ErrorF("%s\n", __FUNCTION__);
+- return;
+ }
+
+ static Bool
+@@ -406,6 +404,8 @@ xf86TslibControlProc(DeviceIntPtr device, int what)
+ xf86MotionHistoryAllocate(pInfo);
+ #endif
+
++ if (!InitPtrFeedbackClassDeviceStruct(device, PointerControlProc))
++ return !Success;
+ break;
+
+ case DEVICE_ON:
+@@ -435,6 +435,7 @@ xf86TslibUninit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+ xf86TslibControlProc(pInfo->dev, DEVICE_OFF);
+ ts_close(priv->ts);
+ xfree(pInfo->private);
++ pInfo->private = NULL;
+ xf86DeleteInput(pInfo, 0);
+ }
+
diff --git a/patches/xf86-input-tslib-0.0.6/0002-add-support-for-ABI-12.patch b/patches/xf86-input-tslib-0.0.6/0002-add-support-for-ABI-12.patch
new file mode 100644
index 000000000..9275daea3
--- /dev/null
+++ b/patches/xf86-input-tslib-0.0.6/0002-add-support-for-ABI-12.patch
@@ -0,0 +1,213 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Thu, 14 Jun 2012 23:27:43 +0200
+Subject: [PATCH] add support for ABI 12
+
+Based on the patch from Debian.
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ src/tslib.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++------------
+ 1 file changed, 67 insertions(+), 16 deletions(-)
+
+diff --git a/src/tslib.c b/src/tslib.c
+index 065e6cf..0446148 100644
+--- a/src/tslib.c
++++ b/src/tslib.c
+@@ -69,6 +69,13 @@
+ #define DEFAULT_HEIGHT 240
+ #define DEFAULT_WIDTH 320
+
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
++#define COLLECT_INPUT_OPTIONS(pInfo, options) xf86CollectInputOptions((pInfo), (options), NULL)
++#else
++#define COLLECT_INPUT_OPTIONS(pInfo, options) xf86CollectInputOptions((pInfo), (options))
++#endif
++
++
+ enum { TSLIB_ROTATE_NONE=0, TSLIB_ROTATE_CW=270, TSLIB_ROTATE_UD=180, TSLIB_ROTATE_CCW=90 };
+
+ enum button_state { BUTTON_NOT_PRESSED = 0, BUTTON_1_PRESSED = 1, BUTTON_3_CLICK = 3, BUTTON_3_CLICKED=4, BUTTON_EMULATION_OFF=-1 };
+@@ -106,7 +113,7 @@ PointerControlProc(DeviceIntPtr dev, PtrCtrl * ctrl)
+ }
+
+ static Bool
+-ConvertProc( LocalDevicePtr local,
++ConvertProc( InputInfoPtr local,
+ int first,
+ int num,
+ int v0,
+@@ -135,7 +142,7 @@ struct timeval TimevalDiff(struct timeval a, struct timeval b)
+ return t;
+ }
+
+-static void ReadInput (LocalDevicePtr local)
++static void ReadInput (InputInfoPtr local)
+ {
+ struct ts_priv *priv = (struct ts_priv *) (local->private);
+ struct ts_sample samp;
+@@ -382,7 +389,11 @@ xf86TslibControlProc(DeviceIntPtr device, int what)
+ axiswidth - 1, /* max val */
+ axiswidth, /* resolution */
+ 0, /* min_res */
+- axiswidth); /* max_res */
++ axiswidth /* max_res */
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
++ ,Absolute
++#endif
++ );
+
+ InitValuatorAxisStruct(device, 1,
+ #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+@@ -392,7 +403,11 @@ xf86TslibControlProc(DeviceIntPtr device, int what)
+ axisheight - 1, /* max val */
+ axisheight, /* resolution */
+ 0, /* min_res */
+- axisheight); /* max_res */
++ axisheight /* max_res */
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
++ ,Absolute
++#endif
++ );
+
+ if (InitProximityClassDeviceStruct (device) == FALSE) {
+ ErrorF ("Unable to allocate EVTouch touchscreen ProximityClassDeviceStruct\n");
+@@ -434,7 +449,7 @@ xf86TslibUninit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+ ErrorF("%s\n", __FUNCTION__);
+ xf86TslibControlProc(pInfo->dev, DEVICE_OFF);
+ ts_close(priv->ts);
+- xfree(pInfo->private);
++ free(pInfo->private);
+ pInfo->private = NULL;
+ xf86DeleteInput(pInfo, 0);
+ }
+@@ -444,47 +459,61 @@ xf86TslibUninit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+ *
+ * called when the module subsection is found in XF86Config
+ */
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
++static int
++xf86TslibInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
++#else
+ static InputInfoPtr
+ xf86TslibInit(InputDriverPtr drv, IDevPtr dev, int flags)
++#endif
+ {
+ struct ts_priv *priv;
+ char *s;
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
+ InputInfoPtr pInfo;
++#endif
+
+- priv = xcalloc (1, sizeof (struct ts_priv));
++ priv = calloc (1, sizeof (struct ts_priv));
+ if (!priv)
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
+ return NULL;
++#else
++ return BadValue;
++#endif
+
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
+ if (!(pInfo = xf86AllocateInput(drv, 0))) {
+- xfree(priv);
++ free(priv);
+ return NULL;
+ }
+
+ /* Initialise the InputInfoRec. */
+ pInfo->name = dev->identifier;
+- pInfo->type_name = XI_TOUCHSCREEN;
+ pInfo->flags =
+ XI86_KEYBOARD_CAPABLE | XI86_POINTER_CAPABLE |
+ XI86_SEND_DRAG_EVENTS;
+- pInfo->device_control = xf86TslibControlProc;
+- pInfo->read_input = ReadInput;
+ #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
+ pInfo->motion_history_proc = xf86GetMotionEvents;
+ pInfo->history_size = 0;
+ #endif
+- pInfo->control_proc = NULL;
++ pInfo->conf_idev = dev;
+ pInfo->close_proc = NULL;
+- pInfo->switch_mode = NULL;
+ pInfo->conversion_proc = ConvertProc;
+ pInfo->reverse_conversion_proc = NULL;
+- pInfo->dev = NULL;
+ pInfo->private_flags = 0;
+ pInfo->always_core_feedback = 0;
+- pInfo->conf_idev = dev;
++#endif
++
++ pInfo->type_name = XI_TOUCHSCREEN;
++ pInfo->control_proc = NULL;
++ pInfo->read_input = ReadInput;
++ pInfo->device_control = xf86TslibControlProc;
++ pInfo->switch_mode = NULL;
+ pInfo->private = priv;
++ pInfo->dev = NULL;
+
+ /* Collect the options, and process the common options. */
+- xf86CollectInputOptions(pInfo, NULL, NULL);
++ COLLECT_INPUT_OPTIONS(pInfo, NULL);
+ xf86ProcessCommonOptions(pInfo, pInfo->options);
+
+ priv->screen_num = xf86SetIntOption(pInfo->options, "ScreenNumber", 0 );
+@@ -510,23 +539,39 @@ xf86TslibInit(InputDriverPtr drv, IDevPtr dev, int flags)
+ priv->rotate = TSLIB_ROTATE_NONE;
+ }
+
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
+ s = xf86CheckStrOption(dev->commonOptions, "path", NULL);
++#else
++ s = xf86CheckStrOption(pInfo->options, "path", NULL);
++#endif
+ if (!s)
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
+ s = xf86CheckStrOption(dev->commonOptions, "Device", NULL);
++#else
++ s = xf86CheckStrOption(pInfo->options, "Device", NULL);
++#endif
+
+ priv->ts = ts_open(s, 1);
+- xfree(s);
++ free(s);
+
+ if (!priv->ts) {
+ ErrorF("ts_open failed (device=%s)\n",s);
+ xf86DeleteInput(pInfo, 0);
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
+ return NULL;
++#else
++ return BadValue;
++#endif
+ }
+
+ if (ts_config(priv->ts)) {
+ ErrorF("ts_config failed\n");
+ xf86DeleteInput(pInfo, 0);
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
+ return NULL;
++#else
++ return BadValue;
++#endif
+ }
+
+ pInfo->fd = ts_fd(priv->ts);
+@@ -536,11 +581,17 @@ xf86TslibInit(InputDriverPtr drv, IDevPtr dev, int flags)
+ priv->state = BUTTON_EMULATION_OFF;
+ }
+
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
+ /* Mark the device configured */
+ pInfo->flags |= XI86_CONFIGURED;
++#endif
+
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
+ /* Return the configured device */
+ return (pInfo);
++#else
++ return Success;
++#endif
+ }
+
+ _X_EXPORT InputDriverRec TSLIB = {
diff --git a/patches/xf86-input-tslib-0.0.6/series b/patches/xf86-input-tslib-0.0.6/series
new file mode 100644
index 000000000..1cca5a760
--- /dev/null
+++ b/patches/xf86-input-tslib-0.0.6/series
@@ -0,0 +1,5 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-fix-segfault.patch
+0002-add-support-for-ABI-12.patch
+# 11df7c3371f5b4ed9d1d4047978ba553 - git-ptx-patches magic