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:		216274
Submitted by:	matthew@reztek.cz
  • Loading branch information
bapt committed Jan 23, 2017
1 parent 62992c1 commit 32e3cdd
Show file tree
Hide file tree
Showing 7 changed files with 213 additions and 1 deletion.
2 changes: 1 addition & 1 deletion x11-drivers/xf86-input-mutouch/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

PORTNAME= xf86-input-mutouch
PORTVERSION= 1.3.0
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES= x11-drivers

MAINTAINER= x11@FreeBSD.org
Expand Down
29 changes: 29 additions & 0 deletions x11-drivers/xf86-input-mutouch/files/patch-git_01_066b889
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From 066b889695316c2bf45c95ad80f793d72ec0db75 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Fri, 8 Jul 2011 15:01:26 +1000
Subject: Remove option DeviceName.

If you can set Option DeviceName, you should also be able to set Identifier
instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/xf86MuTouch.c b/src/xf86MuTouch.c
index 290fa11..a3fec4b 100644
--- src/xf86MuTouch.c
+++ src/xf86MuTouch.c
@@ -1135,11 +1135,6 @@ xf86MuTInit(InputDriverPtr drv,
/* Process the common options. */
xf86ProcessCommonOptions(pInfo, pInfo->options);

- str = xf86FindOptionValue(pInfo->options, "DeviceName");
- if (str) {
- pInfo->name = strdup(str);
- }
- xf86Msg(X_CONFIG, "MuTouch X device name: %s\n", pInfo->name);
priv->screen_no = xf86SetIntOption(pInfo->options, "ScreenNo", 0);
xf86Msg(X_CONFIG, "MuTouch associated screen: %d\n", priv->screen_no);
priv->max_x = xf86SetIntOption(pInfo->options, "MaxX", 3000);
--
cgit v0.10.2

25 changes: 25 additions & 0 deletions x11-drivers/xf86-input-mutouch/files/patch-git_02_7b06397
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 7b063972e8ebbb244c8d92d8df194c5df9f015bc Mon Sep 17 00:00:00 2001
From: Terry Lambert <tlambert@chromium.org>
Date: Fri, 15 Jul 2011 17:23:23 -0700
Subject: Return proper default for unknown values in pInfo->device_control.

Signed-off-by: Terry Lambert <tlambert@chromium.org>
Reviewed-by: Stephane Marchesin <marcheu@chromium.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/xf86MuTouch.c b/src/xf86MuTouch.c
index a3fec4b..3b9b6b8 100644
--- src/xf86MuTouch.c
+++ src/xf86MuTouch.c
@@ -944,7 +944,7 @@ xf86MuTControl(DeviceIntPtr dev,

default:
ErrorF("unsupported mode=%d\n", mode);
- return !Success;
+ return BadValue;
}
}

--
cgit v0.10.2

36 changes: 36 additions & 0 deletions x11-drivers/xf86-input-mutouch/files/patch-git_03_7bf5e0d
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
From 7bf5e0d8c1863079330196dbe0efb230d74eeb70 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue, 19 Jul 2011 12:57:00 +1000
Subject: =?UTF-8?q?Use=20xf86SetStrOption=20for=20Type=20and=20Device=20?=
=?UTF-8?q?=E2=86=92=20prints=20to=20the=20log?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/xf86MuTouch.c b/src/xf86MuTouch.c
index 3b9b6b8..b35d1da 100644
--- src/xf86MuTouch.c
+++ src/xf86MuTouch.c
@@ -1074,7 +1074,7 @@ xf86MuTInit(InputDriverPtr drv,
int portrait=0;
int rc = Success;

- str = xf86FindOptionValue(pInfo->options, "Type");
+ str = xf86SetStrOption(pInfo->options, "Type", NULL);
if (str && (xf86NameCmp(str, "finger") == 0)) {
rc = xf86MuTAllocateFinger(drv, pInfo);
}
@@ -1091,7 +1091,7 @@ xf86MuTInit(InputDriverPtr drv,
}
priv = pInfo->private;

- str = xf86FindOptionValue(pInfo->options, "Device");
+ str = xf86SetStrOption(pInfo->options, "Device", NULL);
if (!str) {
xf86Msg(X_ERROR, "%s: No Device specified in MuTouch module config.\n",
pInfo->name);
--
cgit v0.10.2

32 changes: 32 additions & 0 deletions x11-drivers/xf86-input-mutouch/files/patch-git_04_ea858f9
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From ea858f9e49c06b2728dc91c62616533a01ff484c Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue, 19 Jul 2011 12:57:32 +1000
Subject: Don't free on PreInit failure, the server calls UnInit for us later

DuSigned-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/xf86MuTouch.c b/src/xf86MuTouch.c
index b35d1da..1d56efd 100644
--- src/xf86MuTouch.c
+++ src/xf86MuTouch.c
@@ -1214,16 +1214,9 @@ xf86MuTInit(InputDriverPtr drv,
priv->swap_axes = (priv->swap_axes==0) ? 1 : 0;
}

- return Success;
+ rc = Success;

init_err:
- if (priv) {
- if (priv->input_dev) {
- free(priv->input_dev);
- }
- free(priv);
- pInfo->private = NULL;
- }
return rc;
}

--
cgit v0.10.2

30 changes: 30 additions & 0 deletions x11-drivers/xf86-input-mutouch/files/patch-git_05_7bd05fe
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 7bd05fe5ed04be7abcccac2ce42d939f585ed41d Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue, 19 Jul 2011 12:59:31 +1000
Subject: Test-open device in PreInit, fail if it doesn't work.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/xf86MuTouch.c b/src/xf86MuTouch.c
index 1d56efd..fd0b930 100644
--- src/xf86MuTouch.c
+++ src/xf86MuTouch.c
@@ -1097,6 +1097,15 @@ xf86MuTInit(InputDriverPtr drv,
pInfo->name);
rc = BadValue;
goto init_err;
+ } else {
+ pInfo->fd = xf86OpenSerial(pInfo->options);
+ if (pInfo->fd < 0) {
+ xf86Msg(X_ERROR, "%s: Unable to open MuTouch touchscreen device '%s'\n", pInfo->name, str);
+ rc = BadValue;
+ goto init_err;
+ }
+ close(pInfo->fd);
+ pInfo->fd = -1;
}
priv->input_dev = strdup(str);

--
cgit v0.10.2

60 changes: 60 additions & 0 deletions x11-drivers/xf86-input-mutouch/files/patch-src_xf86MuTouch.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Finish converting AddEnabledDevice to xf86AddEnabledDevice
# Finish converting use of Error to ErrorF
# Correct a couple strings that should be const
#
--- src/xf86MuTouch.c.orig 2011-06-28 01:31:38 UTC
+++ src/xf86MuTouch.c
@@ -267,7 +267,7 @@ xf86MuTReadInput(InputInfoPtr pInfo)
(char *) (priv->rec_buf + priv->num_old_bytes),
MuT_BUFFER_SIZE - priv->num_old_bytes));
if (num_bytes < 0) {
- Error("System error while reading from MuTouch touchscreen.");
+ ErrorF("System error while reading from MuTouch touchscreen.\n");
return;
}

@@ -483,7 +483,7 @@ xf86MuTGetReply(unsigned char *buffer,
* Okay, give up.
*/
if (num_bytes < 0) {
- Error("System error while reading from MuTouch touchscreen.");
+ ErrorF("System error while reading from MuTouch touchscreen.\n");
return !Success;
}
DBG(4, ErrorF("Read %d bytes of reply\n", num_bytes));
@@ -789,7 +789,7 @@ xf86MuTControl(DeviceIntPtr dev,
DBG(2, ErrorF("MuTouch touchscreen opening : %s\n", priv->input_dev));
pInfo->fd = xf86OpenSerial(pInfo->options);
if (pInfo->fd < 0) {
- Error("Unable to open MuTouch touchscreen device");
+ ErrorF("Unable to open MuTouch touchscreen device\n");
return !Success;
}
memset(req, 0, MuT_PACKET_SIZE);
@@ -845,7 +845,7 @@ xf86MuTControl(DeviceIntPtr dev,
goto not_success;
}
/* goto not_success;*/
- AddEnabledDevice(pInfo->fd);
+ xf86AddEnabledDevice(pInfo);
}

/*
@@ -1052,7 +1052,7 @@ xf86MuTUninit(InputDriverPtr drv,
xf86DeleteInput(pInfo, 0);
}

-static char *default_options[] = {
+static const char *default_options[] = {
"BaudRate", "9600",
"StopBits", "1",
"DataBits", "8",
@@ -1070,7 +1070,7 @@ xf86MuTInit(InputDriverPtr drv,
{
InputInfoPtr current;
MuTPrivatePtr priv=NULL;
- char *str;
+ const char *str;
int portrait=0;
int rc = Success;

0 comments on commit 32e3cdd

Please sign in to comment.