This commit is contained in:
grimmlin 2011-08-28 20:31:34 +00:00
parent e571e21e1a
commit 69708b394b
4 changed files with 273 additions and 0 deletions

View file

@ -0,0 +1,4 @@
AUX fix-overlapped-variable.patch 485 RMD160 e4dcdd590b13d530131c0a52b6ae296777ae7f6f SHA1 340647621ffe72a8dc148dfc629c9556c7ab6a16 SHA256 d149611a62e9d6de547403bfcf8770fe1c8e87dd39d3ba22f42805dadcfd1978
AUX fix-xorg-compatibility.patch 5501 RMD160 6c9b8f92a2215f19f00a94c252518529e4eee416 SHA1 820c6dc248a050baba86bf8b55245e7c99dc833a SHA256 0bc6c2b28f9d3d44f540da1875141d35cf698a0df12dfc8be47703d4b8d8e5e4
DIST xf86-input-tslib_0.0.6-3.tar.gz 307751 RMD160 dbd81e0d6168ea6694756bebf6dbe5d972d71a0c SHA1 708c91cfc16f7f04d2d639addb424aae686037cd SHA256 546083a3d70b0da4403fb2add28036ed48f6a91adb802044ac0e4f3bcbc429f5
EBUILD xf86-input-tslib-0.0.6-r3.ebuild 869 RMD160 f1b78d8a943d9165791f0e8a03bdda21a093c5fe SHA1 50315459ce7538e204e781305ee1c40bde696e24 SHA256 83bbd2054c03adf64108b737398d25c69da0493342dd4c47e6414b2c2b44739a

View file

@ -0,0 +1,20 @@
--- src/tslib.c.orig 2010-05-19 19:01:01.000000000 +0200
+++ src/tslib.c 2010-05-19 19:02:00.000000000 +0200
@@ -543,7 +543,7 @@
return (pInfo);
}
-_X_EXPORT InputDriverRec TSLIB = {
+_X_EXPORT InputDriverRec TSLIB_DRIVER = {
1, /* driver version */
"tslib", /* driver name */
NULL, /* identify */
@@ -580,7 +580,7 @@
{
static Bool Initialised = FALSE;
- xf86AddInputDriver(&TSLIB, module, 0);
+ xf86AddInputDriver(&TSLIB_DRIVER, module, 0);
return module;
}

View file

@ -0,0 +1,218 @@
--- src/tslib.c.orig 2011-05-31 02:29:49.000000000 +0200
+++ src/tslib.c 2011-05-31 03:35:18.000000000 +0200
@@ -106,7 +106,11 @@
}
static Bool
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
+ConvertProc( InputInfoPtr local,
+#else
ConvertProc( LocalDevicePtr local,
+#endif
int first,
int num,
int v0,
@@ -135,7 +139,11 @@
return t;
}
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
+static void ReadInput (InputInfoPtr local)
+#else
static void ReadInput (LocalDevicePtr local)
+#endif
{
struct ts_priv *priv = (struct ts_priv *) (local->private);
struct ts_sample samp;
@@ -382,7 +390,11 @@
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 +404,11 @@
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");
@@ -439,53 +455,96 @@
xf86DeleteInput(pInfo, 0);
}
+
+/*
+ * xf86TslibPreInit --
+ *
+ * replacement for xf86TslibInit.
+ */
+static int
+xf86TslibPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags);
+
/*
* xf86TslibInit --
*
* called when the module subsection is found in XF86Config
*/
-static InputInfoPtr
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
+static IinputInfoPtr
xf86TslibInit(InputDriverPtr drv, IDevPtr dev, int flags)
{
- struct ts_priv *priv;
- char *s;
InputInfoPtr pInfo;
- priv = xcalloc (1, sizeof (struct ts_priv));
- if (!priv)
- return NULL;
-
- if (!(pInfo = xf86AllocateInput(drv, 0))) {
- xfree(priv);
+ if (!(pInfo = xf86AllocateInput(drv, 0)))
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;
+ pInfo->close_proc = NULL;
+ pInfo->conversion_proc = ConvertProc;
+ pInfo->reverse_conversion_proc = NULL;
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
pInfo->motion_history_proc = xf86GetMotionEvents;
pInfo->history_size = 0;
#endif
- pInfo->control_proc = NULL;
- 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;
- pInfo->private = priv;
+ /* FIXME: Is initialization to 0 needed? */
+ pInfo->control_proc = NULL;
+ pInfo->switch_mode = NULL;
+ pInfo->dev = NULL;
/* Collect the options, and process the common options. */
xf86CollectInputOptions(pInfo, NULL, NULL);
xf86ProcessCommonOptions(pInfo, pInfo->options);
+
+ /*
+ * FIXME: is true dev->commonOptions == pInfo->options ?
+ * if not similar rutine below in xf86TslibPreInit will fail!
+ * In case of failre is necesary do some hacking. ...
+ s = xf86CheckStrOption(dev->commonOptions, "path", NULL);
+ if (!s)
+ s = xf86CheckStrOption(dev->commonOptions, "Device", NULL);
+ */
+
+ if (xf86TslibPreInit(drv, pInfo, flags) == Success)
+ {
+ /* Mark the device configured */
+ pInfo->flags |= XI86_CONFIGURED;
+ /* Return the configured device */
+ return (pInfo);
+ }
+
+ xf86DeleteInput(pInfo, 0);
+ return NULL;
+}
+#else
+static int
+xf86TslibInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+{
+ return xf86TslibPreInit(drv, pInfo, flags);
+}
+#endif
+
+static int
+xf86TslibPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+{
+ int rc = BadAlloc;
+ char *s;
+ struct ts_priv *priv;
+
+ priv = calloc (1, sizeof (struct ts_priv));
+ if (!priv)
+ goto error;
+
+ pInfo->type_name = XI_TOUCHSCREEN;
+ pInfo->device_control = xf86TslibControlProc;
+ pInfo->read_input = ReadInput;
+ pInfo->private = priv;
priv->screen_num = xf86SetIntOption(pInfo->options, "ScreenNumber", 0 );
@@ -510,23 +569,22 @@
priv->rotate = TSLIB_ROTATE_NONE;
}
- s = xf86CheckStrOption(dev->commonOptions, "path", NULL);
+ s = xf86CheckStrOption(pInfo->options, "path", NULL);
if (!s)
- s = xf86CheckStrOption(dev->commonOptions, "Device", NULL);
+ s = xf86CheckStrOption(pInfo->options, "Device", NULL);
priv->ts = ts_open(s, 1);
- xfree(s);
+ free(s);
+ rc = BadMatch;
if (!priv->ts) {
ErrorF("ts_open failed (device=%s)\n",s);
- xf86DeleteInput(pInfo, 0);
- return NULL;
+ goto error;
}
if (ts_config(priv->ts)) {
ErrorF("ts_config failed\n");
- xf86DeleteInput(pInfo, 0);
- return NULL;
+ goto error;
}
pInfo->fd = ts_fd(priv->ts);
@@ -536,11 +594,14 @@
priv->state = BUTTON_EMULATION_OFF;
}
- /* Mark the device configured */
- pInfo->flags |= XI86_CONFIGURED;
+ return Success;
+
+error:
+ if (pInfo->private)
+ free(pInfo->private);
+ pInfo->private = NULL;
- /* Return the configured device */
- return (pInfo);
+ return rc;
}
_X_EXPORT InputDriverRec TSLIB_DRIVER = {

View file

@ -0,0 +1,31 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/x11-drivers/xf86-input-tslib/xf86-input-tslib-0.0.6-r2.ebuild,v 1.11 2011/05/08 12:33:38 scarabeus Exp $
EAPI=4
inherit xorg-2
PATCHLEVEL=3
DEBSOURCES="${PN}_${PV}-${PATCHLEVEL}.tar.gz"
DESCRIPTION="xorg input driver for use of tslib based touchscreen devices"
HOMEPAGE="http://www.pengutronix.de/software/xf86-input-tslib/index_en.html"
SRC_URI="ftp://cdn.debian.net/debian/pool/main/x/${PN}/${DEBSOURCES}"
LICENSE="GPL-2"
KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86"
IUSE=""
RDEPEND="x11-libs/tslib"
DEPEND="${RDEPEND}
x11-proto/randrproto"
S=${WORKDIR}/${PN}-trunk
DOCS=( COPYING ChangeLog )
PATCHES=(
"${FILESDIR}"/fix-overlapped-variable.patch
"${FILESDIR}"/fix-xorg-compatibility.patch
)