summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-03-12 12:38:17 +0100
committerHans de Goede <hdegoede@redhat.com>2014-03-12 12:41:11 +0100
commite976b23c440629cbcbc4f6e604badbb2e3cb362d (patch)
tree15bbccd0ec83d36bfc536787fa0fe5a251a28dda
parent42910168adf682b1eec5d3298173789fcfdda927 (diff)
Add server managed fd handlingHEADmaster
This mostly consists of skipping common fd handling when server managed fds are in used, the rest is handled by xf86OpenSerial and our wcmClose xf86CloseSerial wrapper. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--src/wcmConfig.c5
-rw-r--r--src/xf86Wacom.c9
2 files changed, 13 insertions, 1 deletions
diff --git a/src/wcmConfig.c b/src/wcmConfig.c
index d19b9b4..9a3c8d7 100644
--- a/src/wcmConfig.c
+++ b/src/wcmConfig.c
@@ -634,7 +634,10 @@ InputDriverRec WACOM =
wcmUninit, /* un-init */
NULL, /* module */
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
- default_options
+ default_options,
+#endif
+#ifdef XI86_DRV_CAP_SERVER_FD
+ XI86_DRV_CAP_SERVER_FD,
#endif
};
diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
index 3057d7a..4f41d64 100644
--- a/src/xf86Wacom.c
+++ b/src/xf86Wacom.c
@@ -578,6 +578,10 @@ static int wcmDevOpen(DeviceIntPtr pWcm)
DBG(10, priv, "\n");
+ /* If fd management is done by the server, skip common fd handling */
+ if (pInfo->flags & XI86_SERVER_FD)
+ goto got_fd;
+
/* open file, if not already open */
if (common->fd_refs == 0)
{
@@ -610,6 +614,7 @@ static int wcmDevOpen(DeviceIntPtr pWcm)
common->fd_refs++;
}
+got_fd:
/* start the tablet data */
if (model->Start && (model->Start(pInfo) != Success))
return !Success;
@@ -754,6 +759,10 @@ static void wcmDevClose(InputInfoPtr pInfo)
WacomDevicePtr priv = (WacomDevicePtr)pInfo->private;
WacomCommonPtr common = priv->common;
+ /* If fd management is done by the server, skip common fd handling */
+ if (pInfo->flags & XI86_SERVER_FD)
+ return;
+
DBG(4, priv, "Wacom number of open devices = %d\n", common->fd_refs);
if (pInfo->fd >= 0)