From owner-svn-ports-head@freebsd.org Mon Jan 23 22:27:52 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 314F3CBE83C; Mon, 23 Jan 2017 22:27:52 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 001427CC; Mon, 23 Jan 2017 22:27:51 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0NMRpTD057392; Mon, 23 Jan 2017 22:27:51 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0NMRoI0057381; Mon, 23 Jan 2017 22:27:50 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201701232227.v0NMRoI0057381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 23 Jan 2017 22:27:50 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r432297 - in head/x11-drivers/xf86-input-fpit: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2017 22:27:52 -0000 Author: bapt Date: Mon Jan 23 22:27:49 2017 New Revision: 432297 URL: https://svnweb.freebsd.org/changeset/ports/432297 Log: Import few patches from upstream to allow building with newer xorg Note that those drivers are barely maintained and might disappear in the futur PR: 216272 Submitted by: matthew@reztek.cz Added: head/x11-drivers/xf86-input-fpit/files/ head/x11-drivers/xf86-input-fpit/files/patch-git_01_38fde65 (contents, props changed) head/x11-drivers/xf86-input-fpit/files/patch-git_02_508d879 (contents, props changed) head/x11-drivers/xf86-input-fpit/files/patch-git_03_4b47b4a (contents, props changed) head/x11-drivers/xf86-input-fpit/files/patch-git_04_dc40c58 (contents, props changed) head/x11-drivers/xf86-input-fpit/files/patch-git_05_7a1245d (contents, props changed) head/x11-drivers/xf86-input-fpit/files/patch-git_06_270607a (contents, props changed) head/x11-drivers/xf86-input-fpit/files/patch-git_07_5772c7f (contents, props changed) head/x11-drivers/xf86-input-fpit/files/patch-git_09_00742d9 (contents, props changed) head/x11-drivers/xf86-input-fpit/files/patch-src_xf86Fpit.c (contents, props changed) Modified: head/x11-drivers/xf86-input-fpit/Makefile Modified: head/x11-drivers/xf86-input-fpit/Makefile ============================================================================== --- head/x11-drivers/xf86-input-fpit/Makefile Mon Jan 23 22:22:53 2017 (r432296) +++ head/x11-drivers/xf86-input-fpit/Makefile Mon Jan 23 22:27:49 2017 (r432297) @@ -2,7 +2,7 @@ PORTNAME= xf86-input-fpit PORTVERSION= 1.4.0 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= x11-drivers MAINTAINER= x11@FreeBSD.org Added: head/x11-drivers/xf86-input-fpit/files/patch-git_01_38fde65 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-drivers/xf86-input-fpit/files/patch-git_01_38fde65 Mon Jan 23 22:27:49 2017 (r432297) @@ -0,0 +1,59 @@ +From 38fde65f6c919350b2bf5d2b61b6e9f783ab2cf7 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Fri, 8 Jul 2011 14:12:53 +1000 +Subject: Fix type name and name + +Don't overwrite user-specified device name and set the right type_name. +If you're capable of setting the option DeviceName, you might as well set +the Identifier line. + +Signed-off-by: Peter Hutterer + +diff --git a/man/fpit.man b/man/fpit.man +index 097ff33..8bf31f0 100644 +--- man/fpit.man ++++ man/fpit.man +@@ -82,10 +82,6 @@ Manipulate the invert and swap options to match screen + rotations. (Will behave strangely if combined with invert or swap options.) + New users should consider the \fI"TrackRandR"\fP option instead. + .TP 4 +-.B Option \fI"DeviceName"\fP \fI"name"\fP +-.B Option \fI"DeviceName"\fP \fI"name"\fP +-sets the name of the X device. +-.TP 4 + .B Option \fI"AlwaysCore"\fP \fI"on"\fP + enables the sharing of the core pointer. When this feature is enabled, the + device will take control of the core pointer (and thus will emit core events) +diff --git a/src/xf86Fpit.c b/src/xf86Fpit.c +index fa4ace7..e7e4e1a 100644 +--- src/xf86Fpit.c ++++ src/xf86Fpit.c +@@ -527,7 +527,6 @@ static int xf86FpitAllocate(InputDriverPtr drv, InputInfoPtr pInfo) + priv->fpitOldProximity = 0; + priv->fpitIndex = 0; + priv->fpitPassive = 0; +- pInfo->name = XI_TOUCHSCREEN; + pInfo->flags = 0 /* XI86_NO_OPEN_ON_INIT */ ; + pInfo->device_control = xf86FpitControl; + pInfo->read_input = xf86FpitReadInput; +@@ -536,7 +535,7 @@ static int xf86FpitAllocate(InputDriverPtr drv, InputInfoPtr pInfo) + pInfo->fd = -1; + pInfo->dev = NULL; + pInfo->private = priv; +- pInfo->type_name = "Fujitsu Stylistic"; ++ pInfo->type_name = XI_TOUCHSCREEN; + return Success; + } + +@@ -577,8 +576,6 @@ static int xf86FpitInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) + return BadValue; + } + priv->fpitDev = strdup(str); +- pInfo->name = xf86SetStrOption(pInfo->options, "DeviceName", XI_TOUCHSCREEN); +- xf86Msg(X_CONFIG, "FPIT device name: %s\n", pInfo->name); + priv->screen_no = xf86SetIntOption(pInfo->options, "ScreenNo", 0); + xf86Msg(X_CONFIG, "Fpit associated screen: %d\n", priv->screen_no); + priv->fpitMaxX = xf86SetIntOption(pInfo->options, "MaximumXPosition", FPIT_MAX_X); +-- +cgit v0.10.2 + Added: head/x11-drivers/xf86-input-fpit/files/patch-git_02_508d879 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-drivers/xf86-input-fpit/files/patch-git_02_508d879 Mon Jan 23 22:27:49 2017 (r432297) @@ -0,0 +1,25 @@ +From 508d8793e5998fcac42a9dfd6f02235c3d82ab11 Mon Sep 17 00:00:00 2001 +From: Terry Lambert +Date: Fri, 15 Jul 2011 17:23:21 -0700 +Subject: Return proper default for unknown values in pInfo->device_control. + +Signed-off-by: Terry Lambert +Reviewed-by: Stephane Marchesin +Signed-off-by: Peter Hutterer + +diff --git a/src/xf86Fpit.c b/src/xf86Fpit.c +index e7e4e1a..78b44a2 100644 +--- src/xf86Fpit.c ++++ src/xf86Fpit.c +@@ -495,7 +495,7 @@ static Bool xf86FpitControl(DeviceIntPtr dev, int mode) + return Success; + default: + ErrorF("unsupported mode=%d\n", mode); +- return !Success; ++ return BadValue; + } + } + +-- +cgit v0.10.2 + Added: head/x11-drivers/xf86-input-fpit/files/patch-git_03_4b47b4a ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-drivers/xf86-input-fpit/files/patch-git_03_4b47b4a Mon Jan 23 22:27:49 2017 (r432297) @@ -0,0 +1,29 @@ +From 4b47b4a9cdce3bd0368aacb8164aa02e05670a88 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 19 Jul 2011 11:42:12 +1000 +Subject: Don't free anything on PreInit failure, let UnInit take care of it + +Avoid double free's by the server when it calls UnInit. + +Signed-off-by: Peter Hutterer + +diff --git a/src/xf86Fpit.c b/src/xf86Fpit.c +index 78b44a2..2da34aa 100644 +--- src/xf86Fpit.c ++++ src/xf86Fpit.c +@@ -567,12 +567,6 @@ static int xf86FpitInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) + str = xf86FindOptionValue(pInfo->options, "Device"); + if (!str) { + xf86Msg(X_ERROR, "%s: No Device specified in FPIT module config.\n", pInfo->name); +- if (priv) { +- if (priv->fpitDev) { +- free(priv->fpitDev); +- } +- free(priv); +- } + return BadValue; + } + priv->fpitDev = strdup(str); +-- +cgit v0.10.2 + Added: head/x11-drivers/xf86-input-fpit/files/patch-git_04_dc40c58 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-drivers/xf86-input-fpit/files/patch-git_04_dc40c58 Mon Jan 23 22:27:49 2017 (r432297) @@ -0,0 +1,29 @@ +From dc40c58c70b785c102a27652569c3de30fc44a9b Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 19 Jul 2011 11:44:35 +1000 +Subject: Test opening the device in PreInit, fail if necessary + +Signed-off-by: Peter Hutterer + +diff --git a/src/xf86Fpit.c b/src/xf86Fpit.c +index 2da34aa..8c9c830 100644 +--- src/xf86Fpit.c ++++ src/xf86Fpit.c +@@ -568,6 +568,14 @@ static int xf86FpitInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) + if (!str) { + xf86Msg(X_ERROR, "%s: No Device specified in FPIT module config.\n", pInfo->name); + return BadValue; ++ } else { ++ pInfo->fd = xf86OpenSerial(pInfo->options); ++ if (pInfo->fd < 0) { ++ xf86Msg(X_ERROR, "%s: Unable to open Fpit touchscreen device '%s'", pInfo->name, str); ++ return BadValue; ++ } ++ xf86CloseSerial(pInfo->fd); ++ pInfo->fd = -1; + } + priv->fpitDev = strdup(str); + priv->screen_no = xf86SetIntOption(pInfo->options, "ScreenNo", 0); +-- +cgit v0.10.2 + Added: head/x11-drivers/xf86-input-fpit/files/patch-git_05_7a1245d ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-drivers/xf86-input-fpit/files/patch-git_05_7a1245d Mon Jan 23 22:27:49 2017 (r432297) @@ -0,0 +1,23 @@ +From 7a1245defa41517786e9752ea4e588c4f88f7047 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 19 Jul 2011 11:45:00 +1000 +Subject: Use xf86SetStrOption to print Option Device to the log + +Signed-off-by: Peter Hutterer + +diff --git a/src/xf86Fpit.c b/src/xf86Fpit.c +index 8c9c830..9ab3bb0 100644 +--- src/xf86Fpit.c ++++ src/xf86Fpit.c +@@ -564,7 +564,7 @@ static int xf86FpitInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) + return rc; + + priv = pInfo->private; +- str = xf86FindOptionValue(pInfo->options, "Device"); ++ str = xf86SetStrOption(pInfo->options, "Device", NULL); + if (!str) { + xf86Msg(X_ERROR, "%s: No Device specified in FPIT module config.\n", pInfo->name); + return BadValue; +-- +cgit v0.10.2 + Added: head/x11-drivers/xf86-input-fpit/files/patch-git_06_270607a ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-drivers/xf86-input-fpit/files/patch-git_06_270607a Mon Jan 23 22:27:49 2017 (r432297) @@ -0,0 +1,22 @@ +From 270607ae055a21bdac44f905a791260c5b34089b Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 19 Jul 2011 12:32:50 +1000 +Subject: Don't call DEVICE_OFF in UnInit, the server does it for us + +Signed-off-by: Peter Hutterer + +diff --git a/src/xf86Fpit.c b/src/xf86Fpit.c +index 9ab3bb0..eb85a2e 100644 +--- src/xf86Fpit.c ++++ src/xf86Fpit.c +@@ -542,7 +542,6 @@ static int xf86FpitAllocate(InputDriverPtr drv, InputInfoPtr pInfo) + static void xf86FpitUninit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) + { + FpitPrivatePtr priv = (FpitPrivatePtr) pInfo->private; +- xf86FpitControl(pInfo->dev, DEVICE_OFF); + free(priv->fpitDev); + free(priv); + pInfo->private = NULL; +-- +cgit v0.10.2 + Added: head/x11-drivers/xf86-input-fpit/files/patch-git_07_5772c7f ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-drivers/xf86-input-fpit/files/patch-git_07_5772c7f Mon Jan 23 22:27:49 2017 (r432297) @@ -0,0 +1,26 @@ +From 5772c7f58f24e259349ad048de096802184c7aa1 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Tue, 19 Jul 2011 15:52:11 +1000 +Subject: Check for priv before dereferencing it. + +We can hit this path when the priv alloc fails. + +Signed-off-by: Peter Hutterer + +diff --git a/src/xf86Fpit.c b/src/xf86Fpit.c +index eb85a2e..3c70b4a 100644 +--- src/xf86Fpit.c ++++ src/xf86Fpit.c +@@ -542,7 +542,8 @@ static int xf86FpitAllocate(InputDriverPtr drv, InputInfoPtr pInfo) + static void xf86FpitUninit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) + { + FpitPrivatePtr priv = (FpitPrivatePtr) pInfo->private; +- free(priv->fpitDev); ++ if (priv) ++ free(priv->fpitDev); + free(priv); + pInfo->private = NULL; + xf86DeleteInput(pInfo, 0); +-- +cgit v0.10.2 + Added: head/x11-drivers/xf86-input-fpit/files/patch-git_09_00742d9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-drivers/xf86-input-fpit/files/patch-git_09_00742d9 Mon Jan 23 22:27:49 2017 (r432297) @@ -0,0 +1,28 @@ +From 00742d9a9bcd06800b2548007ea304c331875666 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Mon, 20 Aug 2012 10:00:57 +1000 +Subject: Don't force pInfo->flags to 0 (#40870) + +The server uses the flags to decide if a device comes up as attached or +floating slave. Overwriting the flag after the server has processed the +CorePointer/AlwaysCore/Floating/etc options results in the device always +coming up as floating slave. This again makes the device appear +unresponsive. + +Signed-off-by: Peter Hutterer + +diff --git a/src/xf86Fpit.c b/src/xf86Fpit.c +index 3c70b4a..8852d4d 100644 +--- src/xf86Fpit.c ++++ src/xf86Fpit.c +@@ -527,7 +527,6 @@ static int xf86FpitAllocate(InputDriverPtr drv, InputInfoPtr pInfo) + priv->fpitOldProximity = 0; + priv->fpitIndex = 0; + priv->fpitPassive = 0; +- pInfo->flags = 0 /* XI86_NO_OPEN_ON_INIT */ ; + pInfo->device_control = xf86FpitControl; + pInfo->read_input = xf86FpitReadInput; + pInfo->control_proc = NULL; +-- +cgit v0.10.2 + Added: head/x11-drivers/xf86-input-fpit/files/patch-src_xf86Fpit.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/x11-drivers/xf86-input-fpit/files/patch-src_xf86Fpit.c Mon Jan 23 22:27:49 2017 (r432297) @@ -0,0 +1,52 @@ +# Finish converting RemoveEnabledDevice to xf86RemoveEnabledDevice +# Finish converting use of Error to ErrorF +# Remove obsolete xf86InputSetScreen +# Correct type of default_options +# +--- src/xf86Fpit.c.orig 2011-06-13 23:24:05 UTC ++++ src/xf86Fpit.c +@@ -251,7 +251,7 @@ static void xf86FpitReadInput(InputInfoP + /* Read data into buffer */ + len = xf86ReadSerial(pInfo->fd, priv->fpitData+priv->fpitIndex, BUFFER_SIZE-priv->fpitIndex); + if (len <= 0) { +- Error("error reading FPIT device"); ++ ErrorF("error reading FPIT device\n"); + priv->fpitIndex = 0; + return; + } +@@ -324,7 +324,7 @@ static void xf86FpitReadInput(InputInfoP + device = pInfo->dev; + + xf86FpitConvert(pInfo, 0, 2, x, y, 0, 0, 0, 0, &conv_x, &conv_y); +- xf86XInputSetScreen(pInfo, priv->screen_no, conv_x, conv_y); ++ //xf86XInputSetScreen(pInfo, priv->screen_no, conv_x, conv_y); + + /* coordinates are ready we can send events */ + +@@ -459,7 +459,7 @@ static Bool xf86FpitControl(DeviceIntPtr + if (pInfo->fd < 0) { + pInfo->fd = xf86OpenSerial(pInfo->options); + if (pInfo->fd < 0) { +- Error("Unable to open Fpit touchscreen device"); ++ ErrorF("Unable to open Fpit touchscreen device\n"); + return !Success; + } + +@@ -488,7 +488,7 @@ static Bool xf86FpitControl(DeviceIntPtr + case DEVICE_CLOSE: + dev->public.on = FALSE; + if (pInfo->fd >= 0) { +- RemoveEnabledDevice(pInfo->fd); ++ xf86RemoveEnabledDevice(pInfo); + } + xf86CloseSerial(pInfo->fd); + pInfo->fd = -1; +@@ -550,7 +550,7 @@ static void xf86FpitUninit(InputDriverPt + xf86DeleteInput(pInfo, 0); + } + +-static char *default_options[] = { ++static const char *default_options[] = { + "BaudRate", "19200", "StopBits", "0", "DataBits", "8", "Parity", "None", "Vmin", "10", "Vtime", "1", "FlowControl", "None", NULL + }; +