Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jan 2017 22:40:16 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r432300 - in head/x11-drivers/xf86-input-penmount: . files
Message-ID:  <201701232240.v0NMeGvB061925@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Mon Jan 23 22:40:16 2017
New Revision: 432300
URL: https://svnweb.freebsd.org/changeset/ports/432300

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:		216275
  Submitted by:	matthew@reztek.cz

Added:
  head/x11-drivers/xf86-input-penmount/files/
  head/x11-drivers/xf86-input-penmount/files/patch-git_01_f5aede2   (contents, props changed)
  head/x11-drivers/xf86-input-penmount/files/patch-git_02_ff389f9   (contents, props changed)
  head/x11-drivers/xf86-input-penmount/files/patch-src_xf86PM.c   (contents, props changed)
Modified:
  head/x11-drivers/xf86-input-penmount/Makefile

Modified: head/x11-drivers/xf86-input-penmount/Makefile
==============================================================================
--- head/x11-drivers/xf86-input-penmount/Makefile	Mon Jan 23 22:36:57 2017	(r432299)
+++ head/x11-drivers/xf86-input-penmount/Makefile	Mon Jan 23 22:40:16 2017	(r432300)
@@ -2,7 +2,7 @@
 
 PORTNAME=	xf86-input-penmount
 PORTVERSION=	1.5.0
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	x11-drivers
 
 MAINTAINER=	x11@FreeBSD.org

Added: head/x11-drivers/xf86-input-penmount/files/patch-git_01_f5aede2
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11-drivers/xf86-input-penmount/files/patch-git_01_f5aede2	Mon Jan 23 22:40:16 2017	(r432300)
@@ -0,0 +1,28 @@
+From f5aede2ed48f1cc7266e792b02f509f7b207e2d6 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Fri, 8 Jul 2011 14:26:16 +1000
+Subject: Don't override the device name.
+
+The device name comes from the xorg.conf (or the config backend). If you're
+capable of setting the device name in the config, you can set it in the
+Identifier line as well.
+
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+diff --git a/src/xf86PM.c b/src/xf86PM.c
+index edcf6f8..97e2134 100644
+--- src/xf86PM.c
++++ src/xf86PM.c
+@@ -492,9 +492,6 @@ PenMountPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+ 		goto SetupProc_fail;
+ 	}
+ 
+-	/* this results in an xstrdup that must be freed later */
+-	pInfo->name = xf86SetStrOption( pInfo->options, "DeviceName", "PenMount");
+-
+ 	return Success;
+ 
+   SetupProc_fail:
+-- 
+cgit v0.10.2
+

Added: head/x11-drivers/xf86-input-penmount/files/patch-git_02_ff389f9
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11-drivers/xf86-input-penmount/files/patch-git_02_ff389f9	Mon Jan 23 22:40:16 2017	(r432300)
@@ -0,0 +1,82 @@
+From ff389f91a2efec5184b56b8c717091d067f8fc46 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Tue, 19 Jul 2011 13:07:41 +1000
+Subject: Don't free anything in PreInit, let the server call UnInit instead
+
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+diff --git a/src/xf86PM.c b/src/xf86PM.c
+index 97e2134..ef73164 100644
+--- src/xf86PM.c
++++ src/xf86PM.c
+@@ -79,7 +79,7 @@ _X_EXPORT InputDriverRec PENMOUNT = {
+         "penmount",
+         NULL,
+         PenMountPreInit,
+-        /*PenMountUnInit*/NULL,
++        PenMountUnInit,
+         NULL,
+         default_options
+ };
+@@ -275,6 +275,7 @@ ProcessDeviceClose(PenMountPrivatePtr priv, DeviceIntPtr dev, InputInfoPtr pInfo
+ 					priv->buffer = NULL;
+ 				}
+ 			xf86CloseSerial(pInfo->fd);
++			pInfo->fd = -1;
+ 		}
+ 	dev->public.on = FALSE;
+ 	return (Success);
+@@ -454,6 +455,8 @@ PenMountPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+ 		goto SetupProc_fail;
+ 	}
+ 	xf86CloseSerial(pInfo->fd);
++	pInfo->fd = -1;
++
+ 	/* 
+ 	 * Process the options for your device like this
+ 	 */
+@@ -495,16 +498,21 @@ PenMountPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+ 	return Success;
+ 
+   SetupProc_fail:
+-	if ((pInfo) && (pInfo->fd))
+-		xf86CloseSerial (pInfo->fd);
+-	if ((pInfo) && (pInfo->name))
+-		free (pInfo->name);
++	return BadValue;
++}
++
++static void
++PenMountUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
++{
++	PenMountPrivatePtr priv = (PenMountPrivatePtr) (pInfo->private);
+ 
+-	if ((priv) && (priv->buffer))
+-		XisbFree (priv->buffer);
+ 	if (priv)
++	{
++		if (priv->buffer)
++			XisbFree (priv->buffer);
+ 		free (priv);
+-	return BadValue;
++		pInfo->private = NULL;
++	}
+ }
+ 
+ static Bool
+diff --git a/src/xf86PM.h b/src/xf86PM.h
+index 5183f91..88da048 100644
+--- src/xf86PM.h
++++ src/xf86PM.h
+@@ -93,6 +93,8 @@ static Bool PenMountSendPacket (PenMountPrivatePtr priv, unsigned char *buf, int
+ 
+ static int
+ PenMountPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags);
++static void
++PenMountUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags);
+ 
+ static void
+ PenMountPtrCtrl(DeviceIntPtr device, PtrCtrl *ctrl);
+-- 
+cgit v0.10.2
+

Added: head/x11-drivers/xf86-input-penmount/files/patch-src_xf86PM.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11-drivers/xf86-input-penmount/files/patch-src_xf86PM.c	Mon Jan 23 22:40:16 2017	(r432300)
@@ -0,0 +1,69 @@
+# Finish converting AddEnabledDefice to xf86AddEnabledDevice
+# Correct a couple strings that should be const
+# Remove use of obsolete xf86XInputSetScreen
+#
+--- src/xf86PM.c.orig	2011-06-28 00:37:48 UTC
++++ src/xf86PM.c
+@@ -61,7 +61,7 @@
+  * Be sure to set vmin appropriately for your device's protocol. You want to
+  * read a full packet before returning
+  */
+-static char *default_options[] =
++static const char *default_options[] =
+ {
+ 	/*	"Device", "/dev/ttyS1",*/
+ 	"BaudRate", "19200",
+@@ -258,7 +258,7 @@ DMC9000_ProcessDeviceOn(PenMountPrivateP
+ 	priv->lex_mode = PenMount_byte0;
+ 	
+ 	xf86FlushInput(pInfo->fd);
+-	AddEnabledDevice (pInfo->fd);
++	xf86AddEnabledDevice (pInfo);
+ 	dev->public.on = TRUE;
+ 	return (Success);
+ }
+@@ -268,7 +268,7 @@ ProcessDeviceClose(PenMountPrivatePtr pr
+ {
+ 	if (pInfo->fd != -1)
+ 		{ 
+-			RemoveEnabledDevice (pInfo->fd);
++			xf86RemoveEnabledDevice (pInfo);
+ 			if (priv->buffer)
+ 				{
+ 					XisbFree(priv->buffer);
+@@ -418,7 +418,7 @@ static int
+ PenMountPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+ {
+ 	PenMountPrivatePtr priv = calloc (1, sizeof (PenMountPrivateRec));
+-	char *s;
++	const char *s;
+ 
+ 	if (!priv)
+ 		return BadAlloc;
+@@ -603,7 +603,7 @@ DeviceControl (DeviceIntPtr dev, int mod
+ 		priv->lex_mode = PenMount_byte0;
+ 		
+ 		xf86FlushInput(pInfo->fd);
+-		AddEnabledDevice (pInfo->fd);
++		xf86AddEnabledDevice (pInfo);
+ 		dev->public.on = TRUE;
+ 		return (Success);
+ 		
+@@ -696,7 +696,7 @@ ReadInput (InputInfoPtr pInfo)
+ 					   priv->max_y);
+                 }        		
+ 
+-		xf86XInputSetScreen (pInfo, priv->screen_num, x, y);
++		//xf86XInputSetScreen (pInfo, priv->screen_num, x, y);
+ 
+ 		if ((priv->proximity == FALSE) && (priv->packet[0] & 0x01))
+ 		{
+@@ -796,7 +796,7 @@ DMC9000_ReadInput (InputInfoPtr pInfo)
+                 }
+         		
+ 
+-		xf86XInputSetScreen (pInfo, priv->screen_num, x, y);
++		//xf86XInputSetScreen (pInfo, priv->screen_num, x, y);
+ 
+ 		if ((priv->proximity == FALSE) && (priv->packet[0] & 0x01))
+ 		{



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701232240.v0NMeGvB061925>