Skip to content

Commit

Permalink
Import few patches from upstream to allow building with newer xorg
Browse files Browse the repository at this point in the history
Note that those drivers are barely maintained and might disappear in the futur

PR:		216270
Submitted by:	matthew@reztek.cz
  • Loading branch information
bapt committed Jan 23, 2017
1 parent 3773654 commit fe6ec0f
Show file tree
Hide file tree
Showing 11 changed files with 684 additions and 1 deletion.
2 changes: 1 addition & 1 deletion x11-drivers/xf86-input-acecad/Makefile
Expand Up @@ -2,7 +2,7 @@

PORTNAME= xf86-input-acecad
PORTVERSION= 1.5.0
PORTREVISION= 6
PORTREVISION= 7
CATEGORIES= x11-drivers

MAINTAINER= x11@FreeBSD.org
Expand Down
86 changes: 86 additions & 0 deletions x11-drivers/xf86-input-acecad/files/patch-git_01_fd61e53
@@ -0,0 +1,86 @@
From fd61e53ed08cec2b3af688a55507477f6ef30544 Mon Sep 17 00:00:00 2001
From: Cyril Brulebois <kibi@debian.org>
Date: Fri, 3 Jun 2011 15:59:14 +0200
Subject: =?UTF-8?q?Avoid=20=E2=80=9C'ReverseConvertProc'=20defined=20but?=
=?UTF-8?q?=20not=20used=E2=80=9D=20warning.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Move this function next to its unique caller (AceCadPreInit), and only
declare/define it when the input ABI is strictly less than 12.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Cyril Brulebois <kibi@debian.org>

diff --git a/src/acecad.c b/src/acecad.c
index 6259f21..f5a2213 100644
--- src/acecad.c
+++ src/acecad.c
@@ -370,6 +370,21 @@ SetupProc_fail:
return NULL;
}

+static Bool
+ReverseConvertProc (InputInfoPtr local,
+ int x, int y,
+ int *valuators)
+{
+ AceCadPrivatePtr priv = (AceCadPrivatePtr)(local->private);
+
+ // xf86Msg(X_INFO, "%s: reverse coordinate conversion in : %d, %d\n", local->name, x, y);
+ valuators[0] = x * priv->acecadMaxX / screenInfo.screens[0]->width;
+ valuators[1] = y * priv->acecadMaxY / screenInfo.screens[0]->height;
+ // xf86Msg(X_INFO, "%s: reverse coordinate conversion out: %d, %d\n", local->name, valuators[0], valuators[1]);
+
+ return TRUE;
+}
+
static int
NewAceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags)
#else
@@ -1071,22 +1086,6 @@ ConvertProc (InputInfoPtr local, int first, int num,
}


-static Bool
-ReverseConvertProc (InputInfoPtr local,
- int x, int y,
- int *valuators)
-{
- AceCadPrivatePtr priv = (AceCadPrivatePtr)(local->private);
-
- // xf86Msg(X_INFO, "%s: reverse coordinate conversion in : %d, %d\n", local->name, x, y);
- valuators[0] = x * priv->acecadMaxX / screenInfo.screens[0]->width;
- valuators[1] = y * priv->acecadMaxY / screenInfo.screens[0]->height;
- // xf86Msg(X_INFO, "%s: reverse coordinate conversion out: %d, %d\n", local->name, valuators[0], valuators[1]);
-
- return TRUE;
-}
-
-
#define WriteString(str)\
XisbWrite (priv->buffer, (unsigned char *)(str), strlen(str))

diff --git a/src/acecad.h b/src/acecad.h
index a2b5c66..bd8e997 100644
--- src/acecad.h
+++ src/acecad.h
@@ -102,12 +102,12 @@ static Bool DeviceClose (DeviceIntPtr);
static Bool DeviceInit (DeviceIntPtr);
static void ReadInput (InputInfoPtr);
static Bool ConvertProc (InputInfoPtr, int, int, int, int, int, int, int, int, int *, int *);
-static Bool ReverseConvertProc(InputInfoPtr , int , int , int*);
static Bool QueryHardware (AceCadPrivatePtr);
static void NewPacket (AceCadPrivatePtr priv);
static Bool AceCadGetPacket (AceCadPrivatePtr);
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
static InputInfoPtr AceCadPreInit(InputDriverPtr, IDevPtr , int);
+static Bool ReverseConvertProc(InputInfoPtr , int , int , int*);
#else
static int AceCadPreInit(InputDriverPtr, InputInfoPtr , int);
#endif
--
cgit v0.10.2

34 changes: 34 additions & 0 deletions x11-drivers/xf86-input-acecad/files/patch-git_02_1fea653
@@ -0,0 +1,34 @@
From 1fea6530eeca06b0d8d15a9327f87063292e1e6d Mon Sep 17 00:00:00 2001
From: Cyril Brulebois <kibi@debian.org>
Date: Fri, 3 Jun 2011 15:59:14 +0200
Subject: Silence gcc: report_{x, y} are getting initialized.

Get us rid of:
| CC acecad.lo
| acecad.c: In function 'USBReadInput':
| acecad.c:1052:43: warning: 'report_y' may be used uninitialized in this function [-Wuninitialized]
| acecad.c:1052:43: warning: 'report_x' may be used uninitialized in this function [-Wuninitialized]

Both code paths (with XORG_BOTCHED_INPUT or not) will lead report_x and
report_y to be set, but make sure the compiler stops guessing.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Cyril Brulebois <kibi@debian.org>

diff --git a/src/acecad.c b/src/acecad.c
index f5a2213..1e2f0c0 100644
--- src/acecad.c
+++ src/acecad.c
@@ -919,7 +919,7 @@ USBReadInput (InputInfoPtr local)
int x = priv->acecadOldX;
int y = priv->acecadOldY;
int z = priv->acecadOldZ;
- int report_x, report_y;
+ int report_x = 0, report_y = 0;
int prox = priv->acecadOldProximity;
int buttons = priv->acecadOldButtons;
int is_core_pointer = 0;
--
cgit v0.10.2

165 changes: 165 additions & 0 deletions x11-drivers/xf86-input-acecad/files/patch-git_04_ef1e9cf
@@ -0,0 +1,165 @@
From ef1e9cf34e8f1ec2513dd6bd36d824b54e841ea7 Mon Sep 17 00:00:00 2001
From: Cyril Brulebois <kibi@debian.org>
Date: Fri, 3 Jun 2011 15:59:15 +0200
Subject: Drop support for pre-input ABI 12 servers.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Cyril Brulebois <kibi@debian.org>

diff --git a/configure.ac b/configure.ac
index 4c76754..d4a404d 100644
--- configure.ac
+++ configure.ac
@@ -55,7 +55,7 @@ AC_CHECK_HEADERS([linux/input.h sysfs/libsysfs.h])
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)

# Obtain compiler/linker options from server and required extensions
-PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901] xproto kbproto inputproto $REQUIRED_MODULES)
+PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10] xproto kbproto inputproto $REQUIRED_MODULES)

# Define a configure option for an alternate input module directory
AC_ARG_WITH(xorg-module-dir,
diff --git a/src/acecad.c b/src/acecad.c
index d60b3b6..17e141f 100644
--- src/acecad.c
+++ src/acecad.c
@@ -90,6 +90,10 @@
#endif
#define DBG(lvl, f) {if ((lvl) <= xf86GetVerbosity()) f;}

+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
+#error "XINPUT ABI 12 required."
+#endif
+
/*****************************************************************************
* Local Headers
****************************************************************************/
@@ -331,66 +335,8 @@ ProbeFound:

#endif

-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
-static int NewAceCadPreInit(InputDriverPtr drv, InputInfoPtr dev, int flags);
-
-static InputInfoPtr
-AceCadPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
-{
- InputInfoPtr local = xf86AllocateInput(drv, 0);
- AceCadPrivatePtr priv = calloc (1, sizeof(AceCadPrivateRec));
-
- if ((!local))
- goto SetupProc_fail;
-
- local->name = dev->identifier;
- local->type_name = XI_TABLET;
- local->flags = XI86_SEND_DRAG_EVENTS;
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
- local->motion_history_proc = xf86GetMotionEvents;
-#endif
- local->control_proc = NULL;
- local->switch_mode = NULL;
- local->conversion_proc = ConvertProc;
- local->reverse_conversion_proc = ReverseConvertProc;
- local->dev = NULL;
- local->private = priv;
- local->private_flags = 0;
- local->conf_idev = dev;
- /*local->always_core_feedback = 0;*/
-
- xf86CollectInputOptions(local, default_options, NULL);
-
- xf86OptionListReport(local->options);
-
- if (NewAceCadPreInit(drv, local, flags) == Success)
- return local;
-
-SetupProc_fail:
- return NULL;
-}
-
-static Bool
-ReverseConvertProc (InputInfoPtr local,
- int x, int y,
- int *valuators)
-{
- AceCadPrivatePtr priv = (AceCadPrivatePtr)(local->private);
-
- // xf86Msg(X_INFO, "%s: reverse coordinate conversion in : %d, %d\n", local->name, x, y);
- valuators[0] = x * priv->acecadMaxX / screenInfo.screens[0]->width;
- valuators[1] = y * priv->acecadMaxY / screenInfo.screens[0]->height;
- // xf86Msg(X_INFO, "%s: reverse coordinate conversion out: %d, %d\n", local->name, valuators[0], valuators[1]);
-
- return TRUE;
-}
-
-static int
-NewAceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags)
-#else
static int
AceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags)
-#endif
{
AceCadPrivatePtr priv = calloc (1, sizeof(AceCadPrivateRec));
int speed;
@@ -500,10 +446,6 @@ AceCadPreInit(InputDriverPtr drv, InputInfoPtr local, int flags)

xf86ProcessCommonOptions(local, local->options);

-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
- local->flags |= XI86_CONFIGURED;
-#endif
-
if (local->fd != -1)
{
RemoveEnabledDevice (local->fd);
@@ -709,9 +651,6 @@ DeviceInit (DeviceIntPtr dev)
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
axes_labels,
#endif
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
- xf86GetMotionEvents,
-#endif
history_size,
((priv->flags & ABSOLUTE_FLAG)? Absolute: Relative)|OutOfProximity)
== FALSE)
@@ -818,9 +757,6 @@ ReadInput (InputInfoPtr local)
/*xf86Msg(X_INFO, "ACECAD Tablet Read Input\n");*/

is_absolute = (priv->flags & ABSOLUTE_FLAG);
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
- is_core_pointer = xf86IsCorePointer(local->dev);
-#endif

/*
* set blocking to -1 on the first call because we know there is data to
@@ -923,9 +859,6 @@ USBReadInput (InputInfoPtr local)
int prox = priv->acecadOldProximity;
int buttons = priv->acecadOldButtons;
int is_core_pointer = 0;
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
- is_core_pointer = xf86IsCorePointer(local->dev);
-#endif
/* Is autodev active? */
int autodev = priv->flags & AUTODEV_FLAG;
/* Was the device available last time we checked? */
diff --git a/src/acecad.h b/src/acecad.h
index bd8e997..b9291c7 100644
--- src/acecad.h
+++ src/acecad.h
@@ -105,12 +105,7 @@ static Bool ConvertProc (InputInfoPtr, int, int, int, int, int, int, int, int, i
static Bool QueryHardware (AceCadPrivatePtr);
static void NewPacket (AceCadPrivatePtr priv);
static Bool AceCadGetPacket (AceCadPrivatePtr);
-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
-static InputInfoPtr AceCadPreInit(InputDriverPtr, IDevPtr , int);
-static Bool ReverseConvertProc(InputInfoPtr , int , int , int*);
-#else
static int AceCadPreInit(InputDriverPtr, InputInfoPtr , int);
-#endif
#ifdef HAVE_LINUX_INPUT_H
static void USBReadInput (InputInfoPtr);
static Bool USBQueryHardware (InputInfoPtr);
--
cgit v0.10.2

0 comments on commit fe6ec0f

Please sign in to comment.